sql语句转换成hql语句
String sql= "select * from project where projectId not in(select projectId from LaborLicence) and companyId= ' "+companyId+ " ' ";
谁能帮我将上述sql语句转换成hql---------------------------谢谢大家了
持久化后的java类和xml有
project.java project.xml
LaborLicence.java LaborLicence.xml
------解决方案--------------------from project as a where a.projectId not in(select b.projectId from LaborLicence as b) and a.companyId= ' "+companyId+ " ' ";
------解决方案--------------------楼上是对的 其实hql很简单的 只要把表转化为hibernate的类 然后写的时候as一个实例九可以了
------解决方案--------------------用CRITERIA吧.