Issue Type: Bug Bug
Affects Versions: 4.2.0.Final
Assignee: Unassigned
Components: core
Created: 11/Apr/13 5:17 AM
Description:

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
   private String name;
   @Column
   private String 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

The test case is prepared in: https://github.com/mkuthan/example-spring

Let me know if you need more details.

Project: Hibernate ORM
Priority: Major Major
Reporter: Marcin Kuthan
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