해결된 질문
작성
·
3K
0
엔티티 클래스 개발2 수업까지 코드를 작성하고 7:00에 h2데이터베이스를 만드는과정에서 에러가 발생하였는데 구글링을 해도 해결이 안되어서 도움을 구하고자 글남깁니다
에러:
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not determine type for: java.util.List, at table: orders, for columns: [org.hibernate.mapping.Column(order_items)]
Caused by: org.hibernate.MappingException: Could not determine type for: java.util.List, at table: orders, for columns: [org.hibernate.mapping.Column(order_items)]
Execution failed for task ':TownApplication.main()'.
> Process 'command 'C:/Program Files/Java/jdk-17.0.2/bin/java.exe'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
order 코드:
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@Entity
@Table(name="orders")
@Getter
@Setter
public class Order {
@Id
@GeneratedValue
@Column(name="order_id")
private Long id;
@ManyToOne
@JoinColumn(name="member_id")
private Member member;
private List<OrderItem> orderItems= new ArrayList<>();
@OneToOne
@JoinColumn(name="delivery_id")
private Delivery delivery;
private LocalDateTime orderDate;//주문시간
@Enumerated(EnumType.STRING)
private OrderStatus status; //주문상태