aspose file tools*
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mappedBy reference an unknown target entity property: