| 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;
|
|
|
7 |
import javax.persistence.Entity;
|
|
|
8 |
import javax.persistence.GeneratedValue;
|
|
|
9 |
import javax.persistence.GenerationType;
|
|
|
10 |
import javax.persistence.Id;
|
|
|
11 |
import javax.persistence.NamedQueries;
|
|
|
12 |
import javax.persistence.NamedQuery;
|
|
|
13 |
import javax.persistence.Table;
|
|
|
14 |
|
|
|
15 |
/**
|
|
|
16 |
* This class basically contains api details
|
|
|
17 |
*
|
|
|
18 |
* @author ashikali
|
|
|
19 |
*
|
|
|
20 |
*/
|
|
|
21 |
@Entity
|
| 21596 |
ashik.ali |
22 |
@Table(name="dtr.brands", schema = "dtr")
|
| 21545 |
ashik.ali |
23 |
@NamedQueries({
|
|
|
24 |
@NamedQuery(name = "Brand.selectCount", query = "select count(b) from Brand b"),
|
|
|
25 |
@NamedQuery(name="Brand.selectAll",query="select b from Brand b where b.displayedInPreferencePage = :displayedInPreferencePage"),
|
|
|
26 |
@NamedQuery(name="Brand.selectById",query="select b from Brand b where b.id= :id"),
|
|
|
27 |
@NamedQuery(name="Brand.selectByName",query="select b from Brand b where b.name= :name"),
|
|
|
28 |
@NamedQuery(name="Brand.selectByIdAndName",query="select b from Brand b where b.id = :id and b.name= :name"),
|
|
|
29 |
@NamedQuery(name = "Brand.selectCountByName", query = "select count(b) from Brand b where b.name= :name"),
|
|
|
30 |
@NamedQuery(name="Brand.deleteById",query="delete from Brand b where b.id= :id")
|
|
|
31 |
})
|
|
|
32 |
public class Brand implements Serializable{
|
|
|
33 |
|
|
|
34 |
private static final long serialVersionUID = 1L;
|
|
|
35 |
|
|
|
36 |
public Brand() {
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
@Id
|
|
|
40 |
@Column(name="id", columnDefinition = "int(10) unsigned")
|
|
|
41 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
42 |
private int id;
|
|
|
43 |
|
|
|
44 |
@Column(name="name")
|
|
|
45 |
private String name;
|
|
|
46 |
|
|
|
47 |
@Column(name = "category_id")
|
|
|
48 |
private int categoryId;
|
|
|
49 |
|
|
|
50 |
@Column(name = "displayed_in_preference_page", columnDefinition="tinyint(1) default 0")
|
|
|
51 |
private boolean displayedInPreferencePage;
|
|
|
52 |
|
|
|
53 |
@Column(name = "created")
|
|
|
54 |
private LocalDateTime createTimestamp;
|
|
|
55 |
|
|
|
56 |
public int getId() {
|
|
|
57 |
return id;
|
|
|
58 |
}
|
|
|
59 |
public void setId(int id) {
|
|
|
60 |
this.id = id;
|
|
|
61 |
}
|
|
|
62 |
public void setName(String name) {
|
|
|
63 |
this.name = name;
|
|
|
64 |
}
|
|
|
65 |
public String getName() {
|
|
|
66 |
return name;
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
public int getCategoryId() {
|
|
|
70 |
return categoryId;
|
|
|
71 |
}
|
|
|
72 |
public void setCategoryId(int categoryId) {
|
|
|
73 |
this.categoryId = categoryId;
|
|
|
74 |
}
|
|
|
75 |
public boolean isDisplayedInPreferencePage() {
|
|
|
76 |
return displayedInPreferencePage;
|
|
|
77 |
}
|
|
|
78 |
public void setDisplayedInPreferencePage(boolean displayedInPreferencePage) {
|
|
|
79 |
this.displayedInPreferencePage = displayedInPreferencePage;
|
|
|
80 |
}
|
|
|
81 |
public LocalDateTime getCreateTimestamp() {
|
|
|
82 |
return createTimestamp;
|
|
|
83 |
}
|
|
|
84 |
public void setCreateTimestamp(LocalDateTime createTimestamp) {
|
|
|
85 |
this.createTimestamp = createTimestamp;
|
|
|
86 |
}
|
| 21602 |
ashik.ali |
87 |
@Override
|
|
|
88 |
public String toString() {
|
|
|
89 |
return "Brand [id=" + id + ", name=" + name + ", categoryId=" + categoryId + ", displayedInPreferencePage="
|
|
|
90 |
+ displayedInPreferencePage + ", createTimestamp=" + createTimestamp + "]";
|
|
|
91 |
}
|
| 21545 |
ashik.ali |
92 |
|
|
|
93 |
|
|
|
94 |
}
|