Entity Inheritance
How to inherit properties from entity super classes.
ObjectBox - Entity Super Classes
// Superclass:
@BaseEntity
public abstract class Base {
@Id long id;
String baseString;
public Base() {
}
public Base(long id, String baseString) {
this.id = id;
this.baseString = baseString;
}
}
// Subclass:
@Entity
public class Sub extends Base {
String subString;
public Sub() {
}
public Sub(long id, String baseString, String subString) {
super(id, baseString);
this.subString = subString;
}
}Notes on usage
Restrictions
Last updated
Was this helpful?