1

私は Play Java アプリを作成しており、デフォルトの Ebean を ORM フレームワークとして使用しています。ManyToOneオブジェクトをOneToMany双方向マッピングでセットアップしました。

私が抱えている問題は、返されたオブジェクトのプロパティSimCard.find.all()を調べて見ると、ID を除いてすべてのプロパティが null になっていることです。poolPlanPool

これが私のオブジェクトのセットアップです:

SIMカード:

@Entity
public class SimCard extends Model {
    private static final long serialVersionUID = 8664141460726922270L;

    @Id
    public String simId;

    public String displayName;

    @ManyToOne
    public PlanPool pool;

    @OneToMany(mappedBy = "simCard")
    public List<SimUsage> usages;

    public static Model.Finder<String, SimCard> find = new Model.Finder<String, SimCard>(String.class, SimCard.class);
}

プランプール:

@Entity
public class PlanPool extends Model {
    private static final long serialVersionUID = 4083095490040410160L;

    @Id
    public Long poolId;

    public String displayName;

    @ManyToOne
    public Plan plan;

    @OneToMany(mappedBy = "pool")
    public List<SimCard> simCards;

    @Required
    public Boolean isUnlimited;

    @Required
    public Boolean isDefaultPool;

    @Required
    public Long maxBytes;

    @Required
    public Long maxCards;

    public static Model.Finder<Long, PlanPool> find = new Model.Finder<Long, PlanPool>(Long.class, PlanPool.class);
}

同じ 1 対多、多対 1 の方法でセットアップされたオブジェクトがいくつかあります。しかし、問題はすべて同じです。

4

1 に答える 1