How to execute the following query using Greendao?

I have 2 tables A and B.

Table A contains the names , and Table B contains the selected names .

Now, I would like to execute the following query in these tables using greendao. Please let me know if this is possible, and if not, then there are alternatives (possibly a raw request).

select * 
from A inner join B
on A.nameid = B.nameid

In addition, the columns of table A: id, nameid, name
and the columns of table B:id, nameid, name, rating

+4
source share
3 answers

I think this may help. You can use the raw request as a fake connection. And you get everything you want in the Query object

Query query = ATableDao.queryBuilder().where(
new StringCondition("nameid IN " +
"(SELECT nameid FROM B_Table )").build();

"nameid" . . Relations, .

+6

:

List<ATableObj> listATableObj = ATableDao.queryRawCreate(", BTable BT 
WHERE BT.nameid = T.nameid").list();
+2

greendao, -:

a ( b), b ( a), getB() ( getA()), .

a, b, b, a, , , ( b).

+1

Source: https://habr.com/ru/post/1525426/


All Articles