I hope this is the right place for this type of problem.
An Object of my class
Movie can have several
keywords ( like 'fight club', 'brad', 'fincher'), and be part of different
categories (like 'Drama', 'Best Movies Ever') I implemented them as ManyToMany:
@OneToMany(targetEntity = Keyword.class,fetch=FetchType.EAGER) private Set<Keyword> keywords; @OneToMany(targetEntity = MovieCategory.class, fetch=FetchType.EAGER) private Set<MovieCategory> movieCategories;
Somehow I don' think, this is not the correct relationshipmodel, how would you implement this? Right now hibernate wont allow me to fetch.eager. fetch.lazy is okay. I found this link http://www.mkyong.com/hibernate/hibernate-many-to-many-relationship-example-annotation/ but it didn't answered my question.