detachedcriteria - Spring hibernate criteria nested object

I have problem with correct query for my data. @Id@GeneratedValueprivate Integer id;@Size(min = 1, message = "")@Column(unique = true)@UniqueUserName(message = "")private String name;@Size(min = 1, message = "")@Emailprivate String email;@Size(min = 5, message = "")private String password;private boolean enabled;@ManyToMany@JoinTableprivate List<Role> roles;@OneToOne@JoinColumnprivate PersonalData personalData;@OneToMany(cascade = CascadeType.REMOVE)@JoinColumn(name = "OWNED_USER_ID")private List<User> userList; That's my class U...Read more

How to use Hibernate Criteria objects for multiple and/or conditions

I need to create a Hibernate criteria restriction that ors 3 Conditions. The problem is that the last condition is acutally to conditions using the AND operator.My first condition:Criterion startInRange = Restrictions.between("expectedStartCanonicDate", rangeStart, rangeEnd);My second condition:Criterion endInRange = Restrictions.between("expectedCompletionCanonicDate", rangeStart, rangeEnd);MY third condition needs to AND the following two conditions t...Read more