Consider the following entity.
@Entity
public class Member {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String memberName;
@ElementCollection
@CollectionTable(joinColumns=@JoinColumn(name="memberId"))
@MapKeyColumn(name="prop")
@Column(name="val")
private Map<String, Boolean> checklist;
/** usual getters and setters **/
}
Assuming the above entity creates two table; member and member_checklist; is it possible for me to achieve the following sql statement with jpa 2 criteria api?
select * from member where id not in (
select memberid from member_checklist where prop in (2));
I've read Hibernate Criteria API - adding a criterion: string should be in collection but I still can't figure out how I can achieve my goal.
Looking forward to some expert opinions.