日期:2014-05-17  浏览次数:20757 次

hql
insert into MmsMTSubmit(taskID,destAddr,name) select distinct taskID,destAddr,name from MmsMTPhone

直接运行报错: ERROR org.hibernate.practice.HibernateTransaction - executeUpdate
org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: distinct near line 1, column 54 [insert into MmsMTSubmit(taskID,destAddr,name) select distinct taskID,destAddr,name from com.momentek.ums.mms.bean.MmsMTPhone ]

把上面这句sql换成hql语句怎么写?
类现在就对应的属性,set,get方法,需要做什么修改?

在线等......

------解决方案--------------------
如果sql复杂的话,建议lx用
SQL code
 session.createSQLQuery(sql),