ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Maves <Nathan.Ma...@Sun.COM>
Subject Re: how can i get attribute from inbed object?
Date Thu, 01 Dec 2005 19:50:03 GMT
Dave,

Can you also give us the parameter class code?  Without more  
information on this class there is no way to tell.

Nathan
On Dec 1, 2005, at 10:26 AM, David Moss wrote:

> Hi,
>
> Has anyone managed to get this to work?
>
> I'm trying to do something very similar, but it's not working.
>
> I have a class IProjection with a property name.  If I try the  
> following map
>
> <insert id="storeFeatureSet" parameterClass="IFeatureSet">
>
>    insert into feature_set (format_id, projection_name, bounds)
>    values(#format.id#,
>    #projection.name#,
>    box3d('BOX3D($bounds.minX$ $bounds.minY$, $bounds.maxX$
>    $bounds.maxY$)'))
>
> </insert>
>
> I get an error 'BadSqlGrammarException - Check the parameter  
> mapping for the 'projection.name' property.'
>
> So..., the 'name' property may be incorrect, but it's not.  iBATIS  
> throws an error long before getting this far if the property name  
> is invalid.
>
> I can't work out what's wrong.
> (Interestingly, I assume it has happily parsed #format.id#!)
>
> Doesn't anyone have any insights?
>
> Thanks. Dave.
>
>
>
>> Hi, Clinton
>>     Would you please take a look at following message? i could not  
>> find any clues from ibatis example and docs.
>> Does #handleby.id# will be treated as getHandleby().getId()?
>> IF not, then, how can i create an Account with handleby User  
>> specified?
>> Must i try insert and update at the same time?
>>  regards,
>> alex
>>  On 11/19/05, *Alex Chew* <chew.alex@gmail.com  
>> <mailto:chew.alex@gmail.com>> wrote:
>>
>>      Hi, all
>>      would you please help me for following issue, thanks advance.
>>
>>      POJO:
>>     public class Account implements Serializable {
>>      private Long id;
>>      private String name;
>>     private Double deposit;
>>      private User handleby;
>>     }
>>      public class User implements Serializable {
>>      private Long id;
>>      private String username;
>>     private String password;
>>     }
>>
>>      SQL:
>>      <insert id=3D"insertAccount" parameterClass=3D"account">
>>     insert into ACCOUNT (ID,NAME, DEPOSITE, FK_HANDLEBY)
>>     values (#id#, #name#, #deposit#, #handleby.id#)
>>     </insert>
>>
>>     *handleby.id <http://handleby.id/>* cannot work,the value  
>> inserted
>>     is NULL, and no other excpetion message.
>>     Must i get id of handleby
>>     User manually?
>>
>>     regards
>>     Alex
>>


Mime
View raw message