diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/EntityLoader.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/EntityLoader.java index 0d034622d0..0ce0313357 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/EntityLoader.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/EntityLoader.java @@ -63,8 +63,7 @@ public class EntityLoader extends AbstractLoadPlanBasedEntityLoader { private final OuterJoinLoadable persister; private int batchSize = 1; private LoadQueryInfluencers influencers = LoadQueryInfluencers.NONE; - private LockMode lockMode = LockMode.NONE; - private LockOptions lockOptions; + private LockOptions lockOptions = new LockOptions( LockMode.NONE ); public Builder(OuterJoinLoadable persister) { this.persister = persister; @@ -81,7 +80,7 @@ public class EntityLoader extends AbstractLoadPlanBasedEntityLoader { } public Builder withLockMode(LockMode lockMode) { - this.lockMode = lockMode; + this.lockOptions.setLockMode( lockMode ); return this; } @@ -113,7 +112,7 @@ public class EntityLoader extends AbstractLoadPlanBasedEntityLoader { @Override public LockMode getLockMode() { - return lockMode; + return lockOptions.getLockMode(); } @Override diff --git a/hibernate-core/src/test/java/org/hibernate/test/id/SQLServer2012Person.hbm.xml b/hibernate-core/src/test/java/org/hibernate/test/id/PersonWithSequenceInitialValue.hbm.xml similarity index 100% rename from hibernate-core/src/test/java/org/hibernate/test/id/SQLServer2012Person.hbm.xml rename to hibernate-core/src/test/java/org/hibernate/test/id/PersonWithSequenceInitialValue.hbm.xml diff --git a/hibernate-core/src/test/java/org/hibernate/test/id/SQLServer2012SequenceGeneratorTest.java b/hibernate-core/src/test/java/org/hibernate/test/id/SequenceGeneratorWithInitialValueTest.java similarity index 77% rename from hibernate-core/src/test/java/org/hibernate/test/id/SQLServer2012SequenceGeneratorTest.java rename to hibernate-core/src/test/java/org/hibernate/test/id/SequenceGeneratorWithInitialValueTest.java index 88339690f1..28df43de3d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/id/SQLServer2012SequenceGeneratorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/id/SequenceGeneratorWithInitialValueTest.java @@ -4,8 +4,10 @@ import static org.junit.Assert.assertTrue; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.dialect.H2Dialect; import org.hibernate.dialect.SQLServer2012Dialect; import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.SkipForDialect; @@ -13,11 +15,11 @@ import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.junit.Test; -public class SQLServer2012SequenceGeneratorTest extends BaseCoreFunctionalTestCase { +public class SequenceGeneratorWithInitialValueTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { - return new String[] { "id/SQLServer2012Person.hbm.xml" }; + return new String[] { "id/PersonWithSequenceInitialValue.hbm.xml" }; } /** @@ -27,7 +29,8 @@ public class SQLServer2012SequenceGeneratorTest extends BaseCoreFunctionalTestCa */ @Test @TestForIssue(jiraKey = "HHH-8814") - @RequiresDialect(value=SQLServer2012Dialect.class) + @FailureExpectedWithNewMetamodel(jiraKey = "HHH-9189") + @RequiresDialect(value={SQLServer2012Dialect.class, H2Dialect.class}) public void testStartOfSequence() throws Exception { Session s = openSession(); Transaction tx = s.beginTransaction();