DepartmentUser.java
/*
* +====================================================================+
* | Copyright (C) 2015 Rochester Institute of Technology, |
* | 103 Lomb Memorial Drive, Rochester, NY - 14623 |
* | All Rights Reserved. |
* +====================================================================+
* FILENAME
* DepartmentUser.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;
/**
* Created by mhickson on 2/15/15.
*/
@Entity
@Table(name = "DEPARTMENTUSER", schema = "COOPEVAL_OWNER")
public class DepartmentUser {
private long departmentUserId;
private String name;
private String userName;
private Timestamp createDate;
private String createBy;
private Timestamp modDate;
private String modBy;
private Collection<DepartmentUserJoin> departmentUserJoinsByDepartmentUserId;
@Id
@Column(name = "DEPARTMENTUSERID", nullable = false, insertable = true, updatable = true, precision = 0)
@GeneratedValue(strategy = GenerationType.SEQUENCE,
generator = "departmentUserId_seq")
@SequenceGenerator(name = "departmentUserId_seq",
sequenceName = "SEQ_TDAI_DepartmentUser1", allocationSize = 1)
public long getDepartmentUserId() {
return departmentUserId;
}
public void setDepartmentUserId(long departmentUserId) {
this.departmentUserId = departmentUserId;
}
@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 = "USERNAME", nullable = true, insertable = true, updatable = true, length = 64)
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
@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;
}
DepartmentUser that = (DepartmentUser) o;
if (departmentUserId != that.departmentUserId) {
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;
}
if (userName != null ? !userName.equals(that.userName) : that.userName != null) {
return false;
}
return true;
}
@Override
public int hashCode() {
int result = (int) (departmentUserId ^ (departmentUserId >>> 32));
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (userName != null ? userName.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;
}
public void setDepartmentUserJoinsByDepartmentUserId(
Collection<DepartmentUserJoin> departmentUserJoinsByDepartmentUserId) {
this.departmentUserJoinsByDepartmentUserId = departmentUserJoinsByDepartmentUserId;
}
}