- <?xml version="1.0"?>
- <!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
- <hibernate-mapping>
- <class name="com.bjpowernode.hibernate.User">
- <id name="id">
- <generator class="uuid"/>
- </id>
- <property name="name"/>
- <property name="password"/>
- <property name="createTime"/>
- <property name="expireTime"/>
- </class>
- </hibernate-mapping>
持久化类
- package com.bjpowernode.hibernate;
- import java.util.Date;
- public class User {
- private String id;
- private String name;
- private String password;
- private Date createTime;
- private Date expireTime;
- 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 getPassword() {
- return password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- public Date getCreateTime() {
- return createTime;
- }
- public void setCreateTime(Date createTime) {
- this.createTime = createTime;
- }
- public Date getExpireTime() {
- return expireTime;
- }
- public void setExpireTime(Date expireTime) {
- this.expireTime = expireTime;
- }
- }