Search in sources :

Example 1 with HibernateSequenceEntity

use of org.hibernate.orm.test.annotations.id.sequences.entities.HibernateSequenceEntity in project hibernate-orm by hibernate.

the class HibernateSequenceTest method testHibernateSequenceNextVal.

@Test
public void testHibernateSequenceNextVal(SessionFactoryScope scope) {
    HibernateSequenceEntity entity = new HibernateSequenceEntity();
    scope.inTransaction(session -> {
        entity.setText("sample text");
        session.save(entity);
    });
    assertNotNull(entity.getId());
}
Also used : HibernateSequenceEntity(org.hibernate.orm.test.annotations.id.sequences.entities.HibernateSequenceEntity) Test(org.junit.jupiter.api.Test)

Aggregations

HibernateSequenceEntity (org.hibernate.orm.test.annotations.id.sequences.entities.HibernateSequenceEntity)1 Test (org.junit.jupiter.api.Test)1