LogEventType.java
/*
* +====================================================================+
* | Copyright (C) 2015 Rochester Institute of Technology, |
* | 103 Lomb Memorial Drive, Rochester, NY - 14623 |
* | All Rights Reserved. |
* +====================================================================+
* FILENAME
* LogEventType.java
*
* AUTHOR
* @author Khanh Ho (kchisd at rit.edu)
*
* =====================================================================
*/
package edu.rit.coopeval.model;
import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Collection;
@Entity
@Table(name = "LOGEVENTTYPE")
public class LogEventType {
private long logEventTypeId;
private String name;
private Timestamp createDate;
private String createBy;
private Timestamp modDate;
private String modBy;
private Collection<LogEvent> logEventsByLogEventTypeId;
@Id
@Column(name = "LOGEVENTTYPEID", nullable = false, insertable = true, updatable = true, precision = 0)
public long getLogEventTypeId() {
return logEventTypeId;
}
public void setLogEventTypeId(long logEventTypeId) {
this.logEventTypeId = logEventTypeId;
}
@Basic
@Column(name = "NAME", nullable = true, insertable = true, updatable = true, length = 64)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Basic
@Column(name = "CREATEDATE", nullable = true, insertable = true, updatable = true)
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
@Basic
@Column(name = "CREATEBY", nullable = true, insertable = true, updatable = true, length = 15)
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
@Basic
@Column(name = "MODDATE", nullable = true, insertable = true, updatable = true)
public Timestamp getModDate() {
return modDate;
}
public void setModDate(Timestamp modDate) {
this.modDate = modDate;
}
@Basic
@Column(name = "MODBY", nullable = true, insertable = true, updatable = true, length = 15)
public String getModBy() {
return modBy;
}
public void setModBy(String modBy) {
this.modBy = modBy;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
LogEventType that = (LogEventType) o;
if (logEventTypeId != that.logEventTypeId) {
return false;
}
if (createBy != null ? !createBy.equals(that.createBy) : that.createBy != null) {
return false;
}
if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) {
return false;
}
if (modBy != null ? !modBy.equals(that.modBy) : that.modBy != null) {
return false;
}
if (modDate != null ? !modDate.equals(that.modDate) : that.modDate != null) {
return false;
}
if (name != null ? !name.equals(that.name) : that.name != null) {
return false;
}
return true;
}
@Override
public int hashCode() {
int result = (int) (logEventTypeId ^ (logEventTypeId >>> 32));
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
result = 31 * result + (createBy != null ? createBy.hashCode() : 0);
result = 31 * result + (modDate != null ? modDate.hashCode() : 0);
result = 31 * result + (modBy != null ? modBy.hashCode() : 0);
return result;
}
@OneToMany(mappedBy = "logEventTypeByLogEventTypeId")
public Collection<LogEvent> getLogEventsByLogEventTypeId() {
return logEventsByLogEventTypeId;
}
public void setLogEventsByLogEventTypeId(Collection<LogEvent> logEventsByLogEventTypeId) {
this.logEventsByLogEventTypeId = logEventsByLogEventTypeId;
}
}