|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.5.0) E10653-06 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
oracle.jbo.domain.DBSequence
public class DBSequence
A lightweight, tier-independent wrapper that allows working with attributes that should get their number values from database sequence on insert of a new row.
If you designated an Entity Object attribute to be of type DBSequence, the framework assumes that the attribute value will be refreshed when that Entity Object is posted to the database This implementation assumes that there is an insert-trigger on the table corresponding to the Entity Object, that populates the corresponding column value with a number when the Entity is inserted into the database.
At runtime when a new Entity instance is created, this domain automatically fills in a temporary negative value as a place-holder for the attribute that is marked to be of DBSequence type. When the new Entity is posted, this value is updated from the database.
EntityImpl, Serialized Form| Field Summary | |
|---|---|
static java.lang.String |
AM_IMPL_CLIENT |
| Constructor Summary | |
|---|---|
DBSequence()Internal: Applications should not use this constructor. |
|
DBSequence(java.math.BigDecimal num)Create an instance of DBSequence with the given number as its value. |
|
DBSequence(java.math.BigInteger num)Create an instance of DBSequence with the given number as its value. |
|
DBSequence(DBSequence seq)Internal: Applications should not invoke this method. |
|
DBSequence(java.lang.Integer num)Create an instance of DBSequence with the given number as its value. |
|
DBSequence(java.lang.Long num)Create an instance of DBSequence with the given number as its value. |
|
DBSequence(Number num)Create an instance of DBSequence with the given number as its value. |
|
DBSequence(java.lang.String numberString)Internal: Applications should not invoke this method. |
|
DBSequence(java.lang.String seqName, ApplicationModule am)Uses the given sequence name to get a Sequence value that is stored for the value of this DBSequence instance |
|
| Method Summary | |
|---|---|
static java.lang.Long |
createInstanceWithAM(ApplicationModule am)Deprecated. since 9.0.3. Use new instance of this class to get the next value. |
boolean |
equals(java.lang.Object other)Test if the specified value is equal to this Sequence object. |
byte[] |
getBytes()Internal: Applications should not invoke this method. Converts this domain value into a bytes, so that the oracle.jbo.Key object can render this domain into a short string form. |
java.lang.Object |
getData()Internal: Applications should not invoke this method. |
java.lang.Object |
getNativeObject() |
static ORADataFactory |
getORADataFactory()Internal: Applications should not invoke this method. |
Number |
getSequenceNumber()Returns the value of this Sequence as an oracle.jbo.domain.Number |
Node |
getSerializedDomainXML(Document xmlDoc)Creates the xml node in the given xml document for this domain's data in hex format of the byte[] representation of the data. |
long |
getValue()Return this domain's value as long. |
Node |
getXMLContentNode(Document xmlDoc)Creates the xml node in the given xml document for this domain's data. |
static XMLDomainFactory |
getXMLDomainFactory(java.lang.Class attrClass)Internal: Applications should not use this method. |
int |
hashCode()Computes a hash code for this Sequence object. |
java.lang.String |
printXMLDefinition(java.util.Hashtable allDefs, java.io.PrintWriter pw, boolean bContainees)Prints the DTD info for this domain in the given print writer. |
void |
setBytes(byte[] bArr)Passes in the bytes that represent the value of this object. |
void |
setContext(DomainOwnerInterface owner, Transaction trans, java.lang.Object ctx)Internal: Applications should not use this method. |
Datum |
toDatum(java.sql.Connection conn)Internal: Applications should not invoke this method. |
java.lang.String |
toString()For testing purposes only: Returns a string representation of the generated sequence value. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String AM_IMPL_CLIENT
| Constructor Detail |
|---|
public DBSequence()
public DBSequence(java.math.BigInteger num)
public DBSequence(java.math.BigDecimal num)
public DBSequence(java.lang.Long num)
public DBSequence(java.lang.Integer num)
public DBSequence(Number num)
public DBSequence(DBSequence seq)
public DBSequence(java.lang.String numberString)
Called from AttributeDef for default values only.
public DBSequence(java.lang.String seqName,
ApplicationModule am)
This method will increment the specified database sequence when it is invoked.
seqName - The name of the database sequence that will be used to generate sequence values.am - The application module instance that will provide the JDBC connection and the marshalling context for the sequence requests.| Method Detail |
|---|
public static ORADataFactory getORADataFactory()
Initializes the Number Domain. This method is invoked when JBO is initialized.
ORADataFactory for the Number Domain.public java.lang.Object getNativeObject()
getNativeObject in interface NativeTypeDomainInterfacepublic long getValue()
public java.lang.Object getData()
getData in interface DomainInterface
public void setContext(DomainOwnerInterface owner,
Transaction trans,
java.lang.Object ctx)
setContext in interface DomainInterfacepublic Number getSequenceNumber()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
this Sequence object.equals in class java.lang.Objectother - The object to which the Sequence should be compared.this Sequence.public int hashCode()
this Sequence object.hashCode in class java.lang.Objectthis Sequence object.public static java.lang.Long createInstanceWithAM(ApplicationModule am)
am - The application module instance that will provide the JDBC connection for the sequence request
public Datum toDatum(java.sql.Connection conn)
throws java.sql.SQLException
Converts this Number Domain object back into an SQL NUMBER object.
conn - OracleConnection Not used.Datum containing NUMBER object.SQLException - Never.java.sql.SQLExceptionpublic byte[] getBytes()
getBytes in interface KeyAttributeInterfacepublic void setBytes(byte[] bArr)
setBytes in interface KeyAttributeInterface
public java.lang.String printXMLDefinition(java.util.Hashtable allDefs,
java.io.PrintWriter pw,
boolean bContainees)
The allDefs hashtable contains predefined XML definitions and is passed by whatever calls this method.
printXMLDefinition in interface XMLDomainInterfaceallDefs - a hashtable of predefined XML definitions passed from whatever calls this method.pw - print writer into which the defnition is being printed.bContainees - if true, prints definitions of contained objects.public Node getXMLContentNode(Document xmlDoc)
getXMLContentNode in interface XMLDomainInterfacexmlDoc - name of the XML document in which the node should be created.public Node getSerializedDomainXML(Document xmlDoc)
getSerializedDomainXML in interface XMLDomainWriterxmlDoc - name of the XML document in which the node should be created.public static XMLDomainFactory getXMLDomainFactory(java.lang.Class attrClass)
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.5.0) E10653-06 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||