Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Dont throw when querying for a parent class of a subclass that has a …
…parent
  • Loading branch information
eman3488 committed Apr 16, 2020
commit 4bf302c535d208de362f6806326ab5ce9176595d
7 changes: 3 additions & 4 deletions src/main/java/com/googlecode/objectify/impl/KeyMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,9 @@ private void setKey(final P pojo, final IncompleteKey key, final LoadContext ctx

final com.google.cloud.datastore.Key parentKey = key.getParent();
if (parentKey != null) {
if (this.parentMeta == null)
throw new IllegalStateException("Loaded Entity has parent but " + clazz.getName() + " has no @Parent");

parentMeta.setValue(pojo, (Value)KeyValue.of(parentKey), ctx, containerPath);
if (this.parentMeta != null) {
parentMeta.setValue(pojo, (Value) KeyValue.of(parentKey), ctx, containerPath);
}
}

if (namespaceMeta != null) {
Expand Down