objectbox-java icon indicating copy to clipboard operation
objectbox-java copied to clipboard

Allow @Entity to override same name property of @BaseEntity

Open mecoFarid opened this issue 3 years ago • 1 comments

Trying to add same name variable in Entity which is already defined in parent class annotated by BaseEntity.

@Entity
public class Child extends Parent {
    @Id(assignable = true)
    public long id;
}

@BaseEntity
public class Parent {
    @Id
    public long id;
}

Building the project throws the following error:

error: [ObjectBox] Could not add property: Duplicate name "id" in entity "Child": [Property id of Child] vs. [Property id of Child] (com.mecofarid.myapplication.Child.id) public long id;

Is there any workaround or method to override the same name variable in the child class?

Note: Removing BaseEntity annotation from Parent class builds successfully

mecoFarid avatar Apr 13 '21 17:04 mecoFarid

Nope, this is currently not supported.

greenrobot-team avatar Apr 19 '21 06:04 greenrobot-team