본문 바로가기

Spring

'Basic' attribute type should not be a container 에러 해결

'Basic' attribute type should not be a container 에러 해결

 

상황

jpa로 entity 작성 중

team과 student를 1대N 관계로 두고

team에서 studentList에 접근하고자 했음

 

해결

@OneToMany 를 붙여줘서 연관 관계 매핑을 시켜줌으로써 해결

@OneToMany
private List<Student> studentList;

 

참고

https://www.inflearn.com/questions/601534/address-order-%ED%81%B4%EB%9E%98%EC%8A%A4