This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The @OneToMany annotation is use for relationships between entities, and I was trying to map a simple collection, not a collection of entities. So I used the @CollectionOfElements annotation from hibernate, and it's working allright now! So now the code look like this:
Thanks for the attention Ali!
Joined: Jun 19, 2005
Are you sure you want to use a hibernate annotation @CollectionOfElements in your code (I assume you want your code to be JPA compatible so you can change to any other implementation without changing the code)?