Open iobsessu opened 2 years ago
First, u should implement your raw sql code like below
Second, u implement the multi-table join query with QueryBuilder
First step
SELECT
n.id ,
n.title ,
ti.tagName
from
TableN n
join TTableN twn on
twn.note_id = n.id
join TTableI ti on
ti.id = twn.tagInfo_id
where ti.tagName ="customize1" limit 1 offset 2;
Second step
QueryBuilder<TableN, Long> tableNQuery = DatabaseUtils.initialiseDaoWithLong(TableN.class).queryBuilder();
QueryBuilder<TTableN , Long> ttableNQuery = DatabaseUtils.initialiseDaoWithLong(TTableN .class).queryBuilder();
QueryBuilder<TTableI , Long> ttableIQuery = DatabaseUtils.initialiseDaoWithLong(TTableI .class).queryBuilder();
ttableNQuery .join(ttableIQuery );
tableNQuery .join(ttableNQuery );
tableNQuery .distinct()
.offset(Const.Note.PAGE_SIZE * (pageNo - 1)).limit(Const.Note.PAGE_SIZE)
.orderBy("updateTime", false)
.where().eq("inTrash", false)
.and().eq("stuId", stuId)
.query();
The short answer is that you can't without a lot of customization. Unfortunately, ORMLite right now does not support composite objects like this.
now, i have a User object and a Role object , it look like this:
i wanna know, how can i serialize it to
instead of