ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Severin Ecker <sec...@gmx.at>
Subject Re: cursor or multiple parameters
Date Fri, 13 Jul 2007 15:30:37 GMT
hi Larry,

yes or course, but there i need either a new type that i hand over to 
the sqlmap unless i can use more than one parameters.. or a list.

your solution (which is the one i'm using atm) requires another type 
definiton since i can't use the domain object

public class Bla { String hello; String world; //rest omitted }

where the 'new value' field is not present.

cheers,
severin


Larry Meadors wrote:
> update foo set bar = #newBar# where foo = #foo# and bar = #bar#
>
> Larry
>
>
> On 7/13/07, Severin Ecker <secker@gmx.at> wrote:
>> hi all,
>>
>> i have a problem (which i think i need to resolve with cursors but maybe
>> you know another way in ibatis)
>>
>> let's say i have a table
>> (
>> hello VARCHAR,
>> world VARCHAR
>> )
>>
>> both fields form the primary key together.
>>
>> what i need is, selecting one specific entry (by specifying values for
>> both fields in a query). i then want to update one of the two fields
>> with a new value.
>>
>> now i can lock the entry by starting a transaction and selecting my
>> desired row with a select 'bla' for update. but how do i guarantuee that
>> exactly that row that was returned is altered with the following update
>> statement?
>> can i get some id for the returned row, or tell the sqlmapper to update
>> the one previously returned in the transaction... or can i just use 2
>> parameters (or a list) in the sqlmap?
>>
>> thanks for help!
>>
>> cheeers,
>> severin
>>
>>
>

Mime
View raw message