qq_嫵钶取玳_0
2016-07-12 09:55
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 2016-7-11 11:54:54 by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
<class name="Student" table="STUDENT">
<id name="sid" type="int">
<column name="SID" />
<!--sid的属性初始值为0 -->
<!-- <generator class="assigned" /> -->
<!-- sid的属性值从1开始自动递增-->
<generator class="native"></generator>
</id>
<property name="sname" type="java.lang.String">
<column name="SNAME" />
</property>
<property name="gender" type="java.lang.String">
<column name="GENDER" />
</property>
<property name="birthday" type="java.util.Date">
<column name="BIRTHDAY" />
</property>
<property name="picture" type="java.sql.Blob">
<column name="PICTURE" />
</property>
<!-- <property name="address" type="java.lang.String">
<column name="ADDRESS" />
</property> -->
<component name="address" class="Address">
<property name="aid" column="AID"></property>
<property name="postcode" column="POSTCODE"></property>
<property name="phone" column="PHONE"></property>
<property name="address" column="ADDRESS"></property>
</component>
</class>
</hibernate-mapping>
<class name="Student" table="STUDENT"> 还不行这个也加上包名
<component name="address" class="Address">这个 class="包.Address"要加上包名,应该就可以了
我的是创建Address类时,忘记添加getter()和setter()方法了
你的问题解决没,我也是这个问题
开始的环境被配置好吧,你再看看一开始的那些配置怎么配置配置一下
再不行我就不知道了
Hibernate初探之单表映射
74810 学习 · 793 问题
相似问题