java - HQL subquery issue -
i want latest record table. sql follow.
select * (select * table_1 paid=1 order paymentdate desc) rownum = 1
i tried hql mapping pojo classes. gave errors. hql follow.
select pay (select payment com.table1 payment payment.paid=1 order payment.paymentdate desc) pay pay.rownum = 1
the error is,
net.sf.hibernate.queryexception: in expected: select [select pay (select payment com.table1 payment payment.paid=1 order payment.paymentdate desc) pay.rownum = 1 ]
normal queries without subqueries working.
eg:
select payment com.table1 payment payment.paid=1
please solve this.
Comments
Post a Comment