[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Mapping Question - OneToMany Create Table from Entity Fails
|
christopher delahunt wrote:
>
> Hello,
>
> As the error states, the CCFParameter.id database field is mapped
> twice. Notice that CCFParameter's id and ccfgroup both use the "id"
> field - one of them will need to be set as insertable=false
> updateable=false.
>
>
Ah - well that's not what I wanted anyway :(
@Entity
@Table(name="CCFParameter")
public class CCFParameter {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private int id;
@ManyToOne (cascade=CascadeType.ALL)
@JoinColumn(name="id")
private CCFGroup ccfgroup;
I thought that the @JoinColumn(name="id") referred to the id column in the
CCFGroup class/entity, not the id column in the Parameter class/entity. So
it looks like I've missed the point in trying to create @OneToMany and
@ManyToOne ..... again!
Regards
--
View this message in context: http://www.nabble.com/Mapping-Question---OneToMany-Create-Table-from-Entity-Fails-tp25871087p25872275.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.