java - 转换为条件查询

标签 java hibernate

如何将条件查询写入以下 SQL 查询。

select i.item_id,i.item_name,l.item_price 
from items i,pricelists l,sections s 
where i.id=100 and l.item_id=100 
and i.item_id not in (select s.item_id where s.id=100);

提前致谢

最佳答案

这是一篇有关一些基本知识的文章的链接 Hibernate Criteria examples ,这是指向 a question here on SO where the "NOT IN" was solved 的链接.

关于java - 转换为条件查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8617546/

相关文章:

hibernate - hibernate中current_session_context_class属性的可能值和用途

java - 与连接表中的类型单向关联

java - Jsf Netbeans、Hibernate、获取 session 工厂找不到符号错误

java - JUnit 期间的 ClassCastException

java - Realm RealmResults<E> 不再对我的数据进行就地排序

java - 如何将外部属性文件位置添加到部署到 tomcat 6 的 Spring Boot 应用程序?

java - invokeAll() vs Guava ListenableFuture+addCallback()

java - Vaadin 14 - 使用渲染的删除按钮删除网格的一行

Java Hibernate 标准多对一

mysql - SQL 查询返回已删除的行