Cloud Datastore Java SDK - parent keys are created without the correct database ID
nzhenry opened this issue · 0 comments
nzhenry commented
Environment details
Java version: 17
SDK version: 2.19.4-SNAPSHOT
Steps to reproduce
- Create a key with a parent and a non-default database ID
- Compare the database ID of the key to the database ID of the parent
- Observe the values are different. They should be the same.
Code example
Key entityKey = DatastoreOptions.newBuilder()
.setDatabaseId("my-database-id")
.build()
.getService()
.newKeyFactory()
.setKind("EntityKind")
.addAncestor(PathElement.of("ParentKind", 1L))
.newKey(2L);
System.out.printf("Entity database ID: %s%n", entityKey.getDatabaseId());
System.out.printf("Parent database ID: %s%n", entityKey.getParent().getDatabaseId());