Hi i want to have a one to many relation for one of my projects, but the List is never populated.
I have a parent source class
@Entity
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public class ParentJob {
@Id
@Column(name = "ID")
int id;
}
a child
@Entity
public class TakeJob extends ParentJob {
@OneToMany(fetch = FetchType.EAGER, cascade=CascadeType.REMOVE)
@JoinColumn(name="FK_JOBID", referencedColumnName="ID")
private List<JobRelation> jobRelations;
}
and a target entity
@Entity
public class JobRelation {
@EmbeddedId
private JobRelationPK JobRelationPK;
}
with a PK
@Embeddable
public class JobRelationPK implements Serializable {
private long fkSomething;
@Column(name = "FK_JOBID")
private long fkJobId;
}
Now as I said the List doesn't populate if i access it. I'm particularly interested in the syntax of the JoinColumn, since it doesn't really matter what i put for 'name' even if it's total garbage. Do i have to pay attention to what i put there or can i just put 'name = "COLUMN_NAME_IN_JOBRELATION"'
Edit: I'm using EclipseLink 2.3.2