实体与多个一到许多相同类型和GreenDAO的关系 [英] Entity with multiple one-to-many relations of the same type and GreenDAO

查看:180
本文介绍了实体与多个一到许多相同类型和GreenDAO的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

中的实体产生由GreenDAO必须是这样的:

The entities generate by GreenDAO must be something like this:

class A {    
    public List<B> bList1;
    public List<B> bList2;    
}

class B{
    ...
}

我知道它是如何与工作在一个给定类型的列表。

I know how it works with on list of a given type.

问题是,我不知道,如果产生code能知道,如果B的对象是bList1或bList2的。

The problem is that I'm not sure if the generated code can know if a B object is of bList1 or bList2.

推荐答案

是的,它可以:你可以给一个名称,每个关系。在B级,你会有这样的事情:

Yes it can: You can give a name to each relationship. In B class, you will have something like that:

class B {
  A aRelation1;
  A aRelation2;
}

这篇关于实体与多个一到许多相同类型和GreenDAO的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆