Oracle Repository API and Model Reference Guide


Contents


API Methods


Element Definitions


Index  


oracle.repos.services
Class GID

java.lang.Object
  |
  +--java.lang.Number
        |
        +--oracle.repos.services.GID

public class GID
extends java.lang.Number
implements oracle.repos.services.RSIdentifier

An immutable wrapper for a numeric repository object IRID and IVID identifiers (Generic IDentifier). Currently this extends the java.math.BigDecimal type, since the Java long definition only corresponds to Oracle numbers with a precision of NUMBER(19), this class uses BigDecimal values for repository element identifiers (IRID or IVID), which have a precision of NUMBER(38).

See Also:
oracle.repos.services.RID, Serialized Form

Field Summary
(package private)  boolean m_bhashcodeCached
           
(package private)  int m_nhashcode
           

 

Constructor Summary
GID(java.math.BigDecimal bdIDType)
          Translates a java.math.BigDecimal value to an GID.
GID(java.math.BigInteger nIDType)
           
GID(double dIDType)
          Deprecated. using primitive integral types reduces code reliability.
GID(GID gIDType)
           
GID(int nIDType)
           
GID(java.lang.Number nIDType)
           
GID(java.lang.String strValue)
          Creates a new GID instance by parsing an initial string representation of the numberic value.

 

Method Summary
 byte byteValue()
           
 int compareTo(GID gid)
          Compare two GIDs
 double doubleValue()
           
 boolean equals(java.lang.Object obj)
          Numeric equality operator for GID values.
 float floatValue()
           
static GID fromCallableStatement(java.sql.CallableStatement callableStatement, int nColumn)
          Creates a GID value from an indexed parameter value in a java.sql.PreparedStatement
static GID fromResultSet(java.sql.ResultSet resultSet, int nColumn)
           
static GID fromResultSet(java.sql.ResultSet resultSet, int nColumn, int nColumnType)
          Creates a GID value from an indexed column value in a java.sql.ResultSet
static GID fromResultSet(java.sql.ResultSet resultSet, java.lang.String strColumn)
           
static GID fromResultSet(java.sql.ResultSet resultSet, java.lang.String strColumn, int nColumnType)
          Creates a GID value from an named column value in a java.sql.ResultSet
 boolean greaterThan(GID gid)
          greaterThan two GIDs
 int hashCode()
           
 int intValue()
           
 boolean isNull()
           
 long longValue()
           
static GID referenceGIDNull()
           
static GID referenceGIDOne()
           
static GID referenceGIDZero()
           
 void setNull()
           
 void setParameter(java.sql.PreparedStatement callableStatement, int nColumn)
          Sets an indexed parameter in a java.sql.PreparedStatement with the numeric value of this GID instance
 short shortValue()
           
 java.math.BigDecimal toBigDecimal()
          Obtains a BigDecimal value from the contents of this GID instance.
 java.math.BigInteger toBigInteger()
           
 java.lang.String toString()
          Produces a string value from the contents of this GID instance.
static GID valueOf(long val)
           

 

Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Field Detail

m_bhashcodeCached

boolean m_bhashcodeCached

m_nhashcode

int m_nhashcode
Constructor Detail

GID

public GID(double dIDType)
Deprecated. using primitive integral types reduces code reliability.
Translates a long value to an GID.

GID

public GID(int nIDType)

GID

public GID(java.lang.Number nIDType)

GID

public GID(java.math.BigInteger nIDType)

GID

public GID(java.math.BigDecimal bdIDType)
Translates a java.math.BigDecimal value to an GID. This method facilitates creation of GID instances from JDBC methods which return BigDecimal types.

GID

public GID(GID gIDType)

GID

public GID(java.lang.String strValue)
    throws java.lang.NumberFormatException
Creates a new GID instance by parsing an initial string representation of the numberic value.
Throws:
java.lang.NumberFormatException - if the value cannot be parsed.
Method Detail

toBigDecimal

public java.math.BigDecimal toBigDecimal()
Obtains a BigDecimal value from the contents of this GID instance. This method facilitates creation of GID instances from JDBC methods which take BigDecimal parameters.
Returns:
a BigDecimal representation of this instance.

toString

public java.lang.String toString()
Produces a string value from the contents of this GID instance.
Overrides:
toString in class java.lang.Object
Returns:
a stringl representation of this instance.

fromResultSet

public static GID fromResultSet(java.sql.ResultSet resultSet,
                                int nColumn,
                                int nColumnType)
                         throws java.sql.SQLException
Creates a GID value from an indexed column value in a java.sql.ResultSet
Parameters:
resultSet - the java.sql.ResultSet
nColumn - the column index
nColumnType - JDBC type of column
Returns:
a new GID.
Throws:
java.sql.SQLException - on error.

fromResultSet

public static GID fromResultSet(java.sql.ResultSet resultSet,
                                int nColumn)
                         throws java.sql.SQLException

fromResultSet

public static GID fromResultSet(java.sql.ResultSet resultSet,
                                java.lang.String strColumn,
                                int nColumnType)
                         throws java.sql.SQLException
Creates a GID value from an named column value in a java.sql.ResultSet
Parameters:
resultSet - the java.sql.ResultSet
strColumn - the column name
Returns:
a new GID.
Throws:
java.sql.SQLException - on error.

fromResultSet

public static GID fromResultSet(java.sql.ResultSet resultSet,
                                java.lang.String strColumn)
                         throws java.sql.SQLException

fromCallableStatement

public static GID fromCallableStatement(java.sql.CallableStatement callableStatement,
                                        int nColumn)
                                 throws java.sql.SQLException
Creates a GID value from an indexed parameter value in a java.sql.PreparedStatement
Parameters:
callableStatement - the java.sql.CallableStatement
nColumn - the column index
Returns:
a new GID.
Throws:
java.sql.SQLException - on error.

setParameter

public void setParameter(java.sql.PreparedStatement callableStatement,
                         int nColumn)
                  throws java.sql.SQLException
Sets an indexed parameter in a java.sql.PreparedStatement with the numeric value of this GID instance
Parameters:
callableStatement - the java.sql.PreparedStatement
nColumn - the column index
Throws:
java.sql.SQLException - on error

equals

public boolean equals(java.lang.Object obj)
Numeric equality operator for GID values.
Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if the numeric value of the reference object is the same as the obj argument, otherwise false

setNull

public void setNull()

isNull

public boolean isNull()

compareTo

public int compareTo(GID gid)
Compare two GIDs

greaterThan

public boolean greaterThan(GID gid)
greaterThan two GIDs

referenceGIDZero

public static GID referenceGIDZero()

referenceGIDNull

public static GID referenceGIDNull()

referenceGIDOne

public static GID referenceGIDOne()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toBigInteger

public java.math.BigInteger toBigInteger()

intValue

public int intValue()
Overrides:
intValue in class java.lang.Number

longValue

public long longValue()
Overrides:
longValue in class java.lang.Number

floatValue

public float floatValue()
Overrides:
floatValue in class java.lang.Number

doubleValue

public double doubleValue()
Overrides:
doubleValue in class java.lang.Number

valueOf

public static GID valueOf(long val)

byteValue

public byte byteValue()
Overrides:
byteValue in class java.lang.Number

shortValue

public short shortValue()
Overrides:
shortValue in class java.lang.Number