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
Post a Comment