Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
24407 govind 1
package com.spice.profitmandi.dao.entity.cs;
2
 
31170 amit.gupta 3
import javax.persistence.*;
24407 govind 4
import java.io.Serializable;
5
 
6
/**
7
 * This class basically contains api details
8
 * 
9
 * @author Govind
10
 *
11
 */
12
 
13
@Entity
14
@Table(name="cs.region", schema = "cs")
15
public class Region implements Serializable{
16
 
17
	private static final long serialVersionUID = 1L;
18
 
19
	@Id
20
	@Column(name="id", unique=true, updatable=false)
21
	@GeneratedValue(strategy = GenerationType.IDENTITY)
22
	private int id;
23
 
24
	@Column(name="name", unique = true)
25
	private String name;
31170 amit.gupta 26
 
27
 
24407 govind 28
	@Column(name = "description")
29
	private String description;
30
 
31
	@Override
32
	public String toString() {
33
		return "Region [id=" + id + ", name=" + name + ", description=" + description + "]";
34
	}
35
 
36
	public int getId() {
37
		return id;
38
	}
39
 
40
	public void setId(int id) {
41
		this.id = id;
42
	}
43
 
44
	public String getName() {
45
		return name;
46
	}
47
 
48
	public void setName(String name) {
49
		this.name = name;
50
	}
51
 
52
	public String getDescription() {
53
		return description;
54
	}
55
 
56
	public void setDescription(String description) {
57
		this.description = description;
58
	}
59
 
60
	@Override
61
	public int hashCode() {
62
		final int prime = 31;
63
		int result = 1;
64
		result = prime * result + ((description == null) ? 0 : description.hashCode());
65
		result = prime * result + id;
66
		result = prime * result + ((name == null) ? 0 : name.hashCode());
67
		return result;
68
	}
69
 
70
	@Override
71
	public boolean equals(Object obj) {
72
		if (this == obj)
73
			return true;
74
		if (obj == null)
75
			return false;
76
		if (getClass() != obj.getClass())
77
			return false;
78
		Region other = (Region) obj;
79
		if (description == null) {
80
			if (other.description != null)
81
				return false;
82
		} else if (!description.equals(other.description))
83
			return false;
84
		if (id != other.id)
85
			return false;
86
		if (name == null) {
87
			if (other.name != null)
88
				return false;
89
		} else if (!name.equals(other.name))
90
			return false;
91
		return true;
92
	}
93
 
94
 
95
 
96
 
97
}