Hi all
iBatis reports the following exception trace
--- The error occurred in
it/finmatica/gpj/aa/frontedb/EspressioneFabbricaImpl.xml.
--- The error occurred while applying a result map.
--- Check the Gpj.mapEspressioneValoriTipoRigaMulti.
--- The error happened while setting a property on the result object.
--- Cause: com.ibatis.common.exception.NestedRuntimeException: Error
setting properties of
'[EMAIL PROTECTED]'. Cause:
java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error
setting properties of
'[EMAIL PROTECTED]'. Cause:
java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
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:610)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(
SqlMapExecutorDelegate.java:584)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(
SqlMapSessionImpl.java:101)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(
SqlMapClientImpl.java:78)
at
it.finmatica.gpj.ec.istruzioni.EspressioneFabbricaImpl.getOggettiImpl(
EspressioneFabbricaImpl.java:183)
at
it.finmatica.gpj.aa.frontedb.InitFogliaFabbricaImpl.getOggettiImpl(
InitFogliaFabbricaImpl.java:119)
at it.finmatica.gpj.aa.frontedb.InitFabbricaImpl.getOggetti(
InitFabbricaImpl.java:61)
at
it.finmatica.gpj.ec.istruzioni.EspressioneFabbricaImplTest.testGetOggetti(
EspressioneFabbricaImplTest.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:120)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
RemoteTestRunner.java:196)
...
Here is the Gpj.mapEspressioneValoriTipoRigaMulti map
<resultMap id="mapEspressioneValoriTipoRigaMulti"
class="it.finmatica.gpj.ec.istruzioni.EspressioneStruct">
<result property="id" column="VALORE_ID"
jdbcType="NUMERIC" javaType="int"/>
<result property="idIdentificatore"
select="Gpj.selectIdIdentificatore" column="FORMULA_ID" javaType="int"/>
<result property="idPeriodoNormativo"
select="Gpj.selectIdPeriodoNormativo" column="FORMULA_ID" javaType="int"/>
<result property="idTipo" select="Gpj.selectIdTipoCampo"
column="TIPO_RIGA_ID" javaType="int"/>
<result property="nome" select="Gpj.selectNomeCampo"
column="TIPO_RIGA_ID" javaType="java.lang.String"/>
<result property="testo" column="TESTO" jdbcType="VARCHAR"
javaType="java.lang.String"/>
</resultMap>
Is there any way to interpret the (not so well understandable) diagnostic
Error setting properties of
'[EMAIL PROTECTED]'.
Which property of the EspressioneStruct is involved? Looking to the log I
could note what follows:
The last prepared stament that has been printed in the log is
DEBUG [main] - {pstm-139524} PreparedStatement: select NOME from
TIPI_DATO_RIGA where TIPO_RIGA_ID = ?
DEBUG [main] - {pstm-139524} Parameters: [21]
DEBUG [main] - {pstm-139524} Types: [java.math.BigDecimal]
That query do correspond to the so called selectNomeCampo query and is
used to set the nome property of the EspressioneStruct (see above).
<select id="selectNomeCampo" resultClass="java.lang.String">
select NOME
from TIPI_DATO_RIGA
where TIPO_RIGA_ID = #id:INTEGER#
</select>
The raised exception (java.lang.IllegalArgumentException) would seem
indicate a problem with the argument.
#id:INTEGER# should be initalized wqith the value of the TIPO_RIGA_ID
column, that is decalred as NUMBER(10) ad has value 21 (exactly as
reported in the log).
Before of that record, dozens of other ones are successfully loaded,
exerting well both the nome propperty and its selectNomeCampo setter.
Provided that nome and selectNomeCampo actually are the involved entities
(I guess so) frankly it would seem everything pretty in order.
TIPO_RIGA_ID is a column that is not explicitly assigned to any property,
but I saw that this is a quite common practice
I'm getting confused.
Any suggestion?
Thanks in advance
ciao
Cesare