You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support entity classes that are inner classes #1006
Describe the bug
Placing entity classes annotated with @Entity and @BaseEntity in another class will result in an error when building.
Basic info (please complete the following information):
ObjectBox version: 2.9.1
Reproducibility: always
Device: N/A (compile time error)
OS: N/A (Android library)
To Reproduce
Steps to reproduce the behavior: 1. Create the following hierarchy of classes and build
public class Holder {
@BaseEntity
public static abstract class Parent {
@Id
long boxId;
private String text;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
@Entity
public static class Child extends Parent {
}
}
Logs, stack traces
Won't provide because this won't help in any way as IDE's build errors will be much clearer when dev-team build it themselves
changed the title [-]ObjectBox fails to generate classes if `entity` classes are static inner class of another class[/-][+]Support entity classes that are inner classes[/+]on May 9, 2023
Activity
greenrobot-team commentedon Aug 31, 2021
Thanks for reporting! This is due to generated code missing imports of the inner class (
error: cannot find symbol).A workaround is to make at least the
@Entityclass a top-level class.Internal issue
objectbox-java#159For anyone else affected, it helps us prioritize issues if you thumbs up the first post (GitHub can sort issues by thumbs ups)!
[-]ObjectBox fails to generate classes if `entity` classes are static inner class of another class[/-][+]Support entity classes that are inner classes[/+]