objectbox / objectbox/objectbox-java

Allow @Entity to override same name property of @BaseEntity

オープン
#977 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement
主要言語
Java
スター
4.6k
フォーク
311
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、issue に示されている Child クラスと Parent Java クラスを使って、両方の @Id フィールドと @BaseEntity を含めた build を再現します。生成された重複プロパティエラーを、@BaseEntity を削除した後に build が成功する場合と比較します。継承ケースがサポートされているかを判断し、確認済みの回避策を文書化または実装できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。