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;
    private Long categoryId;
    private Category category;
    private Long weblogId;
	
	/**
	 * @return Returns the entryId.
	 * 
	 * @hibernate.id column="entry_id" generator-class="native"
     *               unsaved-value="null"
	 */
	public Long getEntryId() {
		return entryId;
	}
	/**
	 * @param entryId The entryId to set.
	 */
	public void setEntryId(Long entryId) {
		this.entryId = entryId;
	}
	/**
	 * @return Returns the text.
	 * 
	 * @hibernate.property column="entry_text"
	 */
	public String getText() {
		return text;
	}
	/**
	 * @param text The text to set.
	 */
	public void setText(String text) {
		this.text = text;
	}
	/**
	 * @return Returns the timeCreated.
	 * 
	 * @hibernate.property column="time_created"
	 */
	public Timestamp getTimeCreated() {
		return timeCreated;
	}
	/**
	 * @param timeCreated The timeCreated to set.
	 */
	public void setTimeCreated(Timestamp timeCreated) {
		this.timeCreated = timeCreated;
	}
	/**
	 * @return Returns the weblogId.
	 * 
	 * @hibernate.property column="weblog_id"
	 */
	public Long getWeblogId() {
		return weblogId;
	}
	/**
	 * @param weblogId The weblogId to set.
	 */
	public void setWeblogId(Long weblogId) {
		this.weblogId = weblogId;
	}
	/**
	 * @return Returns the category.
	 * 
	 * @hibernate.many-to-one insert="false" update="false" cascade="none" 
	 * 			column="category_id" outer-join="true"
	 */
	public Category getCategory() {
		return category;
	}
	/**
	 * @param category The category to set.
	 */
	public void setCategory(Category category) {
		this.category = category;
	}
	/**
	 * @return Returns the categoryId.
	 * 
	 * @hibernate.property column="category_id"
	 */
	public Long getCategoryId() {
		return categoryId;
	}
	/**
	 * @param categoryId The categoryId to set.
	 */
	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}
	/**
	 * @see java.lang.Object#equals(Object)
	 */
	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).append(this.weblogId,
				rhs.weblogId).append(this.category, rhs.category).append(
				this.entryId, rhs.entryId).append(this.categoryId,
				rhs.categoryId).isEquals();
	}
	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-894939119, 821739003).append(this.text)
				.append(this.timeCreated).append(this.weblogId).append(
						this.category).append(this.entryId).append(
						this.categoryId).toHashCode();
	}
	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
				.append("weblogId", this.weblogId).append("text", this.text)
				.append("entryId", this.entryId).append("categoryId",
						this.categoryId).append("category", this.category)
				.append("timeCreated", this.timeCreated).toString();
	}
}
