Hibernate ORM PostInsertEvent - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM PostInsertEvent class.

This code example shows how to use the following methods:getId, getPersister, getState, getSession
	public EnversPostInsertEventListenerImpl(AuditConfiguration enversConfiguration) {
		super( enversConfiguration );
	} 
 
    public void onPostInsert(PostInsertEvent event) {
        String entityName = event.getPersister().getEntityName();
 
        if ( getAuditConfiguration().getEntCfg().isVersioned( entityName ) ) {
            AuditProcess auditProcess = getAuditConfiguration().getSyncManager().get(event.getSession());
 
            AuditWorkUnit workUnit = new AddWorkUnit(
					event.getSession(),
					event.getPersister().getEntityName(),
					getAuditConfiguration(), 
                    event.getId(),
					event.getPersister(),
					event.getState()
			); 
            auditProcess.addWorkUnit( workUnit );
 

6
CodeRank
This code example shows how to use the following methods:getEntity
	public EJB3PostInsertEventListener(EntityCallbackHandler callbackHandler) {
		this.callbackHandler = callbackHandler;
	} 
 
	public void onPostInsert(PostInsertEvent event) {
		Object entity = event.getEntity();
		callbackHandler.postCreate( entity );
	} 
} 
4
CodeRank