1
问题:如何从2个不同的表中获取2个值?我正在用greenDao取代android Content Provider。有了内容提供者,你可以定义一个sql视图,但是这对于greenDao来说是不可能的。 所以我试图使用连接,但greenDao返回我只有一个列表实体。从greendao的2个不同实体中获取值3
greenDao从2个不同实体中获取2个值的最佳方法是什么?
例子:
|Table a| | Table b |
| id | descr | b_Id | | id | hues | hex |
| 1 | place | 1 | | 1 | 2 | #000|
| 2 | sea | 1 | | 2 | 3 | #111|
| 3 | name | 2 | ...
... ...
我怎样可以得到下面的物体或类似的? C c = new C(d.getDescr(),d.getHex());
在此先感谢。
检查这个答案,有点类似于你的问题:http://stackoverflow.com/a/38318652/3741176 –