작성
·
1.9K
0
Application run을 해보니 Order 클래스 내부 다대일 매핑한 Member의 JoinCloumn 어노테이션 안에 옵션 값 insertable = false, updateable = false 값을 넣으라는 에러 메세지가 뜹니다 ㅠㅠ 이유가 뭘까요
현재 저의 코드상태입니다 https://github.com/TeMlN/JPA-Shop
+ 강의를 다 듣고나니 @ManyToOne은 mappedBy가 불가능 한데, insertable = false, updateable = false 라는 꼼수가 있다고 언급하셨는데 지금 제 상황과 얼추 맞는거 같은데 조언 부탁드려요 ㅠㅠ
===========================================
Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: hello] Unable to build Hibernate SessionFactory
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1016)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:942)
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:56)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at jpabook.jpashop.JpaMain.main(JpaMain.java:15)
Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: jpabook.jpashop.domain.Order column: MEMBER_ID (should be mapped with insert="false" update="false")
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:862)
at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:880)
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:902)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:634)
at org.hibernate.mapping.RootClass.validate(RootClass.java:267)
at org.hibernate.boot.internal.MetadataImpl.validate(MetadataImpl.java:347)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:466)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939)
... 4 more
===========================================