On 11/23/05, Alex Chew <[EMAIL PROTECTED]> wrote:
>
>
> Do you mean there should have such a field like
> private Long handlebyId;
> and i should prepare the data?
> It seems some strange.
Yes, I misunderstood your initial question. My apologies. See below.
>
> > <insert id=3D"insertAccount" parameterClass=3D"account">
> > insert into ACCOUNT (ID,NAME, DEPOSITE, FK_HANDLEBY)
> > values (#id#, #name#, #deposit#, #handleby.id#)
> > </insert>
>
> in my opinion, handleby.id here should be explained as
> getHandleby().getId().
> The process will be handled by iBatis, not Database.
You're right. your POJO's attribute is not "handleby", however, but
"handledby" (note the extra letter "d"). Is that the issue perhaps?
>
> > POJO:
> > public class Account implements Serializable {
> > private Long id;
> > private String name;
> > private Double deposit;
> > private User handledby;
> > }
> > 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>
>
--
I tend to view "truly flexible" by another term: "Make everything
equally hard". -- DHH