前端之家收集整理的这篇文章主要介绍了
.hbm.xml示例,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
<?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.you.vote.domain.Admin" table="admin" catalog="vote">
<!-- 表admin主键的设置 -->
<id name="adminId" type="java.lang.Integer">
<column name="admin_id"/>
<generator class="native"/>
</id>
<!-- 表admin字段name与属性name的映射关系 -->
<property name="name" type="java.lang.String">
<column name="name" length="50"/>
</property>
<!-- 表admin字段password与属性password的映射关系 -->
<property name="password" type="java.lang.String">
<column name="password" length="50"/>
</property>
<!-- 表admin字段logintime与属性logintime的映射关系 -->
<property name="logintime" type="java.lang.String">
<column name="logintime" length="50"></column>
</property>
</class>
</hibernate-mapping>