zoukankan      html  css  js  c++  java
  • hibernate环境搭建(二)——映射框架配置

    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. }  
  • 相关阅读:
    mysql函数基本使用
    django form 组件源码解析
    jwt
    python数据类型 ——bytes 和 bytearray
    汇编基础四 --函数调用与堆栈平衡
    汇编基础之三 -- 汇编指令
    汇编基础之二 -- 寄存器和内存堆栈
    汇编基础之一 -- 位运算和四则运算的实现
    存储过程中的设置语句含义
    (转载)SQL去除回车符,换行符,空格和水平制表符
  • 原文地址:https://www.cnblogs.com/lingzhishitu/p/4344559.html
Copyright © 2011-2022 走看看