Subversion Repositories SmartDukaan

Rev

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

Rev 27270 Rev 31860
Line 28... Line 28...
28
 * @author amit
28
 * @author amit
29
 *
29
 *
30
 */
30
 */
31
 
31
 
32
@Entity
32
@Entity
33
@Table(name = "cs.activity", schema = "cs")
33
@Table(name = "cs.activity")
34
public class Activity implements Serializable {
34
public class Activity implements Serializable {
35
 
35
 
36
	private static final long serialVersionUID = 1L;
36
    private static final long serialVersionUID = 1L;
37
 
37
 
38
	@Id
38
    @Id
39
	@Column(name = "id", unique = true, updatable = false)
39
    @Column(name = "id", unique = true, updatable = false)
40
	@GeneratedValue(strategy = GenerationType.IDENTITY)
40
    @GeneratedValue(strategy = GenerationType.IDENTITY)
41
	private int id;
41
    private int id;
42
 
42
 
43
	@Column(name = "ticket_id")
43
    @Column(name = "ticket_id")
44
	private int ticketId;
44
    private int ticketId;
45
 
45
 
46
	@Column
46
    @Column
47
	@Enumerated(EnumType.STRING)
47
    @Enumerated(EnumType.STRING)
48
	private ActivityType type;
48
    private ActivityType type;
49
 
49
 
50
	@Column(name = "created_by")
50
    @Column(name = "created_by")
51
	private int createdBy;
51
    private int createdBy;
52
 
52
 
53
	@Column(name = "create_timestamp")
53
    @Column(name = "create_timestamp")
54
	private LocalDateTime createTimestamp;
54
    private LocalDateTime createTimestamp;
55
 
55
 
56
	@Column
56
    @Column
57
	private String message;
57
    private String message;
58
 
58
 
59
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
59
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
60
	@JoinColumn(name = "activity_id", insertable = false, updatable = false, nullable = false)
60
    @JoinColumn(name = "activity_id", insertable = false, updatable = false, nullable = false)
61
	private List<ActivityAttachment> activityAttachment;
61
    private List<ActivityAttachment> activityAttachment;
62
 
62
 
63
	public List<ActivityAttachment> getActivityAttachment() {
63
    public List<ActivityAttachment> getActivityAttachment() {
64
		return activityAttachment;
64
        return activityAttachment;
65
	}
65
    }
66
 
66
 
67
	public void setActivityAttachment(List<ActivityAttachment> activityAttachment) {
67
    public void setActivityAttachment(List<ActivityAttachment> activityAttachment) {
68
		this.activityAttachment = activityAttachment;
68
        this.activityAttachment = activityAttachment;
69
	}
69
    }
70
 
70
 
71
	@Transient
71
    @Transient
72
	private String name;
72
    private String name;
73
 
73
 
74
	public String getName() {
74
    public String getName() {
75
		return name;
75
        return name;
76
	}
76
    }
77
 
77
 
78
	public void setName(String name) {
78
    public void setName(String name) {
79
		this.name = name;
79
        this.name = name;
80
	}
80
    }
81
 
81
 
82
	@Override
82
    @Override
83
	public int hashCode() {
83
    public int hashCode() {
84
		final int prime = 31;
84
        final int prime = 31;
85
		int result = 1;
85
        int result = 1;
86
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
86
        result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
87
		result = prime * result + createdBy;
87
        result = prime * result + createdBy;
88
		result = prime * result + id;
88
        result = prime * result + id;
89
		result = prime * result + ((message == null) ? 0 : message.hashCode());
89
        result = prime * result + ((message == null) ? 0 : message.hashCode());
90
		result = prime * result + ((name == null) ? 0 : name.hashCode());
90
        result = prime * result + ((name == null) ? 0 : name.hashCode());
91
		result = prime * result + ticketId;
91
        result = prime * result + ticketId;
92
		result = prime * result + ((type == null) ? 0 : type.hashCode());
92
        result = prime * result + ((type == null) ? 0 : type.hashCode());
93
		return result;
93
        return result;
94
	}
94
    }
95
 
95
 
96
	@Override
96
    @Override
97
	public boolean equals(Object obj) {
97
    public boolean equals(Object obj) {
98
		if (this == obj)
98
        if (this == obj)
99
			return true;
99
            return true;
100
		if (obj == null)
100
        if (obj == null)
101
			return false;
101
            return false;
102
		if (getClass() != obj.getClass())
102
        if (getClass() != obj.getClass())
103
			return false;
103
            return false;
104
		Activity other = (Activity) obj;
104
        Activity other = (Activity) obj;
105
		if (createTimestamp == null) {
105
        if (createTimestamp == null) {
106
			if (other.createTimestamp != null)
106
            if (other.createTimestamp != null)
107
				return false;
107
                return false;
108
		} else if (!createTimestamp.equals(other.createTimestamp))
108
        } else if (!createTimestamp.equals(other.createTimestamp))
109
			return false;
109
            return false;
110
		if (createdBy != other.createdBy)
110
        if (createdBy != other.createdBy)
111
			return false;
111
            return false;
112
		if (id != other.id)
112
        if (id != other.id)
113
			return false;
113
            return false;
114
		if (message == null) {
114
        if (message == null) {
115
			if (other.message != null)
115
            if (other.message != null)
116
				return false;
116
                return false;
117
		} else if (!message.equals(other.message))
117
        } else if (!message.equals(other.message))
118
			return false;
118
            return false;
119
		if (name == null) {
119
        if (name == null) {
120
			if (other.name != null)
120
            if (other.name != null)
121
				return false;
121
                return false;
122
		} else if (!name.equals(other.name))
122
        } else if (!name.equals(other.name))
123
			return false;
123
            return false;
124
		if (ticketId != other.ticketId)
124
        if (ticketId != other.ticketId)
125
			return false;
125
            return false;
126
		if (type != other.type)
126
        if (type != other.type)
127
			return false;
127
            return false;
128
		return true;
128
        return true;
129
	}
129
    }
130
 
130
 
131
	public int getTicketId() {
131
    public int getTicketId() {
132
		return ticketId;
132
        return ticketId;
133
	}
133
    }
134
 
134
 
135
	public void setTicketId(int ticketId) {
135
    public void setTicketId(int ticketId) {
136
		this.ticketId = ticketId;
136
        this.ticketId = ticketId;
137
	}
137
    }
138
 
138
 
139
	public int getId() {
139
    public int getId() {
140
		return id;
140
        return id;
141
	}
141
    }
142
 
142
 
143
	public void setId(int id) {
143
    public void setId(int id) {
144
		this.id = id;
144
        this.id = id;
145
	}
145
    }
146
 
146
 
147
	public ActivityType getType() {
147
    public ActivityType getType() {
148
		return type;
148
        return type;
149
	}
149
    }
150
 
150
 
151
	public void setType(ActivityType type) {
151
    public void setType(ActivityType type) {
152
		this.type = type;
152
        this.type = type;
153
	}
153
    }
154
 
154
 
155
	public int getCreatedBy() {
155
    public int getCreatedBy() {
156
		return createdBy;
156
        return createdBy;
157
	}
157
    }
158
 
158
 
159
	public void setCreatedBy(int createdBy) {
159
    public void setCreatedBy(int createdBy) {
160
		this.createdBy = createdBy;
160
        this.createdBy = createdBy;
161
	}
161
    }
162
 
162
 
163
	public String getMessage() {
163
    public String getMessage() {
164
		return message;
164
        return message;
165
	}
165
    }
166
 
166
 
167
	public void setMessage(String message) {
167
    public void setMessage(String message) {
168
		this.message = message;
168
        this.message = message;
169
	}
169
    }
170
 
170
 
171
	public LocalDateTime getCreateTimestamp() {
171
    public LocalDateTime getCreateTimestamp() {
172
		return createTimestamp;
172
        return createTimestamp;
173
	}
173
    }
174
 
174
 
175
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
175
    public void setCreateTimestamp(LocalDateTime createTimestamp) {
176
		this.createTimestamp = createTimestamp;
176
        this.createTimestamp = createTimestamp;
177
	}
177
    }
178
 
178
 
179
	@Override
179
    @Override
180
	public String toString() {
180
    public String toString() {
181
		return "Activity [id=" + id + ", ticketId=" + ticketId + ", type=" + type + ", createdBy=" + createdBy
181
        return "Activity [id=" + id + ", ticketId=" + ticketId + ", type=" + type + ", createdBy=" + createdBy + ", createTimestamp=" + createTimestamp + ", message=" + message + ", name=" + name + "]";
182
				+ ", createTimestamp=" + createTimestamp + ", message=" + message + ", name=" + name + "]";
182
    }
183
	}
-
 
184
 
183
 
185
}
184
}
186
185