Piotr,
-The table "ItemMaterials" is mentioned nowhere in your mapping.
-if you do not declare the relationship as bidirectional, (and you are saying that you don't need it) you don't need to write both ends of the relationship, In other words, you don't need to retrieve your Items given a Material, nor set the parent Item on the new Material.
-It is a good practice to add a method "addMaterial" to the item, which would add the material to the internal list of the item, and (if you want to keep it bidirectional) add the parent Item on the new material's list with an "addItem".
I am not sure how Hibernate manages that internally, but the list wont get initialized until you don't call the getter
_________________ Gonzalo Díaz
|