Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
21720 ashik.ali 1
package com.spice.profitmandi.dao.entity.dtr;
21545 ashik.ali 2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
 
6
import javax.persistence.Column;
22009 ashik.ali 7
import javax.persistence.Convert;
21545 ashik.ali 8
import javax.persistence.Entity;
9
import javax.persistence.GeneratedValue;
10
import javax.persistence.GenerationType;
11
import javax.persistence.Id;
12
import javax.persistence.Table;
13
 
22009 ashik.ali 14
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
15
 
21545 ashik.ali 16
/**
17
 * This class basically contains api details
18
 * 
19
 * @author ashikali
20
 *
21
 */
22
@Entity
21596 ashik.ali 23
@Table(name="dtr.brands", schema = "dtr")
21545 ashik.ali 24
public class Brand implements Serializable{
25
 
26
	private static final long serialVersionUID = 1L;
27
 
28
	public Brand() {
29
	}
30
 
31
	@Id
32
	@Column(name="id", columnDefinition = "int(10) unsigned")
33
	@GeneratedValue(strategy = GenerationType.IDENTITY)
34
	private int id;
35
 
36
	@Column(name="name")
37
	private String name;
38
 
39
	@Column(name = "category_id")
40
	private int categoryId;
41
 
42
	@Column(name = "displayed_in_preference_page", columnDefinition="tinyint(1) default 0")
43
	private boolean displayedInPreferencePage;
44
 
22009 ashik.ali 45
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21545 ashik.ali 46
	@Column(name = "created")
47
	private LocalDateTime createTimestamp;
48
 
49
	public int getId() {
50
		return id;
51
	}
52
	public void setId(int id) {
53
		this.id = id;
54
	}
55
	public void setName(String name) {
56
        this.name = name;
57
    }
58
    public String getName() {
59
        return name;
60
    }
61
 
62
    public int getCategoryId() {
63
		return categoryId;
64
	}
65
    public void setCategoryId(int categoryId) {
66
		this.categoryId = categoryId;
67
	}
68
    public boolean isDisplayedInPreferencePage() {
69
		return displayedInPreferencePage;
70
	}
71
    public void setDisplayedInPreferencePage(boolean displayedInPreferencePage) {
72
		this.displayedInPreferencePage = displayedInPreferencePage;
73
	}
74
    public LocalDateTime getCreateTimestamp() {
75
		return createTimestamp;
76
	}
77
    public void setCreateTimestamp(LocalDateTime createTimestamp) {
78
		this.createTimestamp = createTimestamp;
79
	}
21924 ashik.ali 80
 
22009 ashik.ali 81
 
21602 ashik.ali 82
	@Override
21924 ashik.ali 83
	public int hashCode() {
84
		final int prime = 31;
85
		int result = 1;
86
		result = prime * result + id;
87
		return result;
88
	}
89
	@Override
90
	public boolean equals(Object obj) {
91
		if (this == obj)
92
			return true;
93
		if (obj == null)
94
			return false;
95
		if (getClass() != obj.getClass())
96
			return false;
97
		Brand other = (Brand) obj;
98
		if (id != other.id)
99
			return false;
100
		return true;
101
	}
102
	@Override
21602 ashik.ali 103
	public String toString() {
104
		return "Brand [id=" + id + ", name=" + name + ", categoryId=" + categoryId + ", displayedInPreferencePage="
105
				+ displayedInPreferencePage + ", createTimestamp=" + createTimestamp + "]";
106
	}
21545 ashik.ali 107
 
108
 
109
}