One: Exception
Two: My entity
@Entity @table (name = "P_user") public class User extends Abstractentity {@Id @generatedvalue (strategy = generationtype.identity) Private long id;//accounts @column (name = "Account", Nullable = True) Private String account;// Organization Private set<organization> organizations = new hashset<organization> (0); @ManyToMany (fetch = Fetchtype.eager) @JoinTable (name = "Rel_user_organization", schema = "", Joincolumns = {@JoinColumn (name = "USER_ID", null Able = false, updatable = False)}, Inversejoincolumns = {@JoinColumn (name = "organization_id", nullable = False, Updatab Le = False)}) public set<organization> getorganizations () {return organizations;} public void Setorganizations (set<organization> organizations) {this.organizations = organizations;} Role @manytomany (fetch = Fetchtype.eager) @JoinTable (name = "Rel_user_role", schema = "", Joincolumns = {@JoinColumn (name = "USER_ID", Nullable = false, updatable = False)}, Inversejoincolumns = {@JoinColumn (name = "role_id", Nullable = False, UPdatable = False)}) private set<role> roles = new hashset<role> (0);p ublic set<role> getroles () {return T His.roles;} public void Setroles (set<role> roles) {this.roles = roles;}
Three: The cause of the error
<span style= "color: #ff0000;" > @ManyToMany and other annotations. Either load the property or add it to the property's Get method, not mix it! </span>
Hibernate exception caused by:org.hibernate.MappingException:Could not determine type For:java.util.Set