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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -