This content has been marked as final.
Show 2 replies
-
1. Re: mappedBy reference an unknown target entity property
svanbegin01 Nov 17, 2006 9:36 AM (in response to svanbegin01)This problem was solved by replacing @Id annotations in Entity B
with @EmbeddedId and @Embeddable constructs -
2. Re: mappedBy reference an unknown target entity property
smix007 Dec 5, 2006 9:04 AM (in response to svanbegin01)Hello,
you use @idClass. Whereas in my code I use @Embeddable and @EmbeddedId I thus seek a solution with my problem of joint for the following code:@Embeddable public class TermProjPK implements Serializable { private String auiw; @Column(name = "AUIS", nullable = false) private String auis;
public class TermProj implements Serializable { @EmbeddedId private TermProjPK termProjPK; //jointure avec la table TermSource @ManyToOne @JoinColumn (name = "AUIW") private TermSource auiw; public TermSource getAuiw() { return auiw; } public void setAuiw(TermSource auiw) { this.auiw = auiw; } //jointure avec la table SnomedInter @ManyToOne @JoinColumn (name = "AUIS") private SnomedInter auis; public SnomedInter getAuis() { return auis; } public void setAuis(SnomedInter auis) { this.auis = auis; } @Column(name = "MODIF") private String modif; @Column(name = "SRC", nullable = false) private String src;
public class TermSource implements Serializable { @Id @Column(name = "AUIW", nullable = false) private String auiw; @OneToMany(mappedBy="AUIW") private Collection<TermProj> termProjs; public Collection<TermProj> getTermProjs() { return termProjs; } public void setTermProjs(Collection<TermProj> termProjs) { this.termProjs = termProjs; }
public class SnomedInter implements Serializable { @Id @Column(name = "AUIS", nullable = false) private String auis; @OneToMany(mappedBy="AUIS") private Collection<TermProj> termProjs; public Collection<TermProj> getTermProjs() { return termProjs; } public void setTermProjs(Collection<TermProj> termProjs) { this.termProjs = termProjs; }
I have the error message according toorg.hibernate.AnnotationException: mappedBy reference an unknown property: ejb.entity.TermProj.AUIS in ejb.entity.SnomedInter.AUIS
,
thank you in advance