package org.appfuse.model;

import java.sql.Timestamp;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * @hibernate.class table="entry"
 */
public class Entry {
    private Long entryId;
    private String text;
    private Timestamp timeCreated;
    
    /**
     * @hibernate.id column="entry_id" unsaved-value="null"
     *  generator-class="native"
     *               
     */
    public Long getEntryId() {
        return entryId;
    }

    public void setEntryId(Long entryId) {
        this.entryId = entryId;
    }
    
    /**
     * @hibernate.property column="entry_text"
     */
    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
    
    /**
     * @hibernate.property column="time_created"
     */
    public Timestamp getTimeCreated() {
        return timeCreated;
    }
    
    public void setTimeCreated(Timestamp timeCreated) {
        this.timeCreated = timeCreated;
    }
    
    public boolean equals(Object object) {
        if (!(object instanceof Entry)) {
            return false;
        }
        Entry rhs = (Entry) object;
        return new EqualsBuilder().append(this.text, rhs.text).append(
                this.timeCreated, rhs.timeCreated).isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder(-894939119, 821739003).append(this.text)
                .append(this.timeCreated).toHashCode();
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("entryId", this.entryId).append("text", this.text)
                .append("timeCreated", this.timeCreated).toString();
    }
}
