cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lawrence Gerstley <lawg...@gmail.com>
Subject Re: Oracle trying to get key from sequence (DUAL)--how to stop?
Date Fri, 31 Jul 2009 14:59:44 GMT
PK Generation Strategy is "Default"--I can't find anywhere else in the
modeler to try to affect this.

On Fri, Jul 31, 2009 at 7:23 AM, Michael Gentry <mgentry@masslight.net>wrote:

> If you select ENTRYSTATE (the DbEntity) in Cayenne Modeler and look
> under the Entity tab, what do you see for the Primary Key settings?
>
>
> On Fri, Jul 31, 2009 at 1:40 AM, Lawrence Gerstley<lawgers@gmail.com>
> wrote:
> > Hello,
> >
> > I've got a system where I need to populate my primary keys directly with
> > GUIDs, rather than letting Cayenne do it. For the most part, this is
> working
> > fine--I've exposed the keys in the Object layer, and set them when I
> create
> > a new object. However, there still seem to be calls to an Oracle sequence
> > for a key that I'm setting. That is, I've got:
> >
> > ENTITY
> >        -- EntityCode (PK)
> >        -- EntryStateID (FK)
> > ENTRYSTATE
> >        -- EntryStateID (PK)
> >
> > I create the entity, set the Entity's key, create the EntryState, set the
> > EntryState's key, and attach the EntryState to the Entity
> > (entity.setToEntryState(entryState). I check all of the values both by
> > checking the objects individually, and through reference (e.g.,
> > entity.getToEntryState.getEntryStateId()). Regardless, when I go to
> commit
> > the changes consisting of the new objects being added to the data
> context, I
> > get:
> >
> > SELECT entryState.nextval FROM DUAL;
> >
> > I could create an Oracle sequence, but I don't want this--I want to be
> > responsible for the keys myself. Can you help me find where this
> > auto-sequence dependency is coming from, and how to stop it? I'd rather
> it
> > just fails than try to get a key through some sequence.
> >
> > Thanks,
> >
> > Lawrence
> >
> >
>



-- 
============================
Lawrence Gerstley, Ph.D.
PSMI Consulting

Cel: 415.694-0844

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message