I'm currently working on a backend and service for project as a student for a large company.
I use eclipseLink to provide JPA
a genericDAO to do the CRUDS
EJB to provide the service
I have the following problem. An employee has a personalhistory. Which is basicaly a collection of evalutions.
I try setting the mapping to lazy but then I get a Marshal exception: serialization mismatch uidís. Putting it to EAGER makes it work,but also because the data is realy big so it goes realy slow. Which is normal with EAGER loading.
I was thinking to perhaps try to implement one of the following:
@OneToMany(cascade = CascadeType.ALL, mappedBy = "idEmployeeFk")
private Collection<Personalhistory> personalhistoryCollection;
- a possible fix for the previous stated problem and continue.
- use JPA inheritance to split person so I get a person without all the collections. and a personExtra that extends person. This provides me a person with all the collections.
Concerning the last option, is this possible? Is there any other good solution?