Subversion Repositories SmartDukaan

Rev

Rev 31860 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31860 Rev 33809
Line 2... Line 2...
2
 
2
 
3
import javax.persistence.Column;
3
import javax.persistence.Column;
4
import javax.persistence.Entity;
4
import javax.persistence.Entity;
5
import javax.persistence.Id;
5
import javax.persistence.Id;
6
import javax.persistence.Table;
6
import javax.persistence.Table;
-
 
7
import java.util.Objects;
7
 
8
 
8
@Entity
9
@Entity
9
@Table(name="inventory.statemaster")
10
@Table(name="inventory.statemaster")
10
public class State {
11
public class State {
11
	@Id
12
	@Id
Line 19... Line 20...
19
	@Column(name="stateCode")
20
	@Column(name="stateCode")
20
	private String code;
21
	private String code;
21
	
22
	
22
	@Column
23
	@Column
23
	private String shortName;
24
	private String shortName;
24
	
-
 
25
	
-
 
26
 
25
 
27
	
26
	@Column
28
	public String getCode() {
27
	private String zone;
29
		return code;
-
 
30
	}
-
 
31
 
28
 
32
 
29
 
33
	public void setCode(String code) {
30
	public String getZone() {
34
		this.code = code;
31
		return zone;
35
	}
32
	}
36
 
33
 
-
 
34
	public void setZone(String zone) {
-
 
35
		this.zone = zone;
-
 
36
	}
37
 
37
 
38
	@Override
-
 
39
	public int hashCode() {
38
	public String getCode() {
40
		final int prime = 31;
-
 
41
		int result = 1;
-
 
42
		result = prime * result + ((code == null) ? 0 : code.hashCode());
-
 
43
		result = prime * result + id;
-
 
44
		result = prime * result + ((name == null) ? 0 : name.hashCode());
-
 
45
		result = prime * result + ((shortName == null) ? 0 : shortName.hashCode());
-
 
46
		return result;
39
		return code;
47
	}
40
	}
48
 
41
 
49
 
42
 
50
	@Override
-
 
51
	public boolean equals(Object obj) {
43
	public void setCode(String code) {
52
		if (this == obj)
-
 
53
			return true;
-
 
54
		if (obj == null)
-
 
55
			return false;
-
 
56
		if (getClass() != obj.getClass())
-
 
57
			return false;
-
 
58
		State other = (State) obj;
-
 
59
		if (code == null) {
-
 
60
			if (other.code != null)
44
		this.code = code;
61
				return false;
-
 
62
		} else if (!code.equals(other.code))
-
 
63
			return false;
-
 
64
		if (id != other.id)
-
 
65
			return false;
-
 
66
		if (name == null) {
-
 
67
			if (other.name != null)
-
 
68
				return false;
-
 
69
		} else if (!name.equals(other.name))
-
 
70
			return false;
-
 
71
		if (shortName == null) {
-
 
72
			if (other.shortName != null)
-
 
73
				return false;
-
 
74
		} else if (!shortName.equals(other.shortName))
-
 
75
			return false;
-
 
76
		return true;
-
 
77
	}
45
	}
78
 
46
 
79
 
47
 
80
	public int getId() {
48
	public int getId() {
81
		return id;
49
		return id;
Line 105... Line 73...
105
 
73
 
106
	public void setShortName(String shortName) {
74
	public void setShortName(String shortName) {
107
		this.shortName = shortName;
75
		this.shortName = shortName;
108
	}
76
	}
109
 
77
 
-
 
78
	@Override
-
 
79
	public boolean equals(Object o) {
-
 
80
		if (this == o) return true;
-
 
81
		if (o == null || getClass() != o.getClass()) return false;
-
 
82
		State state = (State) o;
-
 
83
		return id == state.id && Objects.equals(name, state.name) && Objects.equals(code, state.code) && Objects.equals(shortName, state.shortName) && Objects.equals(zone, state.zone);
-
 
84
	}
-
 
85
 
-
 
86
	@Override
-
 
87
	public int hashCode() {
-
 
88
		return Objects.hash(id, name, code, shortName, zone);
-
 
89
	}
110
 
90
 
111
	@Override
91
	@Override
112
	public String toString() {
92
	public String toString() {
-
 
93
		return "State{" +
-
 
94
				"id=" + id +
-
 
95
				", name='" + name + '\'' +
-
 
96
				", code='" + code + '\'' +
113
		return "State [id=" + id + ", name=" + name + ", code=" + code + ", shortName=" + shortName + "]";
97
				", shortName='" + shortName + '\'' +
-
 
98
				", zone='" + zone + '\'' +
-
 
99
				'}';
114
	}
100
	}
115
	
-
 
116
	
-
 
117
}
101
}