File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
objectbox-java/src/main/java/io/objectbox/relation Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -112,16 +112,17 @@ private void ensureBoxes(TARGET target) {
112
112
Field boxStoreField = ReflectionCache .getInstance ().getField (entity .getClass (), "__boxStore" );
113
113
try {
114
114
boxStore = (BoxStore ) boxStoreField .get (entity );
115
- debugRelations = boxStore .isDebugRelations ();
116
115
if (boxStore == null ) {
117
116
if (target != null ) {
118
117
boxStoreField = ReflectionCache .getInstance ().getField (target .getClass (), "__boxStore" );
119
118
boxStore = (BoxStore ) boxStoreField .get (target );
120
119
}
121
120
if (boxStore == null ) {
122
- throw new DbDetachedException ("Cannot resolve relation for detached entities" );
121
+ throw new DbDetachedException ("Cannot resolve relation for detached entities, " +
122
+ "call box.attach(entity) beforehand." );
123
123
}
124
124
}
125
+ debugRelations = boxStore .isDebugRelations ();
125
126
} catch (IllegalAccessException e ) {
126
127
throw new RuntimeException (e );
127
128
}
You can’t perform that action at this time.
0 commit comments