Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

mappedBy reference an unknown target entity property:

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try, "dCategoriaLibro", or annotate the field instead of the get method.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic