首页 > Web开发 > 详细

hibernate环境搭建(二)——映射框架配置

时间:2015-03-17 17:14:58      阅读:281      评论:0      收藏:0      [点我收藏+]
  1. <?xml version="1.0"?>  
  2. <!DOCTYPE hibernate-mapping PUBLIC   
  3.     "-//Hibernate/Hibernate Mapping DTD 3.0//EN"  
  4.     "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">  
  5. <hibernate-mapping>  
  6.     <class name="com.bjpowernode.hibernate.User">  
  7.         <id name="id">  
  8.             <generator class="uuid"/>  
  9.         </id>  
  10.         <property name="name"/>  
  11.         <property name="password"/>  
  12.         <property name="createTime"/>  
  13.         <property name="expireTime"/>  
  14.     </class>  
  15. </hibernate-mapping>  

持久化类

  1. package com.bjpowernode.hibernate;  
  2.   
  3. import java.util.Date;  
  4.   
  5. public class User {  
  6.   
  7.     private String id;  
  8.       
  9.     private String name;  
  10.       
  11.     private String password;  
  12.       
  13.     private Date createTime;  
  14.       
  15.     private Date expireTime;  
  16.   
  17.     public String getId() {  
  18.         return id;  
  19.     }  
  20.   
  21.     public void setId(String id) {  
  22.         this.id = id;  
  23.     }  
  24.   
  25.     public String getName() {  
  26.         return name;  
  27.     }  
  28.   
  29.     public void setName(String name) {  
  30.         this.name = name;  
  31.     }  
  32.   
  33.     public String getPassword() {  
  34.         return password;  
  35.     }  
  36.   
  37.     public void setPassword(String password) {  
  38.         this.password = password;  
  39.     }  
  40.   
  41.     public Date getCreateTime() {  
  42.         return createTime;  
  43.     }  
  44.   
  45.     public void setCreateTime(Date createTime) {  
  46.         this.createTime = createTime;  
  47.     }  
  48.   
  49.     public Date getExpireTime() {  
  50.         return expireTime;  
  51.     }  
  52.   
  53.     public void setExpireTime(Date expireTime) {  
  54.         this.expireTime = expireTime;  
  55.     }  
  56. }  

hibernate环境搭建(二)——映射框架配置

原文:http://www.cnblogs.com/lingzhishitu/p/4344559.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!