Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
24383 amit.gupta 1
package com.spice.profitmandi.dao.entity.cs;
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;
27124 amit.gupta 11
import javax.persistence.Transient;
24383 amit.gupta 12
 
13
/**
14
 * This class basically contains api details
15
 * 
16
 * @author amit
17
 *
18
 */
19
 
20
@Entity
24417 govind 21
@Table(name="cs.ticket_sub_category", schema = "cs")
24383 amit.gupta 22
public class TicketSubCategory implements Serializable{
23
 
24
	private static final long serialVersionUID = 1L;
25
 
26
	@Id
27
	@Column(name="id", unique=true, updatable=false)
28
	@GeneratedValue(strategy = GenerationType.IDENTITY)
29
	private int id;
30
 
31
	@Column(name="category_id")
24417 govind 32
	private int categoryId;
24383 amit.gupta 33
 
34
	@Override
35
	public int hashCode() {
36
		final int prime = 31;
37
		int result = 1;
24417 govind 38
		result = prime * result + categoryId;
24383 amit.gupta 39
		result = prime * result + ((description == null) ? 0 : description.hashCode());
40
		result = prime * result + id;
41
		result = prime * result + ((name == null) ? 0 : name.hashCode());
42
		return result;
43
	}
44
 
45
	@Override
46
	public boolean equals(Object obj) {
47
		if (this == obj)
48
			return true;
49
		if (obj == null)
50
			return false;
51
		if (getClass() != obj.getClass())
52
			return false;
53
		TicketSubCategory other = (TicketSubCategory) obj;
24417 govind 54
		if (categoryId != other.categoryId)
24383 amit.gupta 55
			return false;
56
		if (description == null) {
57
			if (other.description != null)
58
				return false;
59
		} else if (!description.equals(other.description))
60
			return false;
61
		if (id != other.id)
62
			return false;
63
		if (name == null) {
64
			if (other.name != null)
65
				return false;
66
		} else if (!name.equals(other.name))
67
			return false;
68
		return true;
69
	}
27124 amit.gupta 70
 
71
	@Transient TicketCategory ticketCategory;
24383 amit.gupta 72
 
27124 amit.gupta 73
	public int getCategoryId() {
74
		return categoryId;
75
	}
76
 
77
	public void setCategoryId(int categoryId) {
78
		this.categoryId = categoryId;
79
	}
80
 
81
	public TicketCategory getTicketCategory() {
82
		return ticketCategory;
83
	}
84
 
85
	public void setTicketCategory(TicketCategory ticketCategory) {
86
		this.ticketCategory = ticketCategory;
87
	}
88
 
24383 amit.gupta 89
	public int getId() {
90
		return id;
91
	}
92
 
93
	public void setId(int id) {
94
		this.id = id;
95
	}
96
 
97
	public String getName() {
98
		return name;
99
	}
100
 
101
	public void setName(String name) {
102
		this.name = name;
103
	}
104
 
105
	public String getDescription() {
106
		return description;
107
	}
108
 
109
	public void setDescription(String description) {
110
		this.description = description;
111
	}
112
 
113
	@Override
114
	public String toString() {
24417 govind 115
		return "TicketSubCategory [id=" + id + ", categoryId=" + categoryId + ", name=" + name + ", description="
24383 amit.gupta 116
				+ description + "]";
117
	}
118
 
119
	@Column(name="name", unique = true)
120
	private String name;
121
 
122
	@Column(name = "description")
123
	private String description;
124
 
125
}