Subversion Repositories SmartDukaan

Rev

Rev 27124 | Rev 31860 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27124 Rev 31193
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.cs;
1
package com.spice.profitmandi.dao.entity.cs;
2
 
2
 
-
 
3
import javax.persistence.*;
3
import java.io.Serializable;
4
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;
5
import java.util.Objects;
10
import javax.persistence.Table;
-
 
11
import javax.persistence.Transient;
-
 
12
 
6
 
13
/**
7
/**
14
 * This class basically contains api details
8
 * This class basically contains api details
15
 * 
9
 * 
16
 * @author amit
10
 * @author amit
17
 *
11
 *
18
 */
12
 */
19
 
13
 
20
@Entity
14
@Entity
21
@Table(name="cs.ticket_sub_category", schema = "cs")
15
@Table(name = "cs.ticket_sub_category", schema = "cs")
22
public class TicketSubCategory implements Serializable{
16
public class TicketSubCategory implements Serializable{
23
	
17
 
24
	private static final long serialVersionUID = 1L;
18
	private static final long serialVersionUID = 1L;
25
	
19
 
26
	@Id
20
	@Id
27
	@Column(name="id", unique=true, updatable=false)
21
	@Column(name = "id", unique = true, updatable = false)
28
	@GeneratedValue(strategy = GenerationType.IDENTITY)
22
	@GeneratedValue(strategy = GenerationType.IDENTITY)
29
	private int id;
23
	private int id;
30
	
24
 
31
	@Column(name="category_id")
25
	@Column(name = "category_id")
32
	private int categoryId;
26
	private int categoryId;
33
	
-
 
34
	@Override
-
 
35
	public int hashCode() {
-
 
36
		final int prime = 31;
-
 
37
		int result = 1;
-
 
38
		result = prime * result + categoryId;
-
 
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
 
27
 
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;
-
 
54
		if (categoryId != other.categoryId)
-
 
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) {
28
	@Column(name = "visibility")
64
			if (other.name != null)
29
	private boolean visibility;
65
				return false;
-
 
66
		} else if (!name.equals(other.name))
-
 
67
			return false;
-
 
68
		return true;
-
 
69
	}
30
 
70
	
31
 
-
 
32
	@Transient
71
	@Transient TicketCategory ticketCategory;
33
	TicketCategory ticketCategory;
72
 
34
 
73
	public int getCategoryId() {
35
	public int getCategoryId() {
74
		return categoryId;
36
		return categoryId;
75
	}
37
	}
76
 
38
 
Line 104... Line 66...
104
 
66
 
105
	public String getDescription() {
67
	public String getDescription() {
106
		return description;
68
		return description;
107
	}
69
	}
108
 
70
 
-
 
71
	@Override
109
	public void setDescription(String description) {
72
	public String toString() {
-
 
73
		return "TicketSubCategory{" +
-
 
74
				"id=" + id +
-
 
75
				", categoryId=" + categoryId +
-
 
76
				", visibility=" + visibility +
-
 
77
				", ticketCategory=" + ticketCategory +
-
 
78
				", name='" + name + '\'' +
110
		this.description = description;
79
				", description='" + description + '\'' +
-
 
80
				'}';
111
	}
81
	}
112
 
82
 
113
	@Override
83
	@Override
-
 
84
	public boolean equals(Object o) {
-
 
85
		if (this == o) return true;
-
 
86
		if (o == null || getClass() != o.getClass()) return false;
-
 
87
		TicketSubCategory that = (TicketSubCategory) o;
-
 
88
		return id == that.id && categoryId == that.categoryId && visibility == that.visibility && Objects.equals(ticketCategory, that.ticketCategory) && Objects.equals(name, that.name) && Objects.equals(description, that.description);
-
 
89
	}
-
 
90
 
-
 
91
	@Override
114
	public String toString() {
92
	public int hashCode() {
115
		return "TicketSubCategory [id=" + id + ", categoryId=" + categoryId + ", name=" + name + ", description="
93
		return Objects.hash(id, categoryId, visibility, ticketCategory, name, description);
-
 
94
	}
-
 
95
 
-
 
96
	public boolean isVisibility() {
116
				+ description + "]";
97
		return visibility;
117
	}
98
	}
118
 
99
 
-
 
100
	public void setVisibility(boolean visibility) {
-
 
101
		this.visibility = visibility;
-
 
102
	}
-
 
103
 
-
 
104
	public void setDescription(String description) {
-
 
105
		this.description = description;
-
 
106
	}
-
 
107
 
119
	@Column(name="name", unique = true)
108
	@Column(name = "name", unique = true)
120
	private String name;
109
	private String name;
121
	
110
 
122
	@Column(name = "description")
111
	@Column(name = "description")
123
	private String description;
112
	private String description;
124
        
113
        
125
}
114
}
126
115