Skip to content

Commit ff4e53d

Browse files
ToOne: suggest fix in DbDetachedException message.
#516 #412
1 parent 5504c71 commit ff4e53d

File tree

1 file changed

+2
-1
lines changed
  • objectbox-java/src/main/java/io/objectbox/relation

1 file changed

+2
-1
lines changed

objectbox-java/src/main/java/io/objectbox/relation/ToOne.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ private void ensureBoxes(TARGET target) {
119119
boxStore = (BoxStore) boxStoreField.get(target);
120120
}
121121
if (boxStore == null) {
122-
throw new DbDetachedException("Cannot resolve relation for detached entities");
122+
throw new DbDetachedException("Cannot resolve relation for detached entities, " +
123+
"call box.attach(entity) beforehand.");
123124
}
124125
}
125126
} catch (IllegalAccessException e) {

0 commit comments

Comments
 (0)