| 21720 |
ashik.ali |
1 |
package com.spice.profitmandi.dao.entity.dtr;
|
| 21545 |
ashik.ali |
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
|
| 21720 |
ashik.ali |
22 |
@Table(name="dtr.retailer_address", schema = "dtr", uniqueConstraints = {@UniqueConstraint(columnNames = {"retailer_id","address_id"})})
|
| 21545 |
ashik.ali |
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 |
|
| 21924 |
ashik.ali |
70 |
|
| 21545 |
ashik.ali |
71 |
@Override
|
| 21924 |
ashik.ali |
72 |
public int hashCode() {
|
|
|
73 |
final int prime = 31;
|
|
|
74 |
int result = 1;
|
|
|
75 |
result = prime * result + addressId;
|
|
|
76 |
result = prime * result + retailerId;
|
|
|
77 |
return result;
|
|
|
78 |
}
|
|
|
79 |
|
|
|
80 |
@Override
|
|
|
81 |
public boolean equals(Object obj) {
|
|
|
82 |
if (this == obj)
|
|
|
83 |
return true;
|
|
|
84 |
if (obj == null)
|
|
|
85 |
return false;
|
|
|
86 |
if (getClass() != obj.getClass())
|
|
|
87 |
return false;
|
|
|
88 |
RetailerAddress other = (RetailerAddress) obj;
|
|
|
89 |
if (addressId != other.addressId)
|
|
|
90 |
return false;
|
|
|
91 |
if (retailerId != other.retailerId)
|
|
|
92 |
return false;
|
|
|
93 |
return true;
|
|
|
94 |
}
|
|
|
95 |
|
|
|
96 |
@Override
|
| 21545 |
ashik.ali |
97 |
public String toString() {
|
|
|
98 |
return "RetailerAddress [retailerId=" + retailerId + ", addressId=" + addressId + "]";
|
|
|
99 |
}
|
|
|
100 |
|
|
|
101 |
}
|