Hibernate-hibernate里面设置了多对一关系,类的配置文件也没有错,运用连接查询出现类没有被映射的错误。
一
<?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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
<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>