ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Crocker, Patrick" <patrick.croc...@verizon.com>
Subject RE: finding unique keys
Date Fri, 15 Sep 2006 14:51:29 GMT
What kind of database are you using?

- Patrick. 

-----Original Message-----
From: Edwin Lukaweski [mailto:serjann@rogers.com] 
Sent: Friday, September 15, 2006 9:47 AM
To: user-java@ibatis.apache.org; lmeadors@apache.org
Subject: Re: finding unique keys

Thanks for the answer.

    I am stuck with an existing table definition, in a schema, that I
modify at this point due to being in production.

    So, this is the best method I can come up with.

    also....now you have tweaked my curiosity. In addition to the advice
am seeking, it I could alter the table definition to use some form of 
auto-increment, how would I retrieve the generated value in iBatis?

    So.....I now have two questions.


----- Original Message ----- 
From: "Larry Meadors" <lmeadors@apache.org>
To: <user-java@ibatis.apache.org>
Sent: Friday, September 15, 2006 10:14 AM
Subject: Re: finding unique keys

> One question: Why not just let the database do it and have it tell you
> the generated key?
> Larry
> On 9/15/06, Edwin Lukaweski <serjann@rogers.com> wrote:
>> Hi:
>>     I have a situation for which I need some advice while using
>>     What I would like to do is:
>>     1) generate a unique UUID style value in my Java program
>>     2) lock a table, say tabxx
>>     3) SELECT on the table to see if the UUID exists as a key
>>     4) if so, add 1 to the key and go to step 3
>>     5) if the key does NOT exist, insert the record
>>     6) unlock the table
>>     Can anyone get me advice as to how to do this with iBatis?
>> Thanks, very musch, in advance
>> Edwin

View raw message