Hibernate exception caused by:org.hibernate.MappingException:Could not determine type For:java.util.Set

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.