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