1

I've got a Player Object in which there is a Collection<Stock>. I'm willing to write a hibernate query which returns the list of players who have a specific stock (for example stock.symbol="**").

any ideas?

SJ.Jafari
  • 1,236
  • 8
  • 27
  • 39

1 Answers1

1

No problem use HQL with join syntax.

see it here

http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/queryhql.html#queryhql-joins-forms

For example:

Player p join p.myStocks stock where stock.symbol = :symbol
danny.lesnik
  • 18,479
  • 29
  • 135
  • 200