This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mappedBy reference an unknown target entity property:

 
francesco Ierna
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try, "dCategoriaLibro", or annotate the field instead of the get method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic