org.postgresql.pljava.internal

Class Oid


public class Oid
extends Number

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

double
doubleValue()
boolean
equals(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.
float
floatValue()
static Oid
forJavaClass(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.
static Oid
forTypeName(String typeString)
Finds the PostgreSQL well known Oid for a type name.
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.
int
intValue()
long
longValue()
static void
registerType(Class clazz, Oid typeId)
A Type well known to PostgreSQL but not known as a standard XOPEN SQL type can be registered here.
String
toString()
Returns a string representation of this OID.

Constructor Details

Oid

public Oid(int value)

Method Details

doubleValue

public double doubleValue()

equals

public boolean equals(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.
Returns:
true if the objects are equal.

floatValue

public float floatValue()

forJavaClass

public static Oid forJavaClass(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.

forTypeName

public static Oid forTypeName(String typeString)
Finds the PostgreSQL well known Oid for a type name.
Parameters:
typeString - The name of the type, optionally qualified with a namespace.
Returns:
The well known Oid.

getJavaClass

public Class getJavaClass()
            throws SQLException

getTypeId

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

hashCode

public int hashCode()
The native value is used as the hash code.
Returns:
The hashCode for this Oid.

intValue

public int intValue()

longValue

public long longValue()

registerType

public static void registerType(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.

toString

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

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