org.hibernate.AnnotationException: Illegal attempt to define a @JoinColumn with a mappedBy as sociation: htmlText.images

Hibernate JIRA | Jifeng Liu | 9 years ago
  1. 0

    I got the following exception when I run the test case in attach file. It seems Hibernate throws Exception when unidirection OneToMany relation defined in Embeded class. Exception in thread "main" org.hibernate.AnnotationException: Illegal attempt to define a @JoinColumn with a mappedBy as sociation: htmlText.images at org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumn(Ejb3JoinColumn.java:152) at org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumns(Ejb3JoinColumn.java:127) at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1178) at org.hibernate.cfg.AnnotationBinder.fillComponent(AnnotationBinder.java:1731) at org.hibernate.cfg.AnnotationBinder.bindComponent(AnnotationBinder.java:1665) at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1544) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:733) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:498) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:277) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115) at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1269) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:150) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:888) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:706) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:137) at test.Test.run(Test.java:24) at test.Test.main(Test.java:20)

    Hibernate JIRA | 9 years ago | Jifeng Liu
    org.hibernate.AnnotationException: Illegal attempt to define a @JoinColumn with a mappedBy as sociation: htmlText.images
  2. 0

    JPA/Hibernate Annotations Don't Understand Inheritance?

    Stack Overflow | 4 years ago | aroth
    org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: ClubLocation.club in Club.locations
  3. 0

    Another Query Creation problem [CLOSED]

    spagoworld.com | 8 months ago
    org.hibernate.AnnotationException: A Foreign key refering it.eng.spagobi.meta.DmPrezzo from it.eng.spagobi.meta.AnnuBDatiPil has the wrong number of column. should be 4
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    @Embeddable Issue with Spring and Hibernate3

    Stack Overflow | 4 years ago | Ben Dol
    org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: nz.co.doltech.ims.project.server.entities.CategoryEntity.incidentCategoryJoins[nz.co.doltech.ims.project.server.entities.IncidentCategoryJoin]
  6. 0

    AnnotationException: A Foreign key refering has the wrong number of column. should be 2

    Stack Overflow | 2 years ago | ELĂ­as Vargas
    org.hibernate.AnnotationException: A Foreign key refering com.modulos.pvs.acceso.datos.entity.Provincia from com.modulos.pvs.acceso.datos.entity.Ciudad has the wrong number of column. should be 2

    4 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.AnnotationException

      Illegal attempt to define a @JoinColumn with a mappedBy as sociation: htmlText.images

      at org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumn()
    2. Hibernate
      Configuration.buildMappings
      1. org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumn(Ejb3JoinColumn.java:152)
      2. org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumns(Ejb3JoinColumn.java:127)
      3. org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1178)
      4. org.hibernate.cfg.AnnotationBinder.fillComponent(AnnotationBinder.java:1731)
      5. org.hibernate.cfg.AnnotationBinder.bindComponent(AnnotationBinder.java:1665)
      6. org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1544)
      7. org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:733)
      8. org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:498)
      9. org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:277)
      10. org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
      10 frames
    3. Hibernate EJB
      HibernatePersistence.createEntityManagerFactory
      1. org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1269)
      2. org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:150)
      3. org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:888)
      4. org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:706)
      5. org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:137)
      5 frames
    4. test
      Test.main
      1. test.Test.run(Test.java:24)
      2. test.Test.main(Test.java:20)
      2 frames