/** * Perform an SQL INSERT, and then retrieve a generated identifier. * <p/> * This form is used for PostInsertIdentifierGenerator-style ids (IDENTITY, * select, etc). */ protected Serializable insert( final Object[] fields, final boolean[] notNull, String sql, final Object object, final SharedSessionContractImplementor session) throws HibernateException { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Inserting entity: {0} (native id)", getEntityName() ); if ( isVersioned() ) { LOG.tracev( "Version: {0}", Versioning.getVersion( fields, this ) ); } } Binder binder = new Binder() { public void bindValues(PreparedStatement ps) throws SQLException { dehydrate( null, fields, notNull, propertyColumnInsertable, 0, ps, session, false ); } public Object getEntity() { return object; } }; return identityDelegate.performInsert( sql, session, binder ); }
/** * Perform an SQL INSERT, and then retrieve a generated identifier. * <p/> * This form is used for PostInsertIdentifierGenerator-style ids (IDENTITY, * select, etc). */ protected Serializable insert( final Object[] fields, final boolean[] notNull, String sql, final Object object, final SessionImplementor session) throws HibernateException { if ( log.isTraceEnabled() ) { log.trace( "Inserting entity: " + getEntityName() + " (native id)" ); if ( isVersioned() ) { log.trace( "Version: " + Versioning.getVersion( fields, this ) ); } } Binder binder = new Binder() { public void bindValues(PreparedStatement ps) throws SQLException { dehydrate( null, fields, notNull, propertyColumnInsertable, 0, ps, session ); } public Object getEntity() { return object; } }; return identityDelegate.performInsert( sql, session, binder ); }
/** * Perform an SQL INSERT, and then retrieve a generated identifier. * <p/> * This form is used for PostInsertIdentifierGenerator-style ids (IDENTITY, * select, etc). */ protected Serializable insert( final Object[] fields, final boolean[] notNull, String sql, final Object object, final SessionImplementor session) throws HibernateException { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Inserting entity: {0} (native id)", getEntityName() ); if ( isVersioned() ) { LOG.tracev( "Version: {0}", Versioning.getVersion( fields, this ) ); } } Binder binder = new Binder() { public void bindValues(PreparedStatement ps) throws SQLException { dehydrate( null, fields, notNull, propertyColumnInsertable, 0, ps, session ); } public Object getEntity() { return object; } }; return identityDelegate.performInsert( sql, session, binder ); }
/** * Perform an SQL INSERT, and then retrieve a generated identifier. * <p/> * This form is used for PostInsertIdentifierGenerator-style ids (IDENTITY, * select, etc). */ protected Serializable insert( final Object[] fields, final boolean[] notNull, String sql, final Object object, final SessionImplementor session) throws HibernateException { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Inserting entity: {0} (native id)", getEntityName() ); if ( isVersioned() ) { LOG.tracev( "Version: {0}", Versioning.getVersion( fields, this ) ); } } Binder binder = new Binder() { public void bindValues(PreparedStatement ps) throws SQLException { dehydrate( null, fields, notNull, propertyColumnInsertable, 0, ps, session ); } public Object getEntity() { return object; } }; return identityDelegate.performInsert( sql, session, binder ); }