Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Oracle Application Development Framework Business Components Domains Java API Reference 10g Release 3 (10.1.3) B16006-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.jbo.domain
Class DBSequence

`java.lang.Object
oracle.jbo.domain.DBSequence`

All Implemented Interfaces:
  oracle.jbo.domain.DomainInterface, oracle.jbo.domain.KeyAttributeInterface, java.io.Serializable

public class DBSequence
extends java.lang.Object
implements oracle.jbo.domain.DomainInterface, java.io.Serializable, oracle.jbo.domain.KeyAttributeInterface

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.

Since:
  JDeveloper 3.2.3
See Also:
  `oracle.jbo.server.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 it's value.
`DBSequence(java.math.BigInteger num)` Create an instance of DBSequence with the given number as it's 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 it's value.
`DBSequence(java.lang.Long num)` Create an instance of DBSequence with the given number as it's value.
`DBSequence(Number num)` Create an instance of DBSequence with the given number as it's value.
`DBSequence(java.lang.String numberString)` Internal: Applications should not invoke this method.
`DBSequence(java.lang.String seqName, oracle.jbo.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(oracle.jbo.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.
`static oracle.sql.CustomDatumFactory` | `getCustomDatumFactory()` Internal: Applications should not invoke this method.
`java.lang.Object` | `getData()` Internal: Applications should not invoke this method.
`Number` | `getSequenceNumber()` Returns the value of this Sequence as an oracle.jbo.domain.Number
`long` | `getValue()` Return this domain's value as long.
`static oracle.jbo.domain.XMLDomainFactory` | `getXMLDomainFactory(java.lang.Class attrClass)` Internal: Applications should not use this method.
`int` | `hashCode()` Computes a hash code for `this` Sequence object.
`void` | `setBytes(byte[] bArr)` Passes in the bytes that represent the value of this object.
`void` | `setContext(oracle.jbo.domain.DomainOwnerInterface owner, oracle.jbo.Transaction trans, java.lang.Object ctx)` Internal: Applications should not use this method.
`oracle.sql.Datum` | `toDatum(oracle.jdbc.driver.OracleConnection 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

### AM_IMPL_CLIENT

    public static final java.lang.String AM_IMPL_CLIENT

  See Also:
    Constant Field Values

Constructor Detail

### DBSequence

    public DBSequence()

  Internal: Applications should not use this constructor.

### DBSequence

    public DBSequence(java.math.BigInteger num)

  Create an instance of DBSequence with the given number as it's value.

### DBSequence

    public DBSequence(java.math.BigDecimal num)

  Create an instance of DBSequence with the given number as it's value.

### DBSequence

    public DBSequence(java.lang.Long num)

  Create an instance of DBSequence with the given number as it's value.

### DBSequence

    public DBSequence(java.lang.Integer num)

  Create an instance of DBSequence with the given number as it's value.

### DBSequence

    public DBSequence(Number num)

  Create an instance of DBSequence with the given number as it's value.

### DBSequence

    public DBSequence(DBSequence seq)

  Internal: Applications should not invoke this method.

### DBSequence

    public DBSequence(java.lang.String numberString)

  Internal: Applications should not invoke this method.

  Called from AttributeDef for default values only.

### DBSequence

    public DBSequence(java.lang.String seqName,
                      oracle.jbo.ApplicationModule am)

  Uses the given sequence name to get a Sequence value that is stored for the value of this DBSequence instance

  This method will increment the specified database sequence when it is invoked.

Parameters:
  `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

### getCustomDatumFactory

    public static oracle.sql.CustomDatumFactory getCustomDatumFactory()

  Internal: Applications should not invoke this method.

  Initializes the `Number` Domain. This method is invoked when JBO is initialized.

  Returns:
    the `CustomDatumFactory` for the `Number` Domain.

### getValue

    public long getValue()

  Return this domain's value as long. This method may be used to access the value for this domain in EL-expressions.

### getData

    public java.lang.Object getData()

  Internal: Applications should not invoke this method.
  Specified by:
    `getData` in interface `oracle.jbo.domain.DomainInterface`
  Returns:
    The value that this sequence object represents

### setContext

    public void setContext(oracle.jbo.domain.DomainOwnerInterface owner,
                           oracle.jbo.Transaction trans,
                           java.lang.Object ctx)

  Internal: Applications should not use this method.
  Specified by:
    `setContext` in interface `oracle.jbo.domain.DomainInterface`

### getSequenceNumber

    public Number getSequenceNumber()

  Returns the value of this Sequence as an oracle.jbo.domain.Number

### toString

    public java.lang.String toString()

  For testing purposes only: Returns a string representation of the generated sequence value.

### equals

    public boolean equals(java.lang.Object other)

  Test if the specified value is equal to `this` Sequence object.
  Parameters:
    `other` - The object to which the Sequence should be compared.
  Returns:
    true The specified object is equal to the `this` Sequence.

### hashCode

    public int hashCode()

  Computes a hash code for `this` Sequence object.
  Returns:
    the hash code of `this` Sequence object.

### createInstanceWithAM

    public static java.lang.Long createInstanceWithAM(oracle.jbo.ApplicationModule am)

  Deprecated. since 9.0.3. Use new instance of this class to get the next value.
  A class method that may be invoked to retrieve the next value from a database sequence.
  Parameters:
    `am` - The application module instance that will provide the JDBC connection for the sequence request

### toDatum

    public oracle.sql.Datum toDatum(oracle.jdbc.driver.OracleConnection conn)
                             throws java.sql.SQLException

  Internal: Applications should not invoke this method.

  Converts this `Number` Domain object back into an SQL `NUMBER` object.

  Parameters:
    `conn` - `OracleConnection` Not used.
  Returns:
    A `Datum` containing `NUMBER` object.
  Throws:
    ``SQLException`` - Never.
    `java.sql.SQLException`

### getBytes

    public 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.
  Specified by:
    `getBytes` in interface `oracle.jbo.domain.KeyAttributeInterface`
  Returns:
    a byte array representing this object

### setBytes

    public void setBytes(byte[] bArr)

  Passes in the bytes that represent the value of this object. This method is to be used by the oracle.jbo.Key object to pass in key value read from a stream in byte array format.
  Specified by:
    `setBytes` in interface `oracle.jbo.domain.KeyAttributeInterface`

### getXMLDomainFactory

    public static oracle.jbo.domain.XMLDomainFactory getXMLDomainFactory(java.lang.Class attrClass)

  Internal: Applications should not use this method.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Oracle Application Development Framework Business Components Domains Java API Reference 10g Release 3 (10.1.3) B16006-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1997, 2005, Oracle. All rights reserved.