diff --git a/core/src/main/java/google/registry/persistence/VKey.java b/core/src/main/java/google/registry/persistence/VKey.java index 9383a165a..a9fc6d87f 100644 --- a/core/src/main/java/google/registry/persistence/VKey.java +++ b/core/src/main/java/google/registry/persistence/VKey.java @@ -43,11 +43,11 @@ public class VKey extends ImmutableObject { return new VKey(kind, ofyKey, primaryKey); } - public static VKey create(Class kind, Object primaryKey) { + public static VKey createSql(Class kind, Object primaryKey) { return new VKey(kind, null, primaryKey); } - public static VKey create( + public static VKey createOfy( Class kind, com.googlecode.objectify.Key ofyKey) { return new VKey(kind, ofyKey, null); } diff --git a/core/src/test/java/google/registry/persistence/transaction/JpaTransactionManagerImplTest.java b/core/src/test/java/google/registry/persistence/transaction/JpaTransactionManagerImplTest.java index dfdd79b6f..e3366cfd4 100644 --- a/core/src/test/java/google/registry/persistence/transaction/JpaTransactionManagerImplTest.java +++ b/core/src/test/java/google/registry/persistence/transaction/JpaTransactionManagerImplTest.java @@ -43,11 +43,11 @@ public class JpaTransactionManagerImplTest { private final FakeClock fakeClock = new FakeClock(); private final TestEntity theEntity = new TestEntity("theEntity", "foo"); - private final VKey theEntityKey = VKey.create(TestEntity.class, "theEntity"); + private final VKey theEntityKey = VKey.createSql(TestEntity.class, "theEntity"); private final TestCompoundIdEntity compoundIdEntity = new TestCompoundIdEntity("compoundIdEntity", 10, "foo"); private final VKey compoundIdEntityKey = - VKey.create(TestCompoundIdEntity.class, new CompoundId("compoundIdEntity", 10)); + VKey.createSql(TestCompoundIdEntity.class, new CompoundId("compoundIdEntity", 10)); private final ImmutableList moreEntities = ImmutableList.of( new TestEntity("entity1", "foo"), @@ -225,7 +225,7 @@ public class JpaTransactionManagerImplTest { public void update_succeeds() { jpaTm().transact(() -> jpaTm().saveNew(theEntity)); TestEntity persisted = - jpaTm().transact(() -> jpaTm().load(VKey.create(TestEntity.class, "theEntity"))).get(); + jpaTm().transact(() -> jpaTm().load(VKey.createSql(TestEntity.class, "theEntity"))).get(); assertThat(persisted.data).isEqualTo("foo"); theEntity.data = "bar"; jpaTm().transact(() -> jpaTm().update(theEntity)); diff --git a/core/src/test/java/google/registry/schema/registrar/RegistrarDaoTest.java b/core/src/test/java/google/registry/schema/registrar/RegistrarDaoTest.java index 3adc6b3b3..b1bbe2847 100644 --- a/core/src/test/java/google/registry/schema/registrar/RegistrarDaoTest.java +++ b/core/src/test/java/google/registry/schema/registrar/RegistrarDaoTest.java @@ -32,7 +32,7 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class RegistrarDaoTest extends EntityTestCase { - private final VKey registrarKey = VKey.create(Registrar.class, "registrarId"); + private final VKey registrarKey = VKey.createSql(Registrar.class, "registrarId"); private Registrar testRegistrar; diff --git a/core/src/test/java/google/registry/tools/UpdateRegistrarCommandTest.java b/core/src/test/java/google/registry/tools/UpdateRegistrarCommandTest.java index 3c72435f6..ab101ce87 100644 --- a/core/src/test/java/google/registry/tools/UpdateRegistrarCommandTest.java +++ b/core/src/test/java/google/registry/tools/UpdateRegistrarCommandTest.java @@ -52,7 +52,7 @@ public class UpdateRegistrarCommandTest extends CommandTestCase jpaTm().load(VKey.create(Registrar.class, "NewRegistrar"))) + .transact(() -> jpaTm().load(VKey.createSql(Registrar.class, "NewRegistrar"))) .get() .verifyPassword("some_password")) .isTrue();