Methods Summary |
---|
public boolean | appliesTo(org.hibernate.dialect.Dialect dialect)
// the DataDirect driver for Oracle known to not support
// JDBC3 getGeneratedKeys...
return ( dialect instanceof Oracle9Dialect ) && ( ! ( dialect instanceof DataDirectOracle9Dialect ) ) ;
|
public void | configure(org.hibernate.cfg.Configuration cfg)
super.configure( cfg );
|
public java.lang.String[] | getMappings()
return new String[] { "generatedkeys/seqidentity/MyEntity.hbm.xml" };
|
public static junit.framework.Test | suite()
return new FunctionalTestClassTestSuite( SequenceIdentityTest.class );
|
public void | testSequenceIdentityGenerator()
Session session = openSession();
session.beginTransaction();
MyEntity e = new MyEntity( "entity-1" );
session.save( e );
// this insert should happen immediately!
assertEquals( "id not generated through forced insertion", new Long(1), e.getId() );
session.delete( e );
session.getTransaction().commit();
session.close();
|