Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
36888 aman 1
package com.spice.profitmandi.dao.entity;
2
 
3
import javax.persistence.*;
4
import java.io.Serializable;
5
import java.time.LocalDateTime;
6
 
7
/**
8
 * Contact directory entry rendered on the Contact-Us page.
9
 * <p>
10
 * A single table backs both visible blocks on the page; the {@link #section}
11
 * column distinguishes them:
12
 * <ul>
13
 *     <li>{@code MAIN} - the top contact list (uses {@link #baseArea} as "Base Area")</li>
14
 *     <li>{@code ESCALATION} - the escalations list (uses {@link #baseArea} as "Region")</li>
15
 * </ul>
16
 * Rows are soft-deleted via {@link #active} so data is never lost on delete.
17
 */
18
@Entity
19
@Table(name = "fofo.contact_us")
20
public class ContactUs implements Serializable {
21
 
22
    public static final String SECTION_MAIN = "MAIN";
23
    public static final String SECTION_ESCALATION = "ESCALATION";
24
 
25
    @Id
26
    @GeneratedValue(strategy = GenerationType.IDENTITY)
27
    private int id;
28
 
29
    @Column(name = "section", nullable = false)
30
    private String section;
31
 
32
    @Column(name = "area")
33
    private String area;
34
 
35
    @Column(name = "base_area")
36
    private String baseArea;
37
 
38
    @Column(name = "name")
39
    private String name;
40
 
41
    @Column(name = "designation")
42
    private String designation;
43
 
44
    @Column(name = "mobile")
45
    private String mobile;
46
 
47
    @Column(name = "email")
48
    private String email;
49
 
50
    @Column(name = "sort_order", nullable = false)
51
    private int sortOrder;
52
 
53
    @Column(name = "active", nullable = false)
54
    private boolean active = true;
55
 
56
    @Column(name = "created_date", updatable = false)
57
    private LocalDateTime createdDate = LocalDateTime.now();
58
 
59
    @Column(name = "updated_date")
60
    private LocalDateTime updatedDate = LocalDateTime.now();
61
 
62
    @PreUpdate
63
    protected void onUpdate() {
64
        this.updatedDate = LocalDateTime.now();
65
    }
66
 
67
    public int getId() {
68
        return id;
69
    }
70
 
71
    public void setId(int id) {
72
        this.id = id;
73
    }
74
 
75
    public String getSection() {
76
        return section;
77
    }
78
 
79
    public void setSection(String section) {
80
        this.section = section;
81
    }
82
 
83
    public String getArea() {
84
        return area;
85
    }
86
 
87
    public void setArea(String area) {
88
        this.area = area;
89
    }
90
 
91
    public String getBaseArea() {
92
        return baseArea;
93
    }
94
 
95
    public void setBaseArea(String baseArea) {
96
        this.baseArea = baseArea;
97
    }
98
 
99
    public String getName() {
100
        return name;
101
    }
102
 
103
    public void setName(String name) {
104
        this.name = name;
105
    }
106
 
107
    public String getDesignation() {
108
        return designation;
109
    }
110
 
111
    public void setDesignation(String designation) {
112
        this.designation = designation;
113
    }
114
 
115
    public String getMobile() {
116
        return mobile;
117
    }
118
 
119
    public void setMobile(String mobile) {
120
        this.mobile = mobile;
121
    }
122
 
123
    public String getEmail() {
124
        return email;
125
    }
126
 
127
    public void setEmail(String email) {
128
        this.email = email;
129
    }
130
 
131
    public int getSortOrder() {
132
        return sortOrder;
133
    }
134
 
135
    public void setSortOrder(int sortOrder) {
136
        this.sortOrder = sortOrder;
137
    }
138
 
139
    public boolean isActive() {
140
        return active;
141
    }
142
 
143
    public void setActive(boolean active) {
144
        this.active = active;
145
    }
146
 
147
    public LocalDateTime getCreatedDate() {
148
        return createdDate;
149
    }
150
 
151
    public void setCreatedDate(LocalDateTime createdDate) {
152
        this.createdDate = createdDate;
153
    }
154
 
155
    public LocalDateTime getUpdatedDate() {
156
        return updatedDate;
157
    }
158
 
159
    public void setUpdatedDate(LocalDateTime updatedDate) {
160
        this.updatedDate = updatedDate;
161
    }
162
}