ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diran Ayandele <Adediran.Ayand...@Sun.COM>
Subject Re: Using sequences
Date Fri, 17 Mar 2006 15:07:44 GMT
Doh - and I have that doc sitting on my desk - good tip!

<selectKey resultClass="int" keyProperty="id">
    Select sequence.nextval as id from dual
</selectKey>

Diran

Bruyn Bill wrote:

>See "Auto Generated Keys" on page 15 of the SqlMaps doc.
>
>  
>
>>-----Original Message-----
>>From: Adediran.Ayandele@Sun.COM [mailto:Adediran.Ayandele@Sun.COM] 
>>Sent: Friday, March 17, 2006 7:38 AM
>>To: user-java@ibatis.apache.org
>>Subject: Re: Using sequences
>>
>>
>> This is an apt question for me as well.  I access my dao from the 
>>service layer to retrieve this, and then pass it back.  I 
>>struck me as 
>>not very efficient, but logically it works ok because all my 
>>DAO calls 
>>come from the same layer...  So, is there a better way?
>>
>>Diran
>>
>>Paul Carr wrote:
>>
>>    
>>
>>>Hi Guys,  whats the best way to insert a row with ibatis 
>>>      
>>>
>>when your key
>>    
>>
>>>column is generated from a sequence on the DB ?
>>>
>>>Would I edit the sql in the sql map ?  or is there a clever 
>>>      
>>>
>>way to do 
>>    
>>
>>>it?
>>>
>>> 
>>>
>>>
>>>      
>>>

Mime
View raw message