|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.jbo.server.SequenceImpl
A represention of sequence Domain objects.
String sqlStr = "SELECT CRM_INT_PROCESSES_SEQ.NEXTVAL FROM DUAL "; ViewObject View0 =appMod.createViewObjectFromQueryStmt("SeqView", sqlStr); Row idRow = View0.first();
When View0.first() (or last(), for that matter) is executed, the query is executed twice and sequence numbers are lost. Setting the View Object to setForwardOnly also has no effect.
This problem is caused by a JDBC bug that forces "prefetch" to be greater than or equal to 1. That is, when you execute the query for the View Object, it fetches at least one row before you call next(). This is why the sequence number increases by two.
As a work around to this problem, explicitly create a new sequence:
import oracle.jbo.server.SequenceImpl; . . SequenceImpl s = new SequenceImpl(sequenceName, thisTransaction); Integer i = (Integer) s.getData(); . . setYourSequenceAttribute(new Number(i)); .
ViewObject
,
DBTransaction
,
oracle.jbo.server.ApplicationModule
, Serialized FormConstructor Summary | |
SequenceImpl()
|
|
SequenceImpl(java.lang.String seqName,
ApplicationModule am)
|
|
SequenceImpl(java.lang.String seqName,
DBTransaction trans)
|
Method Summary | |
static java.lang.Object |
createInstanceWithAM(java.lang.String seqName,
ApplicationModule am)
|
boolean |
equals(java.lang.Object other)
|
java.lang.Object |
getData()
Returns the value in the format that is acceptable to the database. |
int |
hashCode()
|
void |
setContext(DomainOwnerInterface owner,
Transaction trans,
java.lang.Object ctx)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public SequenceImpl()
public SequenceImpl(java.lang.String seqName, ApplicationModule am)
public SequenceImpl(java.lang.String seqName, DBTransaction trans)
Method Detail |
public static java.lang.Object createInstanceWithAM(java.lang.String seqName, ApplicationModule am)
public java.lang.Object getData()
For domain classes based on oracle.sql.*
classes,
this method returns a Datum
object.
For domains based on java.lang
types such as String
,
the value-holder object that is passed to JDBC is returned.
public void setContext(DomainOwnerInterface owner, Transaction trans, java.lang.Object ctx)
public java.lang.String toString()
public boolean equals(java.lang.Object other)
public int hashCode()
|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |