/** * Handle the given create event. * * @param event The save event to be handled. * @param createCache The copy cache of entity instance to merge/copy instance. */ @SuppressWarnings({"unchecked"}) protected void entityIsTransient(PersistEvent event, Map createCache) { LOG.trace( "Saving transient instance" ); final EventSource source = event.getSession(); final Object entity = source.getPersistenceContext().unproxy( event.getObject() ); if ( createCache.put( entity, entity ) == null ) { saveWithGeneratedId( entity, event.getEntityName(), createCache, source, false ); } }
@Override protected Serializable saveWithGeneratedId( Object entity, String entityName, Object anything, EventSource source, boolean requiresImmediateIdAccess) { callbackHandler.preCreate( entity ); return super.saveWithGeneratedId( entity, entityName, anything, source, requiresImmediateIdAccess ); }
/** * Handle the given create event. * * @param event The save event to be handled. * @param createCache The copy cache of entity instance to merge/copy instance. */ @SuppressWarnings( {"unchecked"}) protected void entityIsTransient(PersistEvent event, Map createCache) { LOG.trace( "Saving transient instance" ); final EventSource source = event.getSession(); final Object entity = source.getPersistenceContext().unproxy( event.getObject() ); if ( createCache.put( entity, entity ) == null ) { saveWithGeneratedId( entity, event.getEntityName(), createCache, source, false ); } }
/** * Handle the given create event. * * @param event The save event to be handled. * @param createCache The copy cache of entity instance to merge/copy instance. */ @SuppressWarnings({"unchecked"}) protected void entityIsTransient(PersistEvent event, Map createCache) { LOG.trace( "Saving transient instance" ); final EventSource source = event.getSession(); final Object entity = source.getPersistenceContext().unproxy( event.getObject() ); if ( createCache.put( entity, entity ) == null ) { saveWithGeneratedId( entity, event.getEntityName(), createCache, source, false ); } }
/** * Handle the given create event. * * @param event The save event to be handled. * @param createCache The copy cache of entity instance to merge/copy instance. */ @SuppressWarnings( {"unchecked"}) protected void entityIsTransient(PersistEvent event, Map createCache) { LOG.trace( "Saving transient instance" ); final EventSource source = event.getSession(); final Object entity = source.getPersistenceContext().unproxy( event.getObject() ); if ( createCache.put( entity, entity ) == null ) { saveWithGeneratedId( entity, event.getEntityName(), createCache, source, false ); } }