Subversion Repositories SmartDukaan

Rev

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

Rev 24471 Rev 31764
Line 22... Line 22...
22
/**
22
/**
23
 * @author govind
23
 * @author govind
24
 *
24
 *
25
 */
25
 */
26
@Entity
26
@Entity
27
@Table(name="cs.position" ,schema="cs")
27
@Table(name = "cs.position")
28
public class Position {
28
public class Position {
29
	
29
 
30
	@Id
30
    @Id
31
	@Column(name="id", unique=true, updatable=false)
31
    @Column(name = "id", unique = true, updatable = false)
32
	@GeneratedValue(strategy = GenerationType.IDENTITY)
32
    @GeneratedValue(strategy = GenerationType.IDENTITY)
33
	private int id;
33
    private int id;
34
	
34
 
35
	@Column(name="auth_user_id")
35
    @Column(name = "auth_user_id")
36
	private int authUserId;
36
    private int authUserId;
37
	
37
 
38
	@Column(name="category_id")
38
    @Column(name = "category_id")
39
	private int categoryId;
39
    private int categoryId;
40
	
40
 
41
	@Column(name="region_id")
41
    @Column(name = "region_id")
42
	private int regionId;
42
    private int regionId;
43
	
43
 
44
	@Column(name="escalation_type")
44
    @Column(name = "escalation_type")
45
	@Enumerated(EnumType.STRING)
45
    @Enumerated(EnumType.STRING)
46
	private EscalationType escalationType;
46
    private EscalationType escalationType;
47
	
47
 
48
	@Convert(converter = LocalDateTimeAttributeConverter.class)
48
    @Convert(converter = LocalDateTimeAttributeConverter.class)
49
	@Column(name = "create_timestamp")
49
    @Column(name = "create_timestamp")
50
	private LocalDateTime createTimestamp;
50
    private LocalDateTime createTimestamp;
51
 
51
 
52
	public int getId() {
52
 
53
		return id;
53
    @Column(name = "ticket_assignee")
54
	}
54
    private boolean ticketAssignee;
55
 
55
 
56
	public void setId(int id) {
56
 
57
		this.id = id;
57
    public boolean isTicketAssignee() {
58
	}
58
        return ticketAssignee;
59
 
59
    }
60
	public int getAuthUserId() {
60
 
61
		return authUserId;
61
    public void setTicketAssignee(boolean ticketAssignee) {
62
	}
62
        this.ticketAssignee = ticketAssignee;
63
 
63
    }
64
	public void setAuthUserId(int authUserId) {
64
 
65
		this.authUserId = authUserId;
65
    public int getId() {
66
	}
66
        return id;
67
 
67
    }
68
	public int getCategoryId() {
68
 
69
		return categoryId;
69
    public void setId(int id) {
70
	}
70
        this.id = id;
71
 
71
    }
72
	public void setCategoryId(int categoryId) {
72
 
73
		this.categoryId = categoryId;
73
    public int getAuthUserId() {
74
	}
74
        return authUserId;
75
 
75
    }
76
	public EscalationType getEscalationType() {
76
 
77
		return escalationType;
77
    public void setAuthUserId(int authUserId) {
78
	}
78
        this.authUserId = authUserId;
79
 
79
    }
80
	public void setEscalationType(EscalationType escalationType) {
80
 
81
		this.escalationType = escalationType;
81
    public int getCategoryId() {
82
	}
82
        return categoryId;
83
 
83
    }
84
	public int getRegionId() {
84
 
85
		return regionId;
85
    public void setCategoryId(int categoryId) {
86
	}
86
        this.categoryId = categoryId;
87
 
87
    }
88
	public void setRegionId(int regionId) {
88
 
89
		this.regionId = regionId;
89
    public EscalationType getEscalationType() {
90
	}
90
        return escalationType;
91
 
91
    }
92
	public LocalDateTime getCreateTimestamp() {
92
 
93
		return createTimestamp;
93
    public void setEscalationType(EscalationType escalationType) {
94
	}
94
        this.escalationType = escalationType;
95
 
95
    }
96
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
96
 
97
		this.createTimestamp = createTimestamp;
97
    public int getRegionId() {
98
	}
98
        return regionId;
99
	public String getFormattedCreateTimestamp(){
99
    }
100
		if(createTimestamp == null){
100
 
101
			return null;
101
    public void setRegionId(int regionId) {
102
		}
102
        this.regionId = regionId;
103
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
103
    }
104
		return createTimestamp.format(formatter);
104
 
105
    }
105
    public LocalDateTime getCreateTimestamp() {
106
	@Override
106
        return createTimestamp;
107
	public int hashCode() {
107
    }
108
		final int prime = 31;
108
 
109
		int result = 1;
109
    public void setCreateTimestamp(LocalDateTime createTimestamp) {
110
		result = prime * result + authUserId;
110
        this.createTimestamp = createTimestamp;
111
		result = prime * result + categoryId;
111
    }
112
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
112
 
113
		result = prime * result + ((escalationType == null) ? 0 : escalationType.hashCode());
113
    public String getFormattedCreateTimestamp() {
114
		result = prime * result + id;
114
        if (createTimestamp == null) {
115
		result = prime * result + regionId;
115
            return null;
116
		return result;
116
        }
117
	}
117
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
118
 
118
        return createTimestamp.format(formatter);
119
	@Override
119
    }
120
	public boolean equals(Object obj) {
120
 
121
		if (this == obj)
121
    @Override
122
			return true;
122
    public int hashCode() {
123
		if (obj == null)
123
        final int prime = 31;
124
			return false;
124
        int result = 1;
125
		if (getClass() != obj.getClass())
125
        result = prime * result + authUserId;
126
			return false;
126
        result = prime * result + categoryId;
127
		Position other = (Position) obj;
127
        result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
128
		if (authUserId != other.authUserId)
128
        result = prime * result + ((escalationType == null) ? 0 : escalationType.hashCode());
129
			return false;
129
        result = prime * result + id;
130
		if (categoryId != other.categoryId)
130
        result = prime * result + regionId;
131
			return false;
131
        result = prime * result + (ticketAssignee ? 1231 : 1237);
132
		if (createTimestamp == null) {
132
        return result;
133
			if (other.createTimestamp != null)
133
    }
134
				return false;
134
 
135
		} else if (!createTimestamp.equals(other.createTimestamp))
135
    @Override
136
			return false;
136
    public boolean equals(Object obj) {
137
		if (escalationType != other.escalationType)
137
        if (this == obj) return true;
138
			return false;
138
        if (obj == null) return false;
139
		if (id != other.id)
139
        if (getClass() != obj.getClass()) return false;
140
			return false;
140
        Position other = (Position) obj;
141
		if (regionId != other.regionId)
141
        if (authUserId != other.authUserId) return false;
142
			return false;
142
        if (categoryId != other.categoryId) return false;
143
		return true;
143
        if (createTimestamp == null) {
144
	}
144
            if (other.createTimestamp != null) return false;
145
 
145
        } else if (!createTimestamp.equals(other.createTimestamp)) return false;
146
	@Override
146
        if (escalationType != other.escalationType) return false;
147
	public String toString() {
147
        if (id != other.id) return false;
148
		return "Position [id=" + id + ", authUserId=" + authUserId + ", categoryId=" + categoryId + ", regionId="
148
        if (regionId != other.regionId) return false;
149
				+ regionId + ", escalationType=" + escalationType + ", createTimestamp=" + createTimestamp + "]";
149
        if (ticketAssignee != other.ticketAssignee) return false;
150
	}
150
        return true;
151
	
151
    }
152
	
152
 
-
 
153
    @Override
-
 
154
    public String toString() {
-
 
155
        return "Position [id=" + id + ", authUserId=" + authUserId + ", categoryId=" + categoryId + ", regionId=" + regionId + ", escalationType=" + escalationType + ", createTimestamp=" + createTimestamp + ", ticketAssignee=" + ticketAssignee + "]";
-
 
156
    }
-
 
157
 
153
 
158
 
154
}
159
}