Search in sources :

Example 1 with OrderedSequenceGenerator

use of org.hibernate.envers.enhanced.OrderedSequenceGenerator in project hibernate-orm by hibernate.

the class MonotonicRevisionNumberTest method testOracleSequenceOrder.

@Test
public void testOracleSequenceOrder() {
    EntityPersister persister = sessionFactory().getEntityPersister(SequenceIdRevisionEntity.class.getName());
    IdentifierGenerator generator = persister.getIdentifierGenerator();
    Assert.assertTrue(OrderedSequenceGenerator.class.isInstance(generator));
    OrderedSequenceGenerator seqGenerator = (OrderedSequenceGenerator) generator;
    Assert.assertTrue("Oracle sequence needs to be ordered in RAC environment.", seqGenerator.sqlCreateStrings(getDialect())[0].toLowerCase().endsWith(" order"));
}
Also used : EntityPersister(org.hibernate.persister.entity.EntityPersister) SequenceIdRevisionEntity(org.hibernate.envers.enhanced.SequenceIdRevisionEntity) OrderedSequenceGenerator(org.hibernate.envers.enhanced.OrderedSequenceGenerator) IdentifierGenerator(org.hibernate.id.IdentifierGenerator) Test(org.junit.Test)

Aggregations

OrderedSequenceGenerator (org.hibernate.envers.enhanced.OrderedSequenceGenerator)1 SequenceIdRevisionEntity (org.hibernate.envers.enhanced.SequenceIdRevisionEntity)1 IdentifierGenerator (org.hibernate.id.IdentifierGenerator)1 EntityPersister (org.hibernate.persister.entity.EntityPersister)1 Test (org.junit.Test)1