I have implemeted a PreInsertEventListener and would like to create a new entity and store this entity in the database within the same transaction.
My code make no error but there is no record stored in the database. Did some have an Idea ?
thanks
Quote:
public boolean onPreInsert(PreInsertEvent event) {
Object entity = event.getEntity();
if (entity instanceof LdapReplicated) {
ReplicationStandingQ aReplication = new ReplicationStandingQ();
aReplication.setInsertedOn(new Date());
event.getSession().save(aReplication);
}
return false;
}