Hibernate-hibernate里面设置了多对一关系,类的配置文件也没有错,运用连接查询出现类没有被映射的错误。

发布于 2016-12-21 08:14:58 字数 5024 浏览 1320 评论 1


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping package="com.ticket.clientSystem.po">
<class name="Orderclient" table="Orderclient" catalog="isharp">
<id name="orderNum" type="java.lang.Integer">
<column name="orderNum" />
<generator class="native"></generator>
</id>
<property name="orderDate" type="java.lang.String">
<column name="orderDate" length="45" />
</property>
<property name="isPay" type="java.lang.String">
<column name="isPay" length="45" />
</property>
<property name="status" type="java.lang.String">
<column name="status" length="45" />
</property>
<property name="scheduleNo" type="java.lang.String">
<column name="scheduleNo" length="45" />
</property>
<property name="userId" type="java.lang.Integer">
<column name="userId" length="45" />
</property>
<property name="page" type="java.lang.Integer">
<column name="page" length="45" />
</property>

<many-to-one name="Schedule" class="com.ticket.clientSystem.po.Schedule"
column="scheduleNo"></many-to-one>

</class>
</hibernate-mapping>
二:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping package="com.ticket.operateSystem.po">
<class name="Schedule" table="schedule" catalog="isharp">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="native"></generator>
</id>
<property name="scheduleNo" type="java.lang.Integer">
<column name="SCHEDULE_NO" not-null="false" />
</property>
<property name="startTime" type="java.lang.String">
<column name="START_TIME" length="19" not-null="false" />
</property>
<property name="seatCount" type="java.lang.Integer">
<column name="SEAT_COUNT" not-null="false" />
</property>
<property name="vehicleType" type="java.lang.String">
<column name="VEHICLE_TYPE" length="45" not-null="false" />
</property>
<property name="scheduleType" type="java.lang.String">
<column name="SCHEDULE_TYPE" length="45" not-null="false" />
</property>
<property name="price" type="java.lang.Integer">
<column name="PRICE" not-null="false" />
</property>
<property name="govPrice" type="java.lang.Integer">
<column name="GOV_PRICE" not-null="false" />
</property>
<property name="halfPrice" type="java.lang.Integer">
<column name="HALF_PRICE" not-null="false" />
</property>
<property name="salableCount" type="java.lang.Integer">
<column name="SALABLE_COUNT" not-null="false" />
</property>
<property name="initCount" type="java.lang.Integer">
<column name="INIT_COUNT" not-null="false" />
</property>
<property name="middleSpot" type="java.lang.String">
<column name="MIDDLE_SPOT" length="45" not-null="false" />
</property>
<property name="externId" type="java.lang.Integer">
<column name="EXTERN_ID" not-null="false" />
</property>
<property name="TName" type="java.lang.String">
<column name="t_name" length="45" not-null="false" />
</property>
<property name="TSupplierName" type="java.lang.String">
<column name="t_supplier_name" length="45" not-null="false" />
</property>
</class>
</hibernate-mapping>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泛泛之交 2017-02-16 15:50:29

<many-to-one>配置错误:

<!-- imported bi-directional many-to-one association to AppUser -->
<many-to-one name="appUser" class="com.mk.oa.model.system.AppUser">
<column name="userId" />
</many-to-one>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文