A few days ago in another forum somone told me that @OneToMany unidirectional is not a good design.
As i see it from the point of view of java developer and not from the DB side this is more compatible with Java, because in the class diagram you will see that class A has list<B>.
In the DB there are a FK or association table , but in java this one to many represented as a Collection.
i know that for performance @OneToMany unidirectional is not good, because you need to load the collection in order to add one element :
a.getListOfB().add(b)
So what do you think:
1. is it a bad mapping?
2. what is preffered OneToMany with association table or with FK?
The default for unidirectional is association , but when i change to bidirectional it dosnt use association.
Thank you
|