ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Saluja <rahul.sal...@vnl.in>
Subject RE: Need help on Inserting child Object .
Date Mon, 09 Feb 2009 02:25:29 GMT
Hello IngMar,

I am Using postgresSql As my DB and I am using auto-generated  keys as my way to create new
ID which is as follows:

<insert id="MSCPerfCntrMscMMSTblImpl"
parameterClass="com.hns.hss.nmf.server.log.manager.gensrc.MSCPerformance.impl.MSCPerfCntrMscMMSTblImpl">
        insert into MSCPerfCntrMscMMSTbl(
        seq_no,
        neinfo_id,
        rectimeStamp,
        index,
        numClsMrkUpdates,
        ciphrModeCntrlAttempt,
        succCiphrModeCntrl
        )
values
        (
        nextval ('MSCPerfCntrMscMMS_seq'),
        #neInfoId_0#,
        #timeStamp_0#,
        #index_1.value#,
        #numClsMrkUpdates_2.value#,
        #ciphrModeCntrlAttempt_3.value#,
        #succCiphrModeCntrl_4.value#)
</insert>


Looking forward to your response.

Regards
Rahul Saluja

-----Original Message-----
From: Ingmar Lötzsch [mailto:iloetzsch@asci-systemhaus.de]
Sent: Monday, February 09, 2009 4:09 AM
To: user-java@ibatis.apache.org
Subject: Re: Need help on Inserting child Object .

Hello, Rahul

> if (null == order.getOrderId()) {
> sqlMapClient.insert("Order.insert", order);
> } else {
> sqlMapClient.update("Order.update", order);
> }

> As I was going through above code I have few question why are checking
> it against null for insert , shouldn't that be checking for not null
>
> Though I can understand that It needs to be done at application level
> only using sql batch update but an explicit example of the same with
> corresponding entries in sqlmap would help . If somebody can put some
> light on this would help me in great manner.

what DBMS you are using? What is your application's/DB's way to create
new IDs?

Ingmar
The information contained in this e-mail is private & confidential and may also be legally
privileged. If you are not the intended recipient, please notify us, preferably by e-mail,
and do not read, copy or disclose the contents of this message to anyone.

Mime
View raw message