开发者社区> 我是温浩然> 正文
阿里云
为了无法计算的价值
打开APP
阿里云APP内打开

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.CrmCor
+关注继续查看

以前没有用过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 ,类名,运行成功

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
macOS下 Hive 2.x 的安装与配置
macOS下 Hive 2.x 的安装与配置
92 0
NDK OpenGL ES 3.0 开发(十三):实例化(Instancing)
OpenGL ES 实例化(Instancing)是一种只调用一次渲染函数就能绘制出很多物体的技术,可以实现将数据一次性发送给 GPU ,告诉 OpenGL ES 使用一个绘制函数,将这些数据绘制成多个物体。
190 0
DK OpenGL ES 3.0 开发(十):深度测试
OpenGL 深度测试是指在片段着色器执行之后,利用深度缓冲所保存的深度值决定当前片段是否被丢弃的过程。
217 0
macOS下 Hive 2.x 的安装与配置
Hive是基于Hadoop的一个数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供简单的[SQL]查询功能,可以将SQL语句转换为MapReduce任务进行运行。其优点是学习成本低,可以通过类SQL语句快速实现简单的MapReduce统计,不必开发专门的MapReduce应用,十分适合数据仓库的统计分析。
3296 0
Hibernate5.x Eclipse搭建
今天写一个简单的hibernate框架搭建流程 首先准备好我们的jar包,这里附上一个jar包链接 hibernate下载 下载完jar后新建一个简单的java工程,结构如下 项目结构 接下来编写我们的hibernate的配置文件hibernate.
1221 0
《OpenGL ES 3.x游戏开发(下卷)》一导读
随着智能手机硬件性能的不断提升,如“水果忍者”“极品飞车”“狂野飙车8:极速凌云”等一批优秀的3D游戏娱乐应用在广大智能机用户间流行开来。与此同时,也带动了手机游戏产业逐渐从2D走向3D。但目前国内专门介绍3D游戏开发的书籍与资料都非常少,同时3D应用开发的门槛又比较高,使得很多初学者无从下手。
1699 0
Hibernate,Ibatis,Jdbc 区别
Hibernate属于全自动, Ibatis属于半自动,Jdbc属于手动,从开发效率上讲hibernate较高,ibatis居中,jdbc较低,从执行效率上讲hibernate较低,ibatis居中,jdbc较高,因为jdbc是手工写sql语句,程序员对sql的控制能力更大,可以根据业务需要进行优化,而ibatis虽然也可以对sql进行优化,但是他里面将resultset封装为实体的过程中
1050 0
+关注
我是温浩然
今天的菜鸟,未来的大牛
文章
问答
文章排行榜
最热
最新
相关电子书
更多
低代码开发师(初级)实战教程
立即下载
阿里巴巴DevOps 最佳实践手册
立即下载
冬季实战营第三期:MySQL数据库进阶实战
立即下载