use of org.hibernate.event.spi.PersistEvent in project hibernate-orm by hibernate.
the class SessionImpl method persist.
@Override
public void persist(Object object) throws HibernateException {
checkOpen();
firePersist(new PersistEvent(null, object, this));
}
use of org.hibernate.event.spi.PersistEvent in project hibernate-orm by hibernate.
the class AbstractEntityTuplizer method persistTransientEntity.
private static Serializable persistTransientEntity(Object entity, SharedSessionContractImplementor session) {
assert session != null;
LOG.debug("Performing implicit derived identity cascade");
final PersistEvent event = new PersistEvent(null, entity, (EventSource) session);
for (PersistEventListener listener : persistEventListeners(session)) {
listener.onPersist(event);
}
final EntityEntry pcEntry = session.getPersistenceContext().getEntry(entity);
if (pcEntry == null || pcEntry.getId() == null) {
throw new HibernateException("Unable to process implicit derived identity cascade");
}
return pcEntry.getId();
}
use of org.hibernate.event.spi.PersistEvent in project hibernate-orm by hibernate.
the class SessionImpl method persist.
// persist() operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Override
public void persist(String entityName, Object object) throws HibernateException {
checkOpen();
firePersist(new PersistEvent(entityName, object, this));
}
use of org.hibernate.event.spi.PersistEvent in project hibernate-orm by hibernate.
the class SessionImpl method persist.
@Override
public void persist(String entityName, Object object, Map copiedAlready) throws HibernateException {
checkOpenOrWaitingForAutoClose();
firePersist(copiedAlready, new PersistEvent(entityName, object, this));
}
Aggregations