Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: setting a default ID with BC4J Entity
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
![]() |
![]() |