/*
* Copyright (c) JForum Team. All rights reserved.
*
* The software in this package is published under the terms of the LGPL
* license a copy of which has been included with this distribution in the
* license.txt file.
*
* The JForum Project
* http://www.jforum.net
*/
package net.jforum.entities;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import br.com.caelum.vraptor.ioc.Component;
import br.com.caelum.vraptor.ioc.PrototypeScoped;
/**
* @author Rafael Steil
*/
@Entity
@Table(name = "jforum_smilies")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Component
@PrototypeScoped
public class Smilie implements Serializable {
@Id
@SequenceGenerator(name = "sequence", sequenceName = "jforum_smilies_seq")
@GeneratedValue(strategy = GenerationType.AUTO, generator = "sequence")
@Column(name = "smilie_id")
private int id;
@Column(name = "code")
private String code;
@Column(name = "disk_name")
private String diskName;
/**
* @return
*/
public String getCode() {
return this.code;
}
/**
* @param code
*/
public void setCode(String code) {
this.code = code;
}
/**
* @param diskName
*/
public void setDiskName(String diskName) {
this.diskName = diskName;
}
/**
* @return
*/
public int getId() {
return this.id;
}
/**
* @param id
*/
public void setId(int id) {
this.id = id;
}
/**
* @return
*/
public String getDiskName() {
return this.diskName;
}
/**
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return this.getId();
}
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof Smilie)) {
return false;
}
return ((Smilie)o).getId() == this.getId();
}
/**
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "[smilie=" + this.getCode() + ", id=" + this.getId() + "]";
}
}