第二個文件Catjava
package hb;
public class Cat {
private String id;
private String name;
public Cat() {
}
public String getId() {
return id;
}
public void setId(String id) {
this
id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this
name = name;
}
public String toString() {
String strCat = new StringBuffer()
append(this
getId())
append(
)
append(this
getName())
append(
)
toString();
return strCat;
}
}
第三個文件Cathbmxml
<?xml version= ?>
<!DOCTYPE hibernatemapping (View Source for full doctype)>
<hibernatemapping defaultcascade=none defaultaccess=property autoimport=true]
<class name=hbCat table=cat mutable=true polymorphism=implicit dynamicupdate=false dynamicinsert=false batchsize= selectbeforeupdate=false optimisticlock=version]
<id name=id type=javalangString unsavedvalue=null]
<column name=CAT_ID sqltype=varchar() notnull=true]
<generator class=uuidhex]
</id>
<property name=name notnull=false unique=false update=true insert=true]
<column name=NAME sqltype=varchar() notnull=true]
</property>
</class>
</hibernatemapping>
[] [] [] []
From:http://tw.wingwit.com/Article/program/Java/ky/201311/29028.html