0

원래 문제는 OneToOne between two tables with shared primary key 을 참조하십시오.OneToOne 공유 기본 키, 순수 JPA 2.0 솔루션이 EclipseLink와 함께 작동하지만 최대 절전 모드 공급자와 함께 작동하지 않음

그리고 순수 JPA 2.0 방식 (EclipseLink Provider 사용)에 대한 해결책은 동일한 스레드에서 대답했습니다.

2 [main] INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.5.1-Final 
    11 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.5.1-Final 
    13 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found 
    15 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist 
    17 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling 
    94 [main] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final 
    99 [main] INFO org.hibernate.ejb.Version - Hibernate EntityManager 3.5.1-Final 
    269 [main] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.nirmal.demo.jpa.eclipselink.domain.UserLogin 
    298 [main] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.nirmal.demo.jpa.eclipselink.domain.UserLogin on table USER_LOGIN 
    341 [main] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.nirmal.demo.jpa.eclipselink.domain.UserDetail 
    342 [main] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.nirmal.demo.jpa.eclipselink.domain.UserDetail on table USER_DETAIL 
    Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: users] Unable to configure EntityManagerFactory 
     at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:371) 
     at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:55) 
     at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:78) 
     at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54) 
     at com.nirmal.demo.jpa.eclipselink.Main.main(Main.java:16) 
    Caused by: org.hibernate.AnnotationException: Unknown mappedBy in: com.nirmal.demo.jpa.eclipselink.domain.UserLogin.userDetail, referenced property unknown: com.nirmal.demo.jpa.eclipselink.domain.UserDetail.userLogin 
     at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass.java:152) 
     at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1221) 
     at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:383) 
     at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1206) 
     at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1449) 
     at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:193) 
     at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1077) 
     at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:275) 
     at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:359) 
     ... 4 more 

어떤 아이디어 :

가 지금 직면하고있는 문제는 내가는 EclipseLink에서 JPA 제공자를 전환하면 최대 절전 모드 - EntityManager의 것을 3.5.1-최종, 같은 예는 예외 아래 던지고입니까?

답변

0

그 이유는 이전의 Hibernate 버전이 HHH-5695에 잘 설명되어 있고 HHH-6813으로 고정되어 있기 때문입니다.

fresh version으로 업데이트하면 문제를 해결할 수 있습니다.