AdministrationUser.java

/*
 * +====================================================================+
 * |         Copyright (C) 2015 Rochester Institute of Technology,      |
 * |            103 Lomb Memorial Drive, Rochester, NY - 14623          |
 * |                        All Rights Reserved.                        |
 * +====================================================================+
 *   FILENAME
 *    AdministrationUser.java
 *
 *   AUTHOR
 *    @author Khanh Ho (kchisd at rit.edu)
 *
 * =====================================================================
 */

package edu.rit.coopeval.model;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by mhickson on 2/15/15.
 */
@Entity
@Table(name = "ADMINISTRATIONUSER", schema = "COOPEVAL_OWNER")
public class AdministrationUser {

    private long administrationUserId;
    private String userName;
    private String name;
    private Timestamp createDate;
    private String createBy;
    private Timestamp modDate;
    private String modBy;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE,
                    generator = "administrationUserId_seq")
    @SequenceGenerator(name = "administrationUserId_seq",
                       sequenceName = "SEQ_TDAI_AdministrationUser0", allocationSize = 1)
    @Column(name = "ADMINISTRATIONUSERID", nullable = false, insertable = true, updatable = true, precision = 0)
    public long getAdministrationUserId() {
        return administrationUserId;
    }

    public void setAdministrationUserId(long administrationUserId) {
        this.administrationUserId = administrationUserId;
    }

    @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 = "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;
        }

        AdministrationUser that = (AdministrationUser) o;

        if (administrationUserId != that.administrationUserId) {
            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) (administrationUserId ^ (administrationUserId >>> 32));
        result = 31 * result + (userName != null ? userName.hashCode() : 0);
        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;
    }
}