Subversion Repositories SmartDukaan

Rev

Rev 21715 | Rev 22009 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
21715 ashik.ali 1
package com.spice.profitmandi.dao.entity.logistics;
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.Table;
11
 
12
/**
13
 * This class basically contains address details
14
 * 
15
 * @author ashikali
16
 *
17
 */
18
@Entity
19
@Table(name="logistics.provider", schema = "logistics")
20
public class Provider implements Serializable{
21
 
22
	private static final long serialVersionUID = 1L;
23
 
24
	public Provider() {
25
	}
26
 
27
	@Id
28
	@Column(name="id", unique=true, updatable=false)
29
	@GeneratedValue(strategy = GenerationType.IDENTITY)
30
	private int id;
31
 
32
	@Column(name="name", length = 100)
33
	private String name;
34
 
35
	@Column(name = "isActive", columnDefinition = "tinyint(1) default 1")
36
	private boolean active;
37
 
38
	@Column(name = "pickup")
39
	private int pickup;
40
 
41
	@Column(name = "bundleWeightLimit")
42
	private float bundleWeightLimit;
43
 
44
	@Column(name = "groupShipmentAllowed", columnDefinition = "tinyint(1) default 0")
45
	private boolean groupShipmentAllowed;
46
 
47
	@Column(name = "maxCodLimit")
48
	private float maxCODLimit;
49
 
50
 
51
	public int getId() {
52
		return id;
53
	}
54
	public void setId(int id) {
55
		this.id = id;
56
	}
57
	public void setName(String name) {
58
        this.name = name;
59
    }
60
    public String getName() {
61
        return name;
62
    }
63
    public boolean isActive() {
64
		return active;
65
	}
66
    public void setActive(boolean active) {
67
		this.active = active;
68
	}
69
 
70
    public int getPickup() {
71
		return pickup;
72
	}
73
    public void setPickup(int pickup) {
74
		this.pickup = pickup;
75
	}
76
    public float getBundleWeightLimit() {
77
		return bundleWeightLimit;
78
	}
79
    public void setBundleWeightLimit(float bundleWeightLimit) {
80
		this.bundleWeightLimit = bundleWeightLimit;
81
	}
82
 
83
    public boolean isGroupShipmentAllowed() {
84
		return groupShipmentAllowed;
85
	}
86
    public void setGroupShipmentAllowed(boolean groupShipmentAllowed) {
87
		this.groupShipmentAllowed = groupShipmentAllowed;
88
	}
89
    public float getMaxCODLimit() {
90
		return maxCODLimit;
91
	}
92
    public void setMaxCODLimit(float maxCODLimit) {
93
		this.maxCODLimit = maxCODLimit;
94
	}
21924 ashik.ali 95
 
96
 
21602 ashik.ali 97
	@Override
21924 ashik.ali 98
	public int hashCode() {
99
		final int prime = 31;
100
		int result = 1;
101
		result = prime * result + (active ? 1231 : 1237);
102
		result = prime * result + Float.floatToIntBits(bundleWeightLimit);
103
		result = prime * result + (groupShipmentAllowed ? 1231 : 1237);
104
		result = prime * result + id;
105
		result = prime * result + Float.floatToIntBits(maxCODLimit);
106
		result = prime * result + ((name == null) ? 0 : name.hashCode());
107
		result = prime * result + pickup;
108
		return result;
109
	}
110
	@Override
111
	public boolean equals(Object obj) {
112
		if (this == obj)
113
			return true;
114
		if (obj == null)
115
			return false;
116
		if (getClass() != obj.getClass())
117
			return false;
118
		Provider other = (Provider) obj;
119
		if (active != other.active)
120
			return false;
121
		if (Float.floatToIntBits(bundleWeightLimit) != Float.floatToIntBits(other.bundleWeightLimit))
122
			return false;
123
		if (groupShipmentAllowed != other.groupShipmentAllowed)
124
			return false;
125
		if (id != other.id)
126
			return false;
127
		if (Float.floatToIntBits(maxCODLimit) != Float.floatToIntBits(other.maxCODLimit))
128
			return false;
129
		if (name == null) {
130
			if (other.name != null)
131
				return false;
132
		} else if (!name.equals(other.name))
133
			return false;
134
		if (pickup != other.pickup)
135
			return false;
136
		return true;
137
	}
138
	@Override
21602 ashik.ali 139
	public String toString() {
140
		return "Provider [id=" + id + ", name=" + name + ", active=" + active + ", pickup=" + pickup
141
				+ ", bundleWeightLimit=" + bundleWeightLimit + ", groupShipmentAllowed=" + groupShipmentAllowed
142
				+ ", maxCODLimit=" + maxCODLimit + "]";
143
	}
21545 ashik.ali 144
 
145
 
21602 ashik.ali 146
 
21545 ashik.ali 147
}