Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: setting a default ID with BC4J Entity

Re: setting a default ID with BC4J Entity

From: Owen Gibbins <oweng_at_autoplan.ws>
Date: Wed, 13 Nov 2002 15:07:53 -0800
Message-ID: <tZAA9.190729$C8.484818@nnrp1.uunet.ca>


Thanks for replies.

I've made it work with the following code:

  protected void create(AttributeList nameValuePair)   {
    super.create(nameValuePair);

    setID((Number)getDBTransaction()
.createViewObjectFromQueryStmt("SELECT producer_seq.nextval FROM
DUAL")
.next()
.getAttribute(0));

  }

The only issue is that it seems to increment by 2. The sequence is set to increment by 1, and in SQLPlus it does so. However, in my application the keys are genereated 2 by 2. But if I set a breakpoint within the create method, it is only encountered once (and thus I would think the SELECT statement would only be executed once).

Is there a newsgroup that would perhaps be more appropriate for this JDeveloper question?

Any help is appreciated!

Owen Received on Wed Nov 13 2002 - 17:07:53 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US