ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kai Grabfelder <nos...@kinokai.de>
Subject Re: Result Class
Date Fri, 21 Nov 2008 15:10:44 GMT
I guess it depends on your database if . are allowed in column aliases - i guess it is not
the case with
oracle. Maybe you need to escape them? Alternatively you should switch to resultMaps instead
of resultClass.

Regards

Kai

--- Original Nachricht ---
Absender: Bruno Frascino
Datum: 20.11.2008 04:06
>  Hello all,
> 
>  I have got:
> 
> <select id="getResources" parameterClass="java.lang.String"
> 
> resultClass="application.domain.Resources">
> 
> <![CDATA[
> 
> SELECT
> 
>   resource_id  as id,
> 
>   resource_type_code as resourceType.code,
> 
>   resource_type_desc as resourceType.description
> 
> FROM t_resource
> 
> WHERE
> 
>  resource_id = #resourceId#
> 
> ]]>
> 
> </select>
> 
> 
> So my Resources class looks like:
> 
> public class Resources{
> 
>    private String id;
>    private ResourceType resourceType;
> 
>    .....
> }
> 
> public class ResourceType{
> 
>    private String code;
>    private String description;
> 
>   ....
> }
> 
>  Is this possible? How can I make it work?
>  I am getting an error saying :
> 
> 
> --- Cause: java.sql.SQLException: ORA-00923: FROM keyword not found where expected
> 
> 
>  It only works if I get rid of the 'dot' from resourceType.code and resourceType.description
>  I can have only plain classes as Result Class?
> 
>  Cheers,
> 
> 
>  Bruno
> 
> 
> 
> 
> 
> 
> ________________________________
> NOTICE - This communication is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking any action in reliance on, this communication by
persons or entities other than the intended recipient is prohibited. If you are not the intended
recipient of this communication please delete and destroy all copies and telephone SMS Management
& Technology on 9696 0911 immediately. Any views expressed in this Communication are those
of the individual sender, except where the sender specifically states them to be the views
of SMS Management & Technology. Except as required by law, SMS Management & Technology
does not represent, warrant and/or guarantee that the integrity of this communication has
been maintained nor that the communication is free from errors, virus, interception or interference.
> 


Mime
View raw message