Re: Oracle sequences for PK generation

Łukasz Szydło <[email protected]> Mon, 07 Jul 2008 14:51:40 +0200
Newsgroups gmane.comp.web.webobjects.devel
Organization Power Media S.A.
Message-ID <[email protected]>
Dnia 04-07-2008 o 21:47:05 Markus Ruggiero <[email protected]> napisał(a):

> Hi,
>
> 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?
>
> Thanks for any help
> ---markus---
>
> _______________________________________________
> WebObjects-dev mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/webobjects-dev
>

I believe that 'Oracle synonym' is answer for your question
(http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7001.htm#SQLRF01401).
You have to create synonyms for sequences that are now used for
key generations, with names appropriate for WebObjects conventions.
It works like symbolic link.

Łukasz Szydło