我的sql表和Hibernae Pojo类与Message:
相同 - >专栏toList,fromList,deleteList
。
我正在准备Query:只在toList和fromList中没有在deleteList;
Query:select mb from Message mb where mb.toList LIKE :searchKey OR mb.fromList LIKE :searchKey
以及如何在DeleteList条件下写NOT。
答案 0 :(得分:0)
请参阅hibernate expression以了解HQL中可用的所有操作数。
根据您的情况:
Query: only in toList and fromList not in deleteList;
这应该可以正常运作:
select mb from Message mb
where mb.toList LIKE :searchKey
AND mb.fromList LIKE :searchKey
AND NOT mb.deleteList LIKE :searchKey