• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in the groupProperty  RSS feed

varsha rao
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all,

I am trying to write the following query in hibernate

select * from TABLE where txn_id in (select max(txn_id) from TABLE group by

the corresponding criteria i have written is as follows

Criteria searchFormatCodes = session.createCriteria(B2bFormatsummaryTxn.class);

searchFormatCodes.add(Expression.eq("userId", userId));

DetachedCriteria dc = DetachedCriteria.forClass(B2bFormatsummaryTxn.class);

searchFormatCodes.add(Subqueries.propertyIn("comp_id.txnId", dc));

but when i try to execute it i get the following error

Caused by: java.sql.SQLException: ORA-00913: too many values

How do i do the correct grouping using criteria's
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!