вроде связи добавлены
This commit is contained in:
parent
943027b803
commit
0a0ee7145b
@ -18,6 +18,9 @@ public class Component {
|
||||
@Column(name = "amount")
|
||||
private Integer amount;
|
||||
|
||||
@ManyToMany(mappedBy = "componentsList")
|
||||
private List<Favor> favorsList;
|
||||
|
||||
public Component() {
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,15 @@ public class Favor {
|
||||
@Column(name = "price")
|
||||
private Integer price;
|
||||
|
||||
@ManyToMany(mappedBy = "favorsList")
|
||||
private List<Order> ordersList;
|
||||
|
||||
@ManyToMany
|
||||
@JoinTable(name = "favor_component",
|
||||
joinColumns = @JoinColumn(name = "favor_fk"),
|
||||
inverseJoinColumns = @JoinColumn(name = "component_fk"))
|
||||
private List<Component> componentsList;
|
||||
|
||||
public Favor() {
|
||||
|
||||
}
|
||||
@ -46,7 +55,7 @@ public class Favor {
|
||||
public void setPrice(Integer price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
@ -16,6 +16,13 @@ public class Order {
|
||||
private Long id;
|
||||
@Column(name = "date")
|
||||
private Date date;
|
||||
|
||||
@ManyToMany
|
||||
@JoinTable(name = "order_favor",
|
||||
joinColumns = @JoinColumn(name = "order_fk"),
|
||||
inverseJoinColumns = @JoinColumn(name = "favor_fk"))
|
||||
private List<Favor> favorsList;
|
||||
|
||||
public Order(){
|
||||
|
||||
}
|
||||
@ -38,7 +45,6 @@ public class Order {
|
||||
public void setDate(Date date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
Loading…
Reference in New Issue
Block a user