4

I want to insert foreign key of one table in another on basis of certain criteria. Structure is like

insert into CustomerResult(customer,draw) select c.idCustomer, from Customer c,Draw d where ..... and  c.idCustomer in (select cc.idCustomer from Customer cc where ..... limit 10)

here i want to insert only fix no of records which fulfill certain criteria. I know hql has no limit keyword but want to implement like this. any suggestion?

Nirmal- thInk beYond
  • 11,847
  • 8
  • 35
  • 46

1 Answers1

3

I don't think that what you want to do (use limit in subquery) is directly supported by Hibernate. Have a look at these previous answers:

MarquisDeMizzle
  • 516
  • 9
  • 24
Olof Åkesson
  • 707
  • 9
  • 18