KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > instancepersistence > HibernateResource


1 /*
2  * Shark Hibernate persistent layer - Open Wide
3  */

4
5 package org.enhydra.shark.instancepersistence;
6
7
8 import org.enhydra.shark.api.internal.instancepersistence.ResourcePersistenceInterface;
9 import org.enhydra.shark.utilities.hibernate.HibernateGeneric;
10 import org.enhydra.shark.utilities.hibernate.HibernateObjectUtil;
11
12 /**
13  * Simple Hibernate POJO class
14  * @author Vladislav Pernin
15  */

16 public class HibernateResource extends HibernateObjectUtil implements ResourcePersistenceInterface,HibernateGeneric {
17
18    private String JavaDoc username;
19    private String JavaDoc name;
20    
21    private int dbId = -1;
22    
23    public int getDbId() {
24     return dbId;
25    }
26
27    public void setDbId(int dbId) {
28     this.dbId = dbId;
29    }
30    
31    public void setUsername (String JavaDoc un) {
32       this.username=un;
33    }
34
35    public String JavaDoc getUsername () {
36       return username;
37    }
38
39    public void setName (String JavaDoc newName) {
40       name=newName;
41    }
42
43    public String JavaDoc getName () {
44       return name;
45    }
46    
47    public String JavaDoc toString(){
48        StringBuffer JavaDoc strBuffer = new StringBuffer JavaDoc();
49        strBuffer.append("idDB = " + this.dbId + "\n");
50        strBuffer.append("username = " + this.getUsername() + "\n");
51        strBuffer.append("name = " + this.getName() + "\n");
52        return strBuffer.toString();
53         
54    }
55
56 }
Popular Tags