UserAudit.java

package com.tradecloud.domain.useraudit;

import com.tradecloud.common.base.PersistenceBase;
import com.tradecloud.domain.model.useraudit.FieldName;
import com.tradecloud.domain.model.useraudit.FieldType;
import com.tradecloud.domain.model.useraudit.UserAuditSection;

import javax.persistence.*;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;

@Entity
@Access(AccessType.FIELD)
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "UserAudit")
@Table(name = "user_audit")
public class UserAudit extends PersistenceBase implements Serializable, Comparable<UserAudit> {

    @XmlAttribute
    private String reference;
    @XmlAttribute
    private String firstName;
    @XmlAttribute
    private String lastName;
    @XmlAttribute
    @Enumerated(EnumType.STRING)
    private FieldName fieldName;
    @XmlAttribute
    @Enumerated(EnumType.STRING)
    private UserAuditSection entitySection;
    @XmlAttribute
    private String fieldValue;
    @XmlAttribute
    @Enumerated(EnumType.STRING)
    private FieldType fieldType;
    @XmlAttribute
    @Enumerated(EnumType.STRING)
    private EventAction eventaction;
    private String customReference;
    private Long entityId;
    private boolean reviewed;

    public String getFieldValue() {
        return fieldValue;
    }

    public void setFieldValue(String fieldValue) {
        this.fieldValue = fieldValue;
    }

    public String getReference() {
        return reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public FieldName getFieldName() {
        return fieldName;
    }

    public void setFieldName(FieldName fieldName) {
        this.fieldName = fieldName;
    }

    public FieldType getFieldType() {
        return fieldType;
    }

    public void setFieldType(FieldType fieldType) {
        this.fieldType = fieldType;
    }

    public UserAuditSection getEntitySection() {
        return entitySection;
    }

    public void setEntitySection(UserAuditSection entitySection) {
        this.entitySection = entitySection;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public EventAction getEventaction() {
        return eventaction;
    }

    public void setEventaction(EventAction eventaction) {
        this.eventaction = eventaction;
    }

    public UserAudit() {
    }

    @Override
    public int compareTo(UserAudit o) {
        return getReference().compareToIgnoreCase(o.getReference());
    }

    public String getCustomReference() {
        return customReference;
    }

    public void setCustomReference(String customReference) {
        this.customReference = customReference;
    }

    public Long getEntityId() {
        return entityId;
    }

    public void setEntityId(Long entityId) {
        this.entityId = entityId;
    }

    public boolean isReviewed() {
        return reviewed;
    }

    public void setReviewed(boolean reviewed) {
        this.reviewed = reviewed;
    }
}