When I create a new entity class and want to have more than one List in it, Xpert.ivy says: "If an entity class has more than one collection you have to use 'Set' instead of 'List' as type." I think the JEE Persistence API does not have this limitation. |
The JPA itself also has this limitation if the list's are eagerly fetched (which is like this in ivy). Eager means also all entries in the list's are fetched/loaded if the main entity is loaded. If there is more than one list, all relations are loaded with a big join (bad performance) and then jpa (hibernate) has to find the entries for each list, but then this list would have multiple entries of the same id because of the big join, so it is necessary that the type is Set. The advice is to use no mapped by relations if not relay necessary, because this results in very bad performance. Example:
IF you now load just one employee (e.g. |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 14.08.2014 at 11:32
Seen: 2,811 times
Last updated: 18.08.2014 at 12:41