Java Code Examples for org.hibernate.id.enhanced.SequenceStyleGenerator#configure()
The following examples show how to use
org.hibernate.id.enhanced.SequenceStyleGenerator#configure() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SequenceStyleConfigUnitTest.java From cacheonix-core with GNU Lesser General Public License v2.1 | 5 votes |
/** * Test all params defaulted with a dialect supporting sequences */ public void testDefaultedSequenceBackedConfiguration() { Dialect dialect = new SequenceDialect(); Properties props = new Properties(); SequenceStyleGenerator generator = new SequenceStyleGenerator(); generator.configure( Hibernate.LONG, props, dialect ); assertClassAssignability( SequenceStructure.class, generator.getDatabaseStructure().getClass() ); assertClassAssignability( OptimizerFactory.NoopOptimizer.class, generator.getOptimizer().getClass() ); assertEquals( SequenceStyleGenerator.DEF_SEQUENCE_NAME, generator.getDatabaseStructure().getName() ); }
Example 2
Source File: SequenceStyleConfigUnitTest.java From cacheonix-core with GNU Lesser General Public License v2.1 | 5 votes |
/** * Test all params defaulted with a dialect which does not support sequences */ public void testDefaultedTableBackedConfiguration() { Dialect dialect = new TableDialect(); Properties props = new Properties(); SequenceStyleGenerator generator = new SequenceStyleGenerator(); generator.configure( Hibernate.LONG, props, dialect ); assertClassAssignability( TableStructure.class, generator.getDatabaseStructure().getClass() ); assertClassAssignability( OptimizerFactory.NoopOptimizer.class, generator.getOptimizer().getClass() ); assertEquals( SequenceStyleGenerator.DEF_SEQUENCE_NAME, generator.getDatabaseStructure().getName() ); }
Example 3
Source File: SequenceStyleConfigUnitTest.java From cacheonix-core with GNU Lesser General Public License v2.1 | 5 votes |
/** * Test default optimizer selection for table backed generators * based on the configured increment size. Here we always prefer * pooled. */ public void testDefaultOptimizerBasedOnIncrementBackedByTable() { Properties props = new Properties(); props.setProperty( SequenceStyleGenerator.INCREMENT_PARAM, "10" ); Dialect dialect = new TableDialect(); SequenceStyleGenerator generator = new SequenceStyleGenerator(); generator.configure( Hibernate.LONG, props, dialect ); assertClassAssignability( TableStructure.class, generator.getDatabaseStructure().getClass() ); assertClassAssignability( OptimizerFactory.PooledOptimizer.class, generator.getOptimizer().getClass() ); assertEquals( SequenceStyleGenerator.DEF_SEQUENCE_NAME, generator.getDatabaseStructure().getName() ); }
Example 4
Source File: SequenceStyleConfigUnitTest.java From cacheonix-core with GNU Lesser General Public License v2.1 | 5 votes |
/** * Test forcing of table as backing strucuture with dialect supporting sequences */ public void testForceTableUse() { Dialect dialect = new SequenceDialect(); Properties props = new Properties(); props.setProperty( SequenceStyleGenerator.FORCE_TBL_PARAM, "true" ); SequenceStyleGenerator generator = new SequenceStyleGenerator(); generator.configure( Hibernate.LONG, props, dialect ); assertClassAssignability( TableStructure.class, generator.getDatabaseStructure().getClass() ); assertClassAssignability( OptimizerFactory.NoopOptimizer.class, generator.getOptimizer().getClass() ); assertEquals( SequenceStyleGenerator.DEF_SEQUENCE_NAME, generator.getDatabaseStructure().getName() ); }