-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTransactionP.java
35 lines (35 loc) · 958 Bytes
/
TransactionP.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import javax.persistence.*;
import java.util.LinkedList;
import java.util.List;
@Entity
public class TransactionP {
@Id
@GeneratedValue(
strategy = GenerationType.AUTO
)
private int transcationNumber;
private Integer Quantity;
@OneToMany
@JoinColumn(name = "TRANSACTION_FK")
List<Product> products = new LinkedList<>();
public TransactionP() {
}
public TransactionP(Integer quantity) {
Quantity = quantity;
}
public int getTranscationNumber() {
return transcationNumber;
}
public void setTranscationNumber(int transcationNumber) {
this.transcationNumber = transcationNumber;
}
public Integer getQuantity() {
return Quantity;
}
public void setQuantity(Integer quantity) {
Quantity = quantity;
}
public void addProductToTransaction(Product product) {
products.add(product);
}
}