我有两个列表List<AreaOfInterest>和List<AreaOfInterestBean>. 对应的类是,
@Entity
@Data
@Table( name = "interest_area" )
public class AreaOfInterest {
@Id
@GeneratedValue( strategy = GenerationType.AUTO )
@Column( name = "ia_id" )
private Long id;
@Column( name = "ia_value" )
private String value;
@Column( name = "ia_is_active" )
private Boolean isActive;
@Column( name = "ia_created_at" )
private Calendar createdAt;
@Column( name = "ia_is_approved" )
private Boolean isApprovedByAdmin;
@Column( name = "ia_approved_at" )
private Calendar approvedAt;
}
和,
@Data
public class AreaOfInterestBean {
private Long id;
private String value;
private boolean isSelected;
}
我想检查 的对象List<AreaOfInterest>是否存在List<AreaOfInterestBean>,如果存在,我需要更新List<AreaOfInterestBean>. 现在,我觉得我必须迭代两个列表来解决这个问题。有什么有效的方法吗?
动漫人物
ibeautiful
相关分类