String SQL_QUERY = "SELECT count(*) FROM (SELECT * FROM Url as U where U.pageType=" + 1 + " group by U.pageId having count(U.pageId) = 1)";
query = session.createQuery(SQL_QUERY);
我得到一個錯誤HQL相當於SQL查詢的
org.hibernate.hql.ast.QuerySyntaxException:意外的標記:(從附近的1號線,列23 SELECT COUNT()(SELECT * FROM地址當U其中U.pageType = 2基團由具有計數U.pageId(U.pageId)= 1)]
要格式化源代碼,編輯器中有{}按鈕;) – bluish 2010-12-21 09:47:15