KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > clipbuilder > sql > database > hibernate > model > BaseObject


1 package org.jahia.clipbuilder.sql.database.hibernate.model;
2
3 import java.io.Serializable JavaDoc;
4
5 import org.apache.commons.lang.builder.*;
6
7
8 /**
9  * Base class for Model objects. This is basically for the toString, equals
10  * and hashCode methods.
11  *
12  * @author Matt Raible
13  */

14 public class BaseObject implements Serializable JavaDoc {
15     private Long JavaDoc id;
16     public String JavaDoc toString() {
17         return ToStringBuilder.reflectionToString(this,ToStringStyle.MULTI_LINE_STYLE);
18     }
19
20     public boolean equals(Object JavaDoc o) {
21         return EqualsBuilder.reflectionEquals(this, o);
22     }
23
24     public int hashCode() {
25         return HashCodeBuilder.reflectionHashCode(this);
26     }
27
28     public Long JavaDoc getId() {
29         return id;
30     }
31
32     public void setId(Long JavaDoc id) {
33         this.id = id;
34     }
35 }
36
Popular Tags