首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

好不容易把sql语句写出来,不知道用hibernate的hql语句如何写

2013-12-04 
好不容易把sql语句写出来,不知道用hibernate的hql语句怎么写select * fromhomework where studentcontent

好不容易把sql语句写出来,不知道用hibernate的hql语句怎么写
"select * from  homework where studentcontent is null and title not in(select title from homework where studentid="+id+")";
在这里卡住了,转成hql不知道怎么写。

而直接用sql的话却出现:
No Dialect mapping for JDBC type: -1 
No Dialect mapping for JDBC type: -1; nested exception is org.hibernate.MappingException: No Dialect mapping for JDBC type: -1 

深夜了,早上起来解决问题。
[解决办法]
select * from  homework where studentcontent is null and title not in(select title from homework where studentid="+id+")和这个sql差不多啊,另外你sql语言这么写就行了吧:
select * from  homework where studentcontent is null and studentid not like "+id+";你那个title not in (select title from homework where studentid="+id+")不就是找到studentid not like "id"的条件嘛。。。

热点排行