Hi.. isn't there anyone could help me with this error? I'd already googling about this problem, and reconfigure my sql map, still couldn't fix any problem.

Thanx.

Regards,
Hendry

-------- Original Message --------
Subject: Need Help with sqlmap + refcursor oracle
Date: Fri, 19 May 2006 10:59:30 +0700
From: Hendry <[EMAIL PROTECTED]>
To: [email protected]

Hi all,

I got an error message when calling procedure from my application, here
is my sql map queries.

...
<typeAlias alias="Order" type="valueobjects.Order"/>

<resultMap id="order-map-max" class="Content">
   <result property="orderId" column="orderId" />
</resultMap>

<parameterMap id="single-rs" class="map">
   <parameter property="output1" jdbcType="ORACLECURSOR" mode="OUT"/>
</parameterMap>

<procedure id="getMaxId" parameterMap="single-rs" resultMap="order-map-max">
  { call order_sel_max(?) }
</procedure>
...

the procedure in oracle :
-------------------------
CREATE OR REPLACE PROCEDURE "ORDER_SEL_MAX"
(       
   result_cursor   IN OUT TYPES.cursor_type
)
IS
BEGIN
   OPEN result_cursor FOR
      SELECT MAX(id) as orderId
   FROM
      tbl_order;
END;
----------------------------------

public List getMaxOrderId(Map map) {
  try {
    return getSqlMapExecutor().queryForList("getMaxId", map);
   } catch (SQLException e) {
    throw new DaoException("Error selecting max id. Cause : " + e, e);
   }
}
-------------------------------------

when i make a call to get max id, like this :

...
Map map = new HashMap();
List data = orderDao.getMaxOrderId(map);
...

I got an error like this,

Exception in thread "main" com.ibatis.dao.client.DaoException: Error
selecting max id. Cause :
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in conf/queries.xml.
--- The error occurred while applying a result map.
--- Check the queries.order-map-max.
--- The error happened while setting a property on the result object.
--- Cause: java.lang.RuntimeException: Error setting properties of
'[EMAIL PROTECTED]'.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.RuntimeException: Error setting properties of
'[EMAIL PROTECTED]'.  Cause: java.lang.IllegalArgumentException
        at dao.sqlmap.SqlMapOrderDao.getMaxOrderId(SqlMapOrderDao.java:95)
...

what's wrong with my result map?

Reply via email to