| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.dao.entity.fofo;
|
1 |
package com.spice.profitmandi.dao.entity.fofo;
|
| 2 |
|
2 |
|
| 3 |
import java.io.Serializable;
|
3 |
import java.io.Serializable;
|
| 4 |
import java.time.LocalDateTime;
|
4 |
import java.time.LocalDateTime;
|
| 5 |
import java.time.format.DateTimeFormatter;
|
5 |
import java.time.format.DateTimeFormatter;
|
| 6 |
import java.util.List;
|
- |
|
| 7 |
|
6 |
|
| 8 |
import javax.persistence.CascadeType;
|
- |
|
| 9 |
import javax.persistence.Column;
|
7 |
import javax.persistence.Column;
|
| 10 |
import javax.persistence.Convert;
|
8 |
import javax.persistence.Convert;
|
| 11 |
import javax.persistence.Entity;
|
9 |
import javax.persistence.Entity;
|
| 12 |
import javax.persistence.FetchType;
|
- |
|
| 13 |
import javax.persistence.GeneratedValue;
|
10 |
import javax.persistence.GeneratedValue;
|
| 14 |
import javax.persistence.GenerationType;
|
11 |
import javax.persistence.GenerationType;
|
| 15 |
import javax.persistence.Id;
|
12 |
import javax.persistence.Id;
|
| 16 |
import javax.persistence.JoinColumn;
|
- |
|
| 17 |
import javax.persistence.ManyToOne;
|
- |
|
| 18 |
import javax.persistence.NamedQueries;
|
- |
|
| 19 |
import javax.persistence.NamedQuery;
|
- |
|
| 20 |
import javax.persistence.OneToMany;
|
- |
|
| 21 |
import javax.persistence.Table;
|
13 |
import javax.persistence.Table;
|
| 22 |
|
14 |
|
| 23 |
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
|
15 |
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
|
| 24 |
|
16 |
|
| 25 |
@Entity
|
17 |
@Entity
|
| 26 |
@Table(name="fofo.fofo_order", schema = "fofo")
|
18 |
@Table(name="fofo.fofo_order", schema = "fofo")
|
| 27 |
@NamedQueries({
|
- |
|
| 28 |
@NamedQuery(name = "FofoOrder.selectCount", query = "select count(fo) from FofoOrder fo"),
|
- |
|
| 29 |
@NamedQuery(name = "FofoOrder.selectById", query = "select fo from FofoOrder fo where fo.id = :id"),
|
- |
|
| 30 |
@NamedQuery(name = "FofoOrder.selectByFofoId", query = "select fo from FofoOrder fo where fo.fofoId = :fofoId"),
|
- |
|
| 31 |
@NamedQuery(name = "FofoOrder.selectTotolAmountByFofoId", query = "select sum(fo.totalAmount) from FofoOrder fo where fo.fofoId = :fofoId group by fo.fofoId"),
|
- |
|
| 32 |
@NamedQuery(name = "FofoOrder.selectByInvoiceNumber", query = "select fo from FofoOrder fo where fo.invoiceNumber = :invoiceNumber")
|
- |
|
| 33 |
})
|
- |
|
| 34 |
public class FofoOrder implements Serializable{
|
19 |
public class FofoOrder implements Serializable{
|
| 35 |
|
20 |
|
| 36 |
private static final long serialVersionUID = 1L;
|
21 |
private static final long serialVersionUID = 1L;
|
| 37 |
|
22 |
|
| 38 |
@Id
|
23 |
@Id
|
| Line 58... |
Line 43... |
| 58 |
@Column(name = "cashback")
|
43 |
@Column(name = "cashback")
|
| 59 |
private float cashback;
|
44 |
private float cashback;
|
| 60 |
|
45 |
|
| 61 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
46 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
| 62 |
@Column(name = "create_timestamp")
|
47 |
@Column(name = "create_timestamp")
|
| 63 |
private LocalDateTime createTimestamp = LocalDateTime.now();
|
48 |
private LocalDateTime createTimestamp = LocalDateTime.now();
|
| 64 |
|
49 |
|
| 65 |
@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
|
- |
|
| 66 |
@JoinColumn(name="order_id",insertable=false,updatable=false,nullable=false)
|
- |
|
| 67 |
private List<FofoOrderItem> fofoLineItem;
|
- |
|
| 68 |
|
- |
|
| 69 |
|
- |
|
| 70 |
@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
|
- |
|
| 71 |
@JoinColumn(name="order_id",insertable=false,updatable=false,nullable=false)
|
- |
|
| 72 |
private List<PaymentOption> paymentOption;
|
- |
|
| 73 |
|
- |
|
| 74 |
public List<PaymentOption> getPaymentOption() {
|
- |
|
| 75 |
return paymentOption;
|
- |
|
| 76 |
}
|
- |
|
| 77 |
public void setPaymentOption(List<PaymentOption> paymentOption) {
|
- |
|
| 78 |
this.paymentOption = paymentOption;
|
- |
|
| 79 |
}
|
- |
|
| 80 |
public List<FofoOrderItem> getFofoLineItem() {
|
- |
|
| 81 |
return fofoLineItem;
|
- |
|
| 82 |
}
|
- |
|
| 83 |
public void setFofoLineItem(List<FofoOrderItem> fofoLineItem) {
|
- |
|
| 84 |
this.fofoLineItem = fofoLineItem;
|
- |
|
| 85 |
}
|
- |
|
| 86 |
@ManyToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
|
- |
|
| 87 |
@JoinColumn(name="customer_id",insertable=false,updatable=false,nullable=false, referencedColumnName="id")
|
- |
|
| 88 |
private Customer customer;
|
- |
|
| 89 |
|
- |
|
| 90 |
@ManyToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
|
- |
|
| 91 |
@JoinColumn(name="customer_address_id",insertable=false,updatable=false,nullable=false, referencedColumnName="id")
|
- |
|
| 92 |
private CustomerAddress customerAddress;
|
- |
|
| 93 |
|
- |
|
| 94 |
public CustomerAddress getCustomerAddress() {
|
- |
|
| 95 |
return customerAddress;
|
- |
|
| 96 |
}
|
- |
|
| 97 |
public void setCustomerAddress(CustomerAddress customerAddress) {
|
- |
|
| 98 |
this.customerAddress = customerAddress;
|
- |
|
| 99 |
}
|
- |
|
| 100 |
public Customer getCustomer() {
|
- |
|
| 101 |
return customer;
|
- |
|
| 102 |
}
|
- |
|
| 103 |
public void setCustomer(Customer customer) {
|
- |
|
| 104 |
this.customer = customer;
|
- |
|
| 105 |
}
|
- |
|
| 106 |
public int getId() {
|
50 |
public int getId() {
|
| 107 |
return id;
|
51 |
return id;
|
| 108 |
}
|
52 |
}
|
| 109 |
public void setId(int id) {
|
53 |
public void setId(int id) {
|
| 110 |
this.id = id;
|
54 |
this.id = id;
|
| Line 181... |
Line 125... |
| 181 |
|
125 |
|
| 182 |
@Override
|
126 |
@Override
|
| 183 |
public String toString() {
|
127 |
public String toString() {
|
| 184 |
return "FofoOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", customerAddressId="
|
128 |
return "FofoOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", customerAddressId="
|
| 185 |
+ customerAddressId + ", totalAmount=" + totalAmount + ", invoiceNumber=" + invoiceNumber
|
129 |
+ customerAddressId + ", totalAmount=" + totalAmount + ", invoiceNumber=" + invoiceNumber
|
| 186 |
+ ", cashback=" + cashback + ", createTimestamp=" + createTimestamp + ", fofoLineItem=" + fofoLineItem
|
130 |
+ ", cashback=" + cashback + ", createTimestamp=" + createTimestamp + "]";
|
| 187 |
+ ", paymentOption=" + paymentOption + ", customer=" + customer + ", customerAddress=" + customerAddress
|
- |
|
| 188 |
+ "]";
|
- |
|
| 189 |
}
|
131 |
}
|
| 190 |
|
132 |
|
| 191 |
}
|
133 |
}
|