java - org.hibernate.hql.internal.ast.ErrorCounter: unexpected token: ( -


I get the following error when I try to execute the query below-

Error

  Error [2014-10-27 11: 17: 24,264] org.hibernate.hql.internal.ast.ErrorCounter: Line 1:33: Unexpected token: (Error [2014-10- 27 11: 17: 24,304] org.hibernate.hql.internal.ast.ErrorCounter: Line 1:33: Unexpected token: (! NTL. Possible ElTacension: Unexpected token: (error [2014-10-27 11: 17: 24,306 ] Org.hibernate .hql.internal.ast.ErrorCounter: Line 1:68: Unexpected token: MAX error [2014-10-27 11: 17: 24,31 2] org.hibernate.hql.internal.ast.ErrorCounter: Line 1:68: Unexpected token: Max! NTL. Possible altaaxation: unexpected token: max  

query

< Pre> string sSubQuery = "select om.path, om.originalSize, MAX (om finalized)" + "" FROM "+" object metadata ohm "+" WHERE om.informationStoreId = '"+++ StoreDefinitionID +" '"" Om.path, om.originalSize "by GR OUP; String sQuery = "SELECT SUM (o.originalSize)" + "FROM" + "(" + "" + sSubQuery + ")" + "o"; Query q = getEm () Create (sQuery);

Please help

Try

< Pre> string sSubQuery = "SELECT SUM (om.originalSize)), max (om.lastModified)" + "FROM" + "object metadata ohm" + "WHERE om.informationStoreId =: infoStoreDefinitionID" + "GROUP by om .path, om.originalSize "; Query q = getEm () Create (sQuery); Q.addParameter ("informationStoreDefinitionID", 22);

Comments