HHH-10876 : corrections due to backporting
(cherry picked from commit ee2db37052
)
This commit is contained in:
parent
a505028533
commit
906341349b
|
@ -10,29 +10,21 @@ import java.util.Map;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.boot.SessionFactoryBuilder;
|
||||
import org.hibernate.cfg.Environment;
|
||||
import org.hibernate.dialect.SQLServer2012Dialect;
|
||||
|
||||
import org.hibernate.id.SequenceGenerator;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
import org.hibernate.testing.DialectChecks;
|
||||
import org.hibernate.testing.RequiresDialectFeature;
|
||||
import org.hibernate.testing.SkipForDialect;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
|
||||
import org.hibernate.test.util.jdbc.SQLStatementInterceptor;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class SequenceGeneratorTest extends BaseNonConfigCoreFunctionalTestCase {
|
||||
|
||||
private SQLStatementInterceptor sqlStatementInterceptor;
|
||||
|
||||
@Override
|
||||
protected void configureSessionFactoryBuilder(SessionFactoryBuilder sfb) {
|
||||
sqlStatementInterceptor = new SQLStatementInterceptor( sfb );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getMappings() {
|
||||
return new String[] { "id/Person.hbm.xml" };
|
||||
|
@ -62,11 +54,9 @@ public class SequenceGeneratorTest extends BaseNonConfigCoreFunctionalTestCase {
|
|||
s.close();
|
||||
|
||||
assertTrue( person.getId() > 0 );
|
||||
assertTrue( sqlStatementInterceptor.getSqlQueries()
|
||||
.stream()
|
||||
.filter( sql -> sql.contains( "product_sequence" ) )
|
||||
.findFirst()
|
||||
.isPresent() );
|
||||
|
||||
final EntityPersister persister = sessionFactory().getEntityPersister( Person.class.getName() );
|
||||
assertTrue( SequenceGenerator.class.isInstance( persister.getIdentifierGenerator() ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue