hibernate3报错 XXX is not mapped

以前没有用过hibernate,配置hql时出错。

错误日志如下:

org.springframework.orm.hibernate3.HibernateQueryException: crm_person is not mapped [select a.id, (select z.corp.shortName from cn.digitalpublishing.po.CrmCorpTypeRelationship z where z.id = a.department), a.code, a.contractType, a.name, a.createOn, (select z.name from crm_person z where z.id = (SELECT x.person.id from cn.digitalpublishing.po.CrmPersonTypeRelationship x where x.id = a.createBy)), a.dateBegin, a.dateEnd, a.otherInfo, a.remark, a.approveStatus from cn.digitalpublishing.po.CrRightQt a]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: crm_person is not mapped [select a.id, (select z.corp.shortName from cn.digitalpublishing.po.CrmCorpTypeRelationship z where z.id = a.department), a.code, a.contractType, a.name, a.createOn, (select z.name from crm_person z where z.id = (SELECT x.person.id from cn.digitalpublishing.po.CrmPersonTypeRelationship x where x.id = a.createBy)), a.dateBegin, a.dateEnd, a.otherInfo, a.remark, a.approveStatus from cn.digitalpublishing.po.CrRightQt a]
	at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:656)
	at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
	at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343)
	at cn.com.daxtech.framework.orm.hibernate3.dao.impl.HibernateDAOImpl.getListByHql(HibernateDAOImpl.java:288)
	at cn.digitalpublishing.dao.CrRightQtDao.getPagingList(CrRightQtDao.java:15)
	at cn.digitalpublishing.service.impl.CrRightQtServiceImpl.getPagingList(CrRightQtServiceImpl.java:79)
	at sun.reflect.GeneratedMethodAccessor459.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
	at com.sun.proxy.$Proxy415.getPagingList(Unknown Source)
	at cn.digitalpublishing.springmvc.controller.rightLicense.CrRightQtController.manager(CrRightQtController.java:85)
	at sun.reflect.GeneratedMethodAccessor457.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at cn.digitalpublishing.filter.LanguageFilter.doFilter(LanguageFilter.java:30)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at cn.com.daxtech.framework.web.filter.sso.PermissionFilter.doFilter(PermissionFilter.java:162)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.hibernate.hql.ast.QuerySyntaxException: crm_person is not mapped [select a.id, (select z.corp.shortName from cn.digitalpublishing.po.CrmCorpTypeRelationship z where z.id = a.department), a.code, a.contractType, a.name, a.createOn, (select z.name from crm_person z where z.id = (SELECT x.person.id from cn.digitalpublishing.po.CrmPersonTypeRelationship x where x.id = a.createBy)), a.dateBegin, a.dateEnd, a.otherInfo, a.remark, a.approveStatus from cn.digitalpublishing.po.CrRightQt a]
	at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:180)
	at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:111)
	at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:93)
	at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:327)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3441)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3325)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:733)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:584)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExpr(HqlSqlBaseWalker.java:2321)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExprList(HqlSqlBaseWalker.java:2121)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectClause(HqlSqlBaseWalker.java:1522)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:593)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:301)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:244)
	at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:256)
	at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:187)
	at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:138)
	at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
	at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
	at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124)
	at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
	at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
	at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1770)
	at sun.reflect.GeneratedMethodAccessor285.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1282)
	at com.sun.proxy.$Proxy7.createQuery(Unknown Source)
	at cn.com.daxtech.framework.orm.hibernate3.dao.impl.HibernateDAOImpl$7.doInHibernate(HibernateDAOImpl.java:290)
	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
	... 57 more
cn.com.daxtech.framework.exception.CcsException: org.springframework.orm.hibernate3.HibernateQueryException: crm_person is not mapped [select a.id, (select z.corp.shortName from cn.digitalpublishing.po.CrmCorpTypeRelationship z where z.id = a.department), a.code, a.contractType, a.name, a.createOn, (select z.name from crm_person z where z.id = (SELECT x.person.id from cn.digitalpublishing.po.CrmPersonTypeRelationship x where x.id = a.createBy)), a.dateBegin, a.dateEnd, a.otherInfo, a.remark, a.approveStatus from cn.digitalpublishing.po.CrRightQt a]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: crm_person is not mapped [select a.id, (select z.corp.shortName from cn.digitalpublishing.po.CrmCorpTypeRelationship z where z.id = a.department), a.code, a.contractType, a.name, a.createOn, (select z.name from crm_person z where z.id = (SELECT x.person.id from cn.digitalpublishing.po.CrmPersonTypeRelationship x where x.id = a.createBy)), a.dateBegin, a.dateEnd, a.otherInfo, a.remark, a.approveStatus from cn.digitalpublishing.po.CrRightQt a]
	at cn.digitalpublishing.service.impl.CrRightQtServiceImpl.getPagingList(CrRightQtServiceImpl.java:81)
	at sun.reflect.GeneratedMethodAccessor459.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
	at com.sun.proxy.$Proxy415.getPagingList(Unknown Source)
	at cn.digitalpublishing.springmvc.controller.rightLicense.CrRightQtController.manager(CrRightQtController.java:85)
	at sun.reflect.GeneratedMethodAccessor457.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at cn.digitalpublishing.filter.LanguageFilter.doFilter(LanguageFilter.java:30)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at cn.com.daxtech.framework.web.filter.sso.PermissionFilter.doFilter(PermissionFilter.java:162)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.orm.hibernate3.HibernateQueryException: crm_person is not mapped [select a.id, (select z.corp.shortName from cn.digitalpublishing.po.CrmCorpTypeRelationship z where z.id = a.department), a.code, a.contractType, a.name, a.createOn, (select z.name from crm_person z where z.id = (SELECT x.person.id from cn.digitalpublishing.po.CrmPersonTypeRelationship x where x.id = a.createBy)), a.dateBegin, a.dateEnd, a.otherInfo, a.remark, a.approveStatus from cn.digitalpublishing.po.CrRightQt a]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: crm_person is not mapped [select a.id, (select z.corp.shortName from cn.digitalpublishing.po.CrmCorpTypeRelationship z where z.id = a.department), a.code, a.contractType, a.name, a.createOn, (select z.name from crm_person z where z.id = (SELECT x.person.id from cn.digitalpublishing.po.CrmPersonTypeRelationship x where x.id = a.createBy)), a.dateBegin, a.dateEnd, a.otherInfo, a.remark, a.approveStatus from cn.digitalpublishing.po.CrRightQt a]
	at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:656)
	at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
	at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343)
	at cn.com.daxtech.framework.orm.hibernate3.dao.impl.HibernateDAOImpl.getListByHql(HibernateDAOImpl.java:288)
	at cn.digitalpublishing.dao.CrRightQtDao.getPagingList(CrRightQtDao.java:15)
	at cn.digitalpublishing.service.impl.CrRightQtServiceImpl.getPagingList(CrRightQtServiceImpl.java:79)
	... 53 more
Caused by: org.hibernate.hql.ast.QuerySyntaxException: crm_person is not mapped [select a.id, (select z.corp.shortName from cn.digitalpublishing.po.CrmCorpTypeRelationship z where z.id = a.department), a.code, a.contractType, a.name, a.createOn, (select z.name from crm_person z where z.id = (SELECT x.person.id from cn.digitalpublishing.po.CrmPersonTypeRelationship x where x.id = a.createBy)), a.dateBegin, a.dateEnd, a.otherInfo, a.remark, a.approveStatus from cn.digitalpublishing.po.CrRightQt a]
	at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:180)
	at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:111)
	at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:93)
	at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:327)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3441)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3325)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:733)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:584)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExpr(HqlSqlBaseWalker.java:2321)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExprList(HqlSqlBaseWalker.java:2121)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectClause(HqlSqlBaseWalker.java:1522)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:593)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:301)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:244)
	at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:256)
	at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:187)
	at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:138)
	at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
	at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
	at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124)
	at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
	at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
	at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1770)
	at sun.reflect.GeneratedMethodAccessor285.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1282)
	at com.sun.proxy.$Proxy7.createQuery(Unknown Source)
	at cn.com.daxtech.framework.orm.hibernate3.dao.impl.HibernateDAOImpl$7.doInHibernate(HibernateDAOImpl.java:290)
	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
	... 57 more

日志很多,挑重点看,crm_person is not mapped 

</pre></p><p>还有,在错误中,还有这样一句话。.</p><p>select a.id, (select z.corp.shortName from cn.digitalpublishing.po.CrmCorpTypeRelationship z where z.id = a.department), a.code, </p><p>和</p><p>(select z.name from crm_person z where z.id = (SELECT x.person.id from cn.digitalpublishing.po.CrmPersonTypeRelationship x where x.id = a.createBy)),</p><p></p><p>从这两句,我感觉到,应该是找不到 我写的crm_person .</p><p> 我的sql语句是从sql中直接复制的,</p><p>XML配置文件,如下:</p><p><pre name="code" class="html"><query>
			<id>getPagingList</id>
			<method>getPagingList</method>
			<params>
				<param name="condition" type="java.util.Map"></param>
				<param name="sort" type="java.lang.String"></param>
			</params>
			<properties>id, department, code, contractType, name, createOn, createBy, dateBegin, dateEnd, otherInfo, remark, approveStatus</properties>
			<fields>a.id, (select z.corp.shortName from CrmCorpTypeRelationship z where z.id = a.department), a.code, a.contractType, a.name, a.createOn, (select z.name from crm_person z where z.id = (SELECT x.person.id from CrmPersonTypeRelationship x where x.id = a.createBy)), a.dateBegin, a.dateEnd, a.otherInfo, a.remark, a.approveStatus</fields>
			<hql>from CrRightQt a</hql>
			<conditions>
				<condition id="id" discribe="ID">
					<params type="param">
						<param name="id" type="java.lang.String" />
					</params>
					<hql>a.id = ?</hql>
				</condition>
				<condition id="department" discribe="部门">
					<params type="param">
						<param name="department" type="java.lang.String" />
					</params>
					<hql>a.department like ?</hql>
				</condition>
				<condition id="code" discribe="合同编号">
					<params type="param">
						<param name="code" type="java.lang.String" />
					</params>
					<hql>a.code like ?</hql>
				</condition>
				<condition id="contractType" discribe="合同类型">
					<params type="param">
						<param name="contractType" type="java.lang.String" />
					</params>
					<hql>a.contractType like ?</hql>
				</condition>
				<condition id="name" discribe="合同名称">
					<params type="param">
						<param name="name" type="java.lang.String" />
					</params>
					<hql>a.name like ?</hql>
				</condition>
				<condition id="createBy" discribe="创建人">
					<params type="param">
						<param name="createBy" type="java.lang.String" />
					</params>
					<hql>a.createBy like ?</hql>
				</condition>
				<condition id="otherInfo" discribe="第三方信息">
					<params type="param">
						<param name="otherInfo" type="java.lang.String" />
					</params>
					<hql>a.otherInfo like ?</hql>
				</condition>
				<condition id="remark" discribe="备注">
					<params type="param">
						<param name="remark" type="java.lang.String" />
					</params>
					<hql>a.remark like ?</hql>
				</condition>
				<condition id="approveStatus" discribe="审批状态">
					<params type="param">
						<param name="approveStatus" type="java.lang.String" />
					</params>
					<hql>a.approveStatus like ?</hql>
				</condition>
			</conditions>
			<group></group>
			<order></order>
			<className>cn.digitalpublishing.po.CrRightQt</className>
		</query>

看重点,如下:

<fields>a.id, (select z.corp.shortName from CrmCorpTypeRelationship z where z.id = a.department), a.code, a.contractType, a.name, a.createOn, (select z.name from crm_person z where z.id = (SELECT x.person.id from CrmPersonTypeRelationship x where x.id =
a.createBy)), a.dateBegin, a.dateEnd, a.otherInfo, a.remark, a.approveStatus</fields>

hql,识别 类名,但是,不识别表名,所以报错  is not mapped,

修改crm_person 为CrmPerson ,类名,运行成功

时间: 2024-10-28 04:42:00

hibernate3报错 XXX is not mapped的相关文章

[J2MEQ&amp;A]WTK初始化WMAClient报错XXX has no IP address的解释

[J2ME]WTK初始化WMAClient报错XXX has no IP address的解释   [现象] 当通过WTK运行一个J2ME程序时,KToolbar显示这样的错误: 错误形态一 WMAClient: localhost has no IP address: java.net.UnknownHostException: xxxx: xxxx Warning: Failed to initialize WMA message routing support ClientConnecto

spring cglib报错 xxx cannot be cast to xxx

问题描述 1,想使用ehcache+springjdbc实现查询结果缓存,现在功能都实现了,但是使用时报错:java.lang.ClassCastException:com.hbzx.bean.ShopViewCountBeancannotbecasttojava.util.Listatcom.hbzx.dao.ShopViewCountDao$$EnhancerBySpringCGLIB$$1c70ff76.queryAll(<generated>)atcom.hbzx.service.Sh

Linux 日志报错 xxx blocked for more than 120 seconds

        监控作业发现一台服务器(Red Hat Enterprise Linux Server release 5.7)从凌晨1:32开始,有一小段时间无法响应,数据库也连接不上,后面又正常了.早上检查了监听日志,并没有发现错误信息.但是检查告警日志,发现有下面错误信息: Thread 1 advanced to log sequence 19749 (LGWR switch)   Current log# 2 seq# 19749 mem# 0: /u01/oradata/epps/r

eclipse报错 eclipse启动报错解决方法_java

报错之一: Version 1.4.2_03 of the JVM not suitable for this product.Version1.5 or geeater is required 大概意思好像说我的JVM虚拟机的环境 1.4版本过低,让我用1.5版本以上的,很疑惑...我安装的jdk是1.7的. 不过jvm是; C:\Documents and Settings\Administrator>java -version java version "1.7.0_07"

java ssh-no action mapped问题 tomcat运行报错

问题描述 no action mapped问题 tomcat运行报错 运行tomcat时没报错 我打了http://localhost:8080/xxpt/index.action后是404未找到 错误如下 09-29 10:07:52 WARN o.a.struts2.dispatcher.Dispatcher - Could not find action or result com.opensymphony.xwork2.config.ConfigurationException: The

tomcat-inputStream解析url报错:UnKnownHostException:xxx.com

问题描述 inputStream解析url报错:UnKnownHostException:xxx.com 原文已发布在android论坛,但是没人回应,悬赏了100没人理我. 原文链接:http://bbs.csdn.net/topics/390566835?page=1#post-395413355 程序很简单: main里: String urlString = "http://ftp121455.host181.web522.com/daoyutwo.txt"; InputStr

springmvc java shiro-shiro报错There is no session with id [xxx]

问题描述 shiro报错There is no session with id [xxx] [2015-03-04 08:17:15.152 INFO ] - [SysBaseLoginController.java:48] :LoginPage running...... 三月 04, 2015 8:17:15 上午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [a

【Spring实战】—— 12 AspectJ报错:error at ::0 can&#039;t find referenced pointcut XXX

今天在使用AspectJ进行注解切面时,遇到了一个错误. 切点表达式就是无法识别--详细报错信息如下: Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xingoo' defined in class path resource [bean.xml]: Initialization of bean fail

mvc+ef,更新数据时 报错 “attaching an entity of type xxx failed”

问题描述 publicstringAdd_Edit(Articleart,string[]menuIds,stringarticleTagses){//....if(art.ArticleId>0){dbContext.Entry(article).State=EntityState.Modified;a=dbContext.SaveChanges();UpdateArticleMenu_Tags(article.ArticleId,menuIds,articleTagses);}//....}