Re: Oracle sequences for PK generation

Paul Lynch <[email protected]> Fri, 4 Jul 2008 23:37:44 +0100
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
On 4 Jul 2008, at 20:47, Markus Ruggiero wrote:

> I am to create a (small) WO app that sits on top of an existing  
> Oracle DB. One requirement I cannot change is that each table has an  
> associated sequence for the primary key. So I cannot use EOF's  
> automatic PK generation but I have to get the next value from the  
> corresponding sequence. What options do I have? What have others  
> done in such a situation, what are your experiences? How do you  
> access the sequence? Model it as kind of an entity? Use raw SQL? Use  
> the adaptor delegate to provide the PK? Simply trat te PK attribute  
> like a "normal" attribute and assign a value to it?

Most sites with legacy databases like this will have some kind of  
stored procedure to return a key.  I have never even needed to look at  
how the stored procedure works.

Paul