2 hahagaobin hahagaobin 于 2015.07.02 10:26 提问

JAVA ibatis的问题 在线急等


select *
from (select xsxkb.*,
to_char(SUBSTR(xsxkb.XNXQ, 6, 4) - xxb.DQSZJ),
to_char((SUBSTR(xsxkb.XNXQ, 6, 4) - xxb.DQSZJ) *
(SUBSTR(xsxkb.XNXQ, 6, 4) - xxb.DQSZJ) *
(xsxfyq.YQXF - nvl(xsxfyq.HDXF, 0) - nvl(xsxfyq.BXQWHDXF, 0) -
nvl(XXQXKXF, 0))) as qz from
$xsxkb$ xsxkb ,JWXT.XK_XSXFYQ xsxfyq , jwxt.xj_xxb xxb

    where xsxkb.xkzt = '0' and xsxkb.zt='1'

    and xsxkb.xh = xsxfyq.xh

    and xxb.xh =  xsxkb.xh

    and  xsxfyq.ZT =1 

    and xsxfyq.kcxz = (select  jxrw.kcxz from jwxt.jw_jxrwb jxrw where jxrw.rwkey=#rwkey#)

    and xsxkb.rwkey = #rwkey#

    and ((xsxkb.nj in (select hbb.nj from jwxt.jw_hbb hbb where rwkey = #rwkey#)

    and (select xxb.zydm from jwxt.xj_xxb xxb where xxb.xh = xsxkb.xh)

     in (select hbb.zydm from jwxt.jw_hbb hbb where rwkey = #rwkey#))

     or jwxt.xk_is_zykc(#rwkey#,

                           xsxkb.xh,

                           (select xxb.zydm

                              from jwxt.xj_xxb xxb

                             where xxb.xh = xsxkb.xh)) = 1

     )
     order by  qz 
     )

</select>


拿出来
--------------------sql map 如上  
输出sql 是绝对可以查询出来的

报错如下 


2015-07-02 10:26:43,315 [Thread-18] INFO - SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]

org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];

--- The error occurred in sqlmap/common/JWXT_XJ_XXB_SqlMap.xml.

--- The error occurred while applying a result map.

--- Check the JWXT_XJ_XXB.getfkzyqz-AutoResultMap.

--- Check the result mapping for the 'QZ' property.

--- Cause: com.ibatis.common.beans.ProbeException: There is no WRITEABLE property named 'XNXQ,6,4)-XXB' in class 'java.lang.Object'; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:

--- The error occurred in sqlmap/common/JWXT_XJ_XXB_SqlMap.xml.

--- The error occurred while applying a result map.

--- Check the JWXT_XJ_XXB.getfkzyqz-AutoResultMap.

--- Check the result mapping for the 'QZ' property.

--- Cause: com.ibatis.common.beans.ProbeException: There is no WRITEABLE property named 'XNXQ,6,4)-XXB' in class 'java.lang.Object'
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:196)
at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:219)
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:266)
at com.zk.dao.common.XjXxbDAOImpl.blxkbzyxsXxs(XjXxbDAOImpl.java:228)
at com.zk.business.common.impl.CommonBusinessImpl$2.run(CommonBusinessImpl.java:1740)
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:

--- The error occurred in sqlmap/common/JWXT_XJ_XXB_SqlMap.xml.

--- The error occurred while applying a result map.

--- Check the JWXT_XJ_XXB.getfkzyqz-AutoResultMap.

--- Check the result mapping for the 'QZ' property.

--- Cause: com.ibatis.common.beans.ProbeException: There is no WRITEABLE property named 'XNXQ,6,4)-XXB' in class 'java.lang.Object'
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:615)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
at org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:268)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:193)
... 4 more
Caused by: com.ibatis.common.beans.ProbeException: There is no WRITEABLE property named 'XNXQ,6,4)-XXB' in class 'java.lang.Object'
at com.ibatis.common.beans.ClassInfo.getSetterType(ClassInfo.java:273)
at com.ibatis.common.beans.ComplexBeanProbe.getPropertyTypeForSetter(ComplexBeanProbe.java:91)
at com.ibatis.common.beans.ComplexBeanProbe.setObject(ComplexBeanProbe.java:216)
at com.ibatis.common.beans.GenericProbe.setObject(GenericProbe.java:90)
at com.ibatis.sqlmap.engine.exchange.ComplexDataExchange.setData(ComplexDataExchange.java:87)
at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setResultObjectValues(BasicResultMap.java:373)
at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:64)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:382)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:301)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:190)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
... 10 more

2个回答

strutce
strutce   Ds   Rxr 2015.07.02 10:43

应该是取别名的字段拿来当字段参数,也要写到resultMap里吧

hahagaobin
hahagaobin   2015.07.02 10:50

怎么写到 resultMap ? 我记得不用写吧 我之前都是直接这样都可以

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
ASP.NET,急,急,急,在线等
以前从没做过音频的下载,如今公司把活派到了我头上,头大呀,哪位大虾出手相助,感激不尽。ASP.NET+C#,数据库为Sql Server2000.
C#课余测验
课余训练 在线等 急急急``````
xml 查询问题
xml 查询问题 急xml 查询问题 急xml 查询问题 急xml 查询问题 急xml 查询问题 急xml 查询问题 急xml 查询问题 急xml 查询问题 急xml 查询问题 急xml 查询问题 急xml 查询问题 急xml 查询问题 急xml 查询问题 急xml 查询问题 急xml 查询问题 急
在线等。 急~
-
字符串转16进制的问题。在线等。急
public static final String bytesToHexString(byte[] bArray) {       StringBuffer sb = new StringBuffer(bArray.length);       String sTemp;       for (int i = 0; i     sTemp = Integer.toHexString(0
页面后退的问题---在线急等
我遇到的问题是这样的:我用的浏览器是IE6页面a中点击进入页面b,页面b中有一个浮动桢(iframe)页面c,页面c执行完毕后自动转向页面d,这时候我知道我的history集合中有了两个记录a,c,并且页面c会处于栈顶。现在问题来了,我想点击工具栏“后退”进入页面a,但是必须点击2下,而且两次点击时间间隔还必须特别小。但我只想通过1次点击返回页面a。手册上写的history是无法通过代码强行改变的
EXT的 new Ext.XTemplate问题,急,在线等!
var tpl = new Ext.XTemplate(     'for=".">',         '', 'class="{[(values.mrEnv != "" && values.mrSupport != "" ||                      (values.mrGSMs.length > 0 || values.mrTDs.length > 0 || valu
ViewPager中的焦点问题,急,在线等
我写了一个自定义的View。这个自定义的view中实现了OnTouchEvent的方法。并且在OnTouchEvent的方法中return true;这个方法中监听的是手指在View上左右滑的过程。 我把这个自定义的控件放到ViewPager中,因为ViewPager本身就有左右滑动的功能。 现在的情况是,我的view控件监听左右滑,只能监听很短的一段距离,再继续左右滑,焦点就被viewpag
SpringMVC+Ibatis框架搭建
这是一个很简单的SpringMVC+Spring+Ibatis框架 ,下图是文件的基本配置 web.xml
Hibernate懒加载急加载我们需要注意的问题
1、显而易见的概念懒加载——也被称为延迟加载,它在查询的时候不会立刻访问数据库,而是返回代理对象,当真正去使用对象的时候才会访问数据库。急加载——就是只要我们实体做了关联,全部一次性执行完所有的SQL语句2、@OneToMany ****默认为懒加载**** @Test public void find(){ Session s= sessionFactory.