java - I'm getting error in @OneToMany hibernate mapping? -


i'm trying have 1 many connection between 2 classes im getting error org.hibernate.annotationexception: illegal attempt map non collection @onetomany.

here code,

job.java

@onetomany @joincolumn(name = "id", referencedcolumnname = "id", insertable = false, updatable = false)  private set<jobcostsplit> jobcostsplit; 

jobcostsplit.java

@column(name = "job_id") private long jobid;  @jsonignore @onetomany @joincolumn(name = "job_id", referencedcolumnname = "id", insertable = false, updatable = false) private job job; 

you annotate job @onetomany. means have 1 attribute on job , more on jobcostsplit.

so if want have 1 job , more jobcostsplit have set this:

@manytoone @joincolumn(name = "job_id", referencedcolumnname = "id", insertable = false, updatable = false) private job job; 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -