Hi,
Working with JPA/Hibernate, I have a quite big "graph" of inter-linked entity-objects, and try to save it to the database.
Calling entityManager.persist(company), I get the validation error below, but not yet able to pinpoint the exact cause of it.
The error-msg complaints abt validation on the Root object (Company), but I suspect the error is not there, but in one of the many linked child-entities.
1. Just wondered if that is possible, or would the error-msg in that case refer to the sub-entity rather than the Root class?
2. Is there any way I can get Hibernate to tell me more specifically which class & attribute that actually fails to validate?
Best regards, _________________________
Caused by: org.hibernate.validator.InvalidStateException: validation failed for: entity.Company at org.hibernate.validator.event.ValidateEventListener.validate(ValidateEventListener.java:148) at org.hibernate.validator.event.ValidateEventListener.onPreInsert(ValidateEventListener.java:172) at org.hibernate.action.EntityInsertAction.preInsert(EntityInsertAction.java:178) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:72) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027) at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:304) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:197) at $Proxy63.flush(Unknown Source) at dao.CompanyDAO.saveCompany(CompanyDAO.java:211)
|