• 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. }  
  • 相关阅读:
    linux 压力测试工具之ab
    docker save load export import的区别
    手把手教你打造高效的 Kubernetes 命令行终端
    K8S 中的容器编排和应用编排
    linux mount一个目录到另外一个目录
    linux sed命令详解
    各种安全证书间的关系及相关操作
    Linux Shell/Bash wildcard通配符、元字符、转义符使用
    vim打开多个文件、同时显示多个文件、在文件之间切换
    吉他演奏中的速度与节拍
  • 原文地址:https://www.cnblogs.com/lingzhishitu/p/4344559.html
Copyright © 2020-2023  润新知