When you pass embedded object as a JPQL query parameter and the property of the embedded object is null, equals (=) operator is used instead of "is null".
@Entity
public class Example {
@Embedded
private User user;
(...) constructor, setters, getters
}
@Embeddable
public class User {
@Column
privateString name;
@Column
privateString email;
(...) constructor, setters, getters
}
For the following query "select e from Example e where e.user=?" and given parameter is:
User user = new User();
user.setName("foo");
user.setEmail(null);
The following SQL is executed:
select (...) from (...) where e.name=? and e.email=?
instead of:
select (...) from (...) where e.name=? and e.email is null
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira