ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <lmead...@apache.org>
Subject Re: need help - custom result set with no mapping
Date Mon, 27 Mar 2006 05:21:16 GMT
Sounds like a good time to use JDBC.


On 3/26/06, sadasiva lingala <sadasiva_lingala@yahoo.com> wrote:
> Hi
> I am using Spring and Ibatis for database access. I need a solution for
> defining custom type handler for entire resultset.
> for example I have SQL like
> "Select abc, xyz from table_a"
> I need to map the above query results to a generic Custom result set using
> JDBC resultset metadata. So I don't have a domain object to map the results
> , instead I want to map the results to custom resultset which also contains
> meta data. I see an example to map Oracle cursor data to a JSTL Result
> object using a type handler. But I am not sure how to map results from above
> SQL to a custom resultset using a type handler or some other mechanism. I
> know how to write a type handler but not sure how the resultMap would look
> like for this as I am not mapping individual columns but just want to call
> type handler for entire result set. This type handler should convert the
> JDBC result set into custom resultset.
> for example I want my query mapping something like this.. custo mer data has
> to be stored in CustomResult object along with metadata.
> <resultMap class="CustomResult" id="custom_result">
> </resultMap>
> <select id="getallcustomers" resultMap="custom_result" >
> select cust_name, age, address from customers
> </select>
> I also would take an alternative solution not using type handler (But I have
> to use ibatis as I am already using it for other things).
> Thanks

View raw message