| 21545 |
ashik.ali |
1 |
package com.spice.profitmandi.dao.entity;
|
|
|
2 |
|
|
|
3 |
import java.io.Serializable;
|
|
|
4 |
|
|
|
5 |
import javax.persistence.Column;
|
|
|
6 |
import javax.persistence.Entity;
|
|
|
7 |
import javax.persistence.GeneratedValue;
|
|
|
8 |
import javax.persistence.GenerationType;
|
|
|
9 |
import javax.persistence.Id;
|
|
|
10 |
import javax.persistence.NamedQueries;
|
|
|
11 |
import javax.persistence.NamedQuery;
|
|
|
12 |
import javax.persistence.Table;
|
|
|
13 |
import javax.persistence.UniqueConstraint;
|
|
|
14 |
|
|
|
15 |
/**
|
|
|
16 |
* This class basically contains retailer address details
|
|
|
17 |
*
|
|
|
18 |
* @author ashikali
|
|
|
19 |
*
|
|
|
20 |
*/
|
|
|
21 |
@Entity
|
|
|
22 |
@Table(name="retailer_address", schema = "dtr", uniqueConstraints = {@UniqueConstraint(columnNames = {"retailer_id","address_id"})})
|
|
|
23 |
@NamedQueries({
|
|
|
24 |
@NamedQuery(name="RetailerAddress.selectByRetailerId", query="select ra.addressId from RetailerAddress ra where ra.retailerId= :retailerId"),
|
|
|
25 |
@NamedQuery(name="RetailerAddress.deleteByRetailerAndAddressId", query="delete from RetailerAddress ra where ra.retailerId= :retailerId and ra.addressId = :addressId"),
|
|
|
26 |
@NamedQuery(name = "RetailerAddress.selectAddressesByRetailerId", query = "select a from RetailerAddress ra join Address a on a.id = ra.addressId where ra.retailerId = :retailerId")
|
|
|
27 |
})
|
|
|
28 |
public class RetailerAddress implements Serializable{
|
|
|
29 |
|
|
|
30 |
private static final long serialVersionUID = 1L;
|
|
|
31 |
|
|
|
32 |
public RetailerAddress() {
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
@Id
|
|
|
36 |
@Column(name="id", unique=true, updatable=false)
|
|
|
37 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
38 |
private int id;
|
|
|
39 |
|
|
|
40 |
@Column(name="retailer_id", unique=false, updatable=false)
|
|
|
41 |
private int retailerId;
|
|
|
42 |
|
|
|
43 |
@Column(name="address_id", unique = false)
|
|
|
44 |
private int addressId;
|
|
|
45 |
|
|
|
46 |
public int getId() {
|
|
|
47 |
return id;
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
public void setId(int id) {
|
|
|
51 |
this.id = id;
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
public int getRetailerId() {
|
|
|
55 |
return retailerId;
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
public void setRetailerId(int retailerId) {
|
|
|
59 |
this.retailerId = retailerId;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
public int getAddressId() {
|
|
|
63 |
return addressId;
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
public void setAddressId(int addressId) {
|
|
|
67 |
this.addressId = addressId;
|
|
|
68 |
}
|
|
|
69 |
|
|
|
70 |
@Override
|
|
|
71 |
public String toString() {
|
|
|
72 |
return "RetailerAddress [retailerId=" + retailerId + ", addressId=" + addressId + "]";
|
|
|
73 |
}
|
|
|
74 |
|
|
|
75 |
}
|