hibernate环境搭建(二)——映射框架配置
- <?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;
- }
- }
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。