This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes mappedBy reference an unknown target entity property: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "mappedBy reference an unknown target entity property:" Watch "mappedBy reference an unknown target entity property:" New topic
Author

mappedBy reference an unknown target entity property:

francesco Ierna
Greenhorn

Joined: Mar 20, 2011
Posts: 14
Hi!
i have a problem about :
mappedBy reference an unknown target entity property.

I have two tables:
1) D_LIBRO Pk---> ISBN, Fk--->ID_CATEGORIA
2) D_CATEGORIA_LIBRO Pk---> ID






Mapping seems right...

@OneToMany(fetch = FetchType.LAZY, mappedBy = "DCategoriaLibro")
public Set<DLibro> getDLibros() {
return this.DLibros;
}


@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "ID_CATEGORIA", nullable = false)
public DCategoriaLibro getDCategoriaLibro() {
return this.DCategoriaLibro;
}

the error when i try to start the webapplication is :

mappedBy reference an unknown target entity property: com.bookswap.entity.DLibro.DCategoriaLibro in com.bookswap.entity.DCategoriaLibro.DLibros




thanks.

SCJP 6.0, SCWCD, SCBCD, SCDJWS 5.0
James Sutherland
Ranch Hand

Joined: Oct 01, 2007
Posts: 553
Try, "dCategoriaLibro", or annotate the field instead of the get method.

TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
 
jQuery in Action, 2nd edition
 
subject: mappedBy reference an unknown target entity property: