Improve Repo Entities once again
This commit is contained in:
@@ -8,6 +8,7 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Getter
|
||||
@@ -46,4 +47,7 @@ public class Article {
|
||||
|
||||
@Column(name = "category", nullable = false)
|
||||
private String category;
|
||||
|
||||
@OneToMany(mappedBy = "articleId", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
|
||||
private List<ArticleConfiguration> configurationList;
|
||||
}
|
||||
|
||||
@@ -21,10 +21,6 @@ public class ArticleConfiguration {
|
||||
@Column(name = "id", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "articleId", referencedColumnName = "id", nullable = false)
|
||||
private Article article;
|
||||
|
||||
@Column(name = "name", nullable = false)
|
||||
private String name;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package de.htwsaar.webshop.repository.entities;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name = "Orders")
|
||||
public class Order {
|
||||
@@ -15,4 +17,7 @@ public class Order {
|
||||
|
||||
@Column(name = "time")
|
||||
private Long time;
|
||||
|
||||
@OneToMany(mappedBy = "orderId")
|
||||
private List<OrderItem> orderItems;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user