Ormlite离开了连接查询

时间:2017-01-10 12:49:35

标签: java ormlite

我有两张桌子:

idTransactioniddescriptionvalue

card_idCardid

如何使用ormlite编写以下查询?

name

我可以写

SELECT * FROM Transaction 
LEFT JOIN Card ON transaction.card_id = card.id 
WHERE transaction.value > 0 AND (transaction.description LIKE '%query%' OR card.name LIKE '%query%')

但是如何使用正确的AND,OR和括号使用QueryBuilder<Transaction, Long> tranBuilder = transactionDao.queryBuilder(); QueryBuilder<Card, Long> cardBuilder = cardDao.queryBuilder(); tranBuilder.leftJoin(cardBuilder); 方法编写WHERE条件?

0 个答案:

没有答案