Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
26733 amit.gupta 1
package com.spice.profitmandi.dao.entity.dtr;
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
import com.fasterxml.jackson.annotation.JsonProperty;
13
 
14
/**
15
 * This class basically contains api details
16
 * 
17
 * @author ashikali
18
 *
19
 */
20
@Entity
21
@Table(name="dtr.web_listing", schema = "dtr")
22
public class WebListing implements Serializable{
23
 
24
	private static final long serialVersionUID = 1L;
25
	@Id
26
	@Column(name="id", columnDefinition = "int(10) unsigned")
27
	@GeneratedValue(strategy = GenerationType.IDENTITY)
26734 amit.gupta 28
	@JsonProperty(defaultValue="0")
26733 amit.gupta 29
	private int id;
30
 
31
	@Column
32
	private String title;
33
 
34
	@Column
35
	@JsonProperty(defaultValue="0")
36
	private int rank;
37
 
38
	@Column
39
	private String url;
40
 
41
	@Column
42
	@JsonProperty(defaultValue="true")
43
	private boolean active=true;
44
 
45
	@Override
46
	public String toString() {
47
		return "WebListing [id=" + id + ", title=" + title + ", rank=" + rank + ", url=" + url + ", active=" + active
48
				+ "]";
49
	}
50
 
51
	public int getId() {
52
		return id;
53
	}
54
 
55
	public void setId(int id) {
56
		this.id = id;
57
	}
58
 
59
	public String getTitle() {
60
		return title;
61
	}
62
 
63
	public void setTitle(String title) {
64
		this.title = title;
65
	}
66
 
67
	public int getRank() {
68
		return rank;
69
	}
70
 
71
	public void setRank(int rank) {
72
		this.rank = rank;
73
	}
74
 
75
	public boolean isActive() {
76
		return active;
77
	}
78
 
79
	public void setActive(boolean active) {
80
		this.active = active;
81
	}
82
 
83
	public String getUrl() {
84
		return url;
85
	}
86
 
87
	public void setUrl(String url) {
88
		this.url = url;
89
	}
90
 
91
	@Override
92
	public int hashCode() {
93
		final int prime = 31;
94
		int result = 1;
95
		result = prime * result + (active ? 1231 : 1237);
96
		result = prime * result + id;
97
		result = prime * result + rank;
98
		result = prime * result + ((title == null) ? 0 : title.hashCode());
99
		result = prime * result + ((url == null) ? 0 : url.hashCode());
100
		return result;
101
	}
102
 
103
	@Override
104
	public boolean equals(Object obj) {
105
		if (this == obj)
106
			return true;
107
		if (obj == null)
108
			return false;
109
		if (getClass() != obj.getClass())
110
			return false;
111
		WebListing other = (WebListing) obj;
112
		if (active != other.active)
113
			return false;
114
		if (id != other.id)
115
			return false;
116
		if (rank != other.rank)
117
			return false;
118
		if (title == null) {
119
			if (other.title != null)
120
				return false;
121
		} else if (!title.equals(other.title))
122
			return false;
123
		if (url == null) {
124
			if (other.url != null)
125
				return false;
126
		} else if (!url.equals(other.url))
127
			return false;
128
		return true;
129
	}
130
 
131
 
132
}