I get an InvalidStateException when inserting an entity in Hibernate with JPA. I've learned that the exceptions originates from the ValidateEventListener class from Hibernate. It gets thrown but I have nowhere to catch it.
Does anyone know how I can catch this exception so I can log the invalidvalue?
@Override
public T create(T entity) {
getEntityManager().persist(entity);
return entity;
}
When I surround the persist I can't catch the InvalidstateException. Its already gone.