org.postgresql.pljava.internal
Class Oid

java.lang.Object
  extended by org.postgresql.pljava.internal.Oid

public class Oid
extends java.lang.Object

The Oid correspons to the internal PostgreSQL Oid. Should the size of that change from 32 bit, this class must change too. In Java, the InvalidOid is represented as null.


Constructor Summary
Oid(int value)
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Checks to see if the other object is an Oid, and if so, if the native value of that Oid equals the native value of this Oid.
static Oid forJavaClass(java.lang.Class clazz)
          Finds the PostgreSQL well known Oid for the given class.
static Oid forSqlType(int sqlType)
          Finds the PostgreSQL well known Oid for the XOPEN Sql type.
 java.lang.Class getJavaClass()
           
static Oid getTypeId()
          Returns the PostgreSQL type id for the Oid type.
 int hashCode()
          The native value is used as the hash code.
static void registerType(java.lang.Class clazz, Oid typeId)
          A Type well known to PostgreSQL but not known as a standard XOPEN SQL type can be registered here.
 java.lang.String toString()
          Returns a string representation of this OID.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Oid

public Oid(int value)
Method Detail

equals

public boolean equals(java.lang.Object o)
Checks to see if the other object is an Oid, and if so, if the native value of that Oid equals the native value of this Oid.

Overrides:
equals in class java.lang.Object
Returns:
true if the objects are equal.

getJavaClass

public java.lang.Class getJavaClass()
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

hashCode

public int hashCode()
The native value is used as the hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
The hashCode for this Oid.

registerType

public static void registerType(java.lang.Class clazz,
                                Oid typeId)
A Type well known to PostgreSQL but not known as a standard XOPEN SQL type can be registered here. This includes types like the Oid itself and all the geometry related types.

Parameters:
clazz - The Java class that corresponds to the type id.
typeId - The well known type id.

forJavaClass

public static Oid forJavaClass(java.lang.Class clazz)
Finds the PostgreSQL well known Oid for the given class.

Parameters:
clazz - The class.
Returns:
The well known Oid or null if no such Oid could be found.

forSqlType

public static Oid forSqlType(int sqlType)
Finds the PostgreSQL well known Oid for the XOPEN Sql type.

Parameters:
sqlType - The XOPEN type code.
Returns:
The well known Oid or null if no such Oid could be found.

getTypeId

public static Oid getTypeId()
Returns the PostgreSQL type id for the Oid type.


toString

public java.lang.String toString()
Returns a string representation of this OID.

Overrides:
toString in class java.lang.Object


Copyright (c) 2003, 2004, 2005 TADA AB - Taby Sweden. Distributed under the terms shown in COPYRIGHT