永发信息网

org.hibernate.MappingException:异常错误

答案:1  悬赏:70  手机版
解决时间 2021-07-29 09:38

CstService.hbm.xml的代码:

<?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>
<class name="com.crm.entity.CstService" table="cst_service" schema="dbo" catalog="jb_crm_team0">
<id name="svrId" type="java.lang.Long">
<column name="svr_id" />
<generator class="identity" />
</id>
<many-to-one name="cstCustomer" class="com.crm.entity.CstCustomer" fetch="select">
<column name="svr_cust_no" length="17" />
</many-to-one>
<many-to-one name="sysUser" class="com.crm.entity.SysUser" fetch="select">
<column name="svr_create_id" not-null="true" />
</many-to-one>
<property name="svrType" type="java.lang.String">
<column name="svr_type" length="20" not-null="true" />
</property>
<property name="svrTitle" type="java.lang.String">
<column name="svr_title" length="500" not-null="true" />
</property>
<property name="svrCustName" type="java.lang.String">
<column name="svr_cust_name" length="100" not-null="true" />
</property>
<property name="svrStatus" type="java.lang.String">
<column name="svr_status" length="10" not-null="true" />
</property>
<property name="svrRequest" type="java.lang.String">
<column name="svr_request" length="3000" not-null="true" />
</property>
<property name="svrCreateBy" type="java.lang.String">
<column name="svr_create_by" length="50" not-null="true" />
</property>
<property name="svrCreateDate" type="java.util.Date">
<column name="svr_create_date" length="23" not-null="true" />
</property>
<property name="svrDueId" type="java.lang.Long">
<column name="svr_due_id" />
</property>
<property name="svrDueTo" type="java.lang.String">
<column name="svr_due_to" length="50" />
</property>
<property name="svrDueDate" type="java.util.Date">
<column name="svr_due_date" length="23" />
</property>
<property name="svrDeal" type="java.lang.String">
<column name="svr_deal" length="3000" />
</property>
<property name="svrDealId" type="java.lang.Long">
<column name="svr_deal_id" />
</property>
<property name="svrDealBy" type="java.lang.String">
<column name="svr_deal_by" length="50" />
</property>
<property name="svrDealDate" type="java.util.Date">
<column name="svr_deal_date" length="23" />
</property>
<property name="svrResult" type="java.lang.String">
<column name="svr_result" length="500" />
</property>
<property name="svrSatisfy" type="java.lang.Integer">
<column name="svr_satisfy" />
</property>
</class>
</hibernate-mapping>


hibernate.cfg.xml的代码如下:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
" http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password">xiaotingzi</property>
<property name="hibernate.connection.url">
jdbc:sqlserver://localhost\\sqlexpress:8888;databaseName=jb_crm_team0_Data
</property>
<property name="dialect">
org.hibernate.dialect.SQLServerDialect
</property>
<property name="myeclipse.connection.profile">crmDriver</property>
<property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="show_sql">true</property>

<mapping resource="com/crm/entity/SysUser.hbm.xml"/>
<mapping resource="com/crm/entity/SysRole.hbm.xml"/>
<mapping resource="com/crm/entity/CstActivity.hbm.xml"/>
<mapping resource="com/crm/entity/CstService.hbm.xml"/>
<mapping resource="com/crm/entity/CstLinkman.hbm.xml"/>
<mapping resource="com/crm/entity/CstCustomer.hbm.xml"/>
<mapping resource="com/crm/entity/SalChance.hbm.xml"/>
<mapping resource="com/crm/entity/SysRoleRight.hbm.xml"/>
</session-factory>
</hibernate-configuration>

测试类的代码如下:

package com.crm.test;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.crm.entity.SysUser;
import com.crm.inf.SysUserDAO;

public class Test {
public static void main(String[] orgs){
ApplicationContext act=new ClassPathXmlApplicationContext("applicationContext.xml");
}
}

异常如下:

Caused by: org.hibernate.MappingException: Association references unmapped class: CstService

请高手指点迷津

最佳答案
<class name="com.crm.entity.CstService" table="cst_service" schema="dbo" catalog="jb_crm_team0">
CstService 这个类有问题
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
魔兽世界什么职业PK爽?要LM的,听说战场能秒
封神记有具体公册时间了么?谁有激活码?
手机上的密保令牌是干什么的?
原来是美男啊15,16集剧情是什么啊
激昂雄浑的意思,雄浑激昂是表示动作、心情、
兰考县开封城关乡金营小学地址有谁知道?有点
取名字 ????
2010年我们两人的本命年,适合结婚吗?
9.6米前四后把解放高栏货车25吨的户总质量不
吉首市湘西韵达快运地址在什么地方,想今天过
山行这首诗其中一句是白云生处有人家,还是白
美国是个说明样的国家?
如何解除三星F278Ijava限制
帮我看这段代码!
高中生上网有益有害?
推荐资讯
洪江市怀化新城商务宾馆地址在哪,我要去那里
脾虚,消化不良,肠胃不好者该怎样进补?有哪
2010款奥迪A4一点八T和宝马318谁好
DNF40狂战去那单刷能最快生到50?
AVA怎么激活?
南京LGDisplay怎么样?
超级QQ:我的超级qq现在是十块钱一个月的,我
沙市区荆州无限极萃雅中草药养生馆这个地址在
涧西区洛阳郑州路华源社区社区卫生服务站地址
PT 和TG 对什么装备依赖大呢? 最好带什么特
评说韩愈的古文理论及创造实绩。
寻一部单机游戏
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?