[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5791) nullability of property is checked even if hibernate.check_nullability is set to false

Paweł Kępka (JIRA) noreply at atlassian.com
Tue Dec 14 06:17:13 EST 2010


nullability of property is checked even if hibernate.check_nullability is set to false
--------------------------------------------------------------------------------------

                 Key: HHH-5791
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5791
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.6.0
         Environment: Hibernate 3.6.0-Final, MySQL
            Reporter: Paweł Kępka


In our application we use a subclass of org.hibernate.cfg.beanvalidation.BeanValidationEventListener which integrates with Spring for entity validation.
In order to wire our class we use following configuration:

hibernate.ejb.event.pre-update=com.acme.SpringBeanValidationEventListener
hibernate.ejb.event.pre-insert=com.acme.SpringBeanValidationEventListener
javax.persistence.validation.mode=none
hibernate.check_nullability=false

But this stopped to work when we tried to switch from Hibernate 3.5.3 to 3.6.0.
When we try to merge an entity which has a null property with @NotNull annotation and nullable set to false we get:

java.lang.NullPointerException: null entities are not supported by org.hibernate.event.def.EventCache
	at org.hibernate.event.def.EventCache.containsKey(EventCache.java:80)
	at org.hibernate.event.def.DefaultMergeEventListener.mergeTransientEntity(DefaultMergeEventListener.java:361)
	at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:303)
	at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:258)
	at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)
	at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:867)
	at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:851)
	at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:855)
	at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:686)

instead of ConstraintViolationException. Setting nullable to true resolves the problem but it is temporary solution only.
The whole issues might to be related to HHH-5437. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list