- java.lang.Object
-
- java.lang.Number
-
- org.postgresql.pljava.internal.Oid
-
- All Implemented Interfaces:
Serializable
public class Oid extends Number
TheOid
correspons to the internal PostgreSQLOid
. Should the size of that change from 32 bit, this class must change too. In Java, the InvalidOid is represented asnull
.- Author:
- Thomas Hallgren
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Oid(int value)
-
Method Summary
Modifier and Type Method Description double
doubleValue()
boolean
equals(Object o)
Checks to see if the other object is anOid
, and if so, if the native value of thatOid
equals the native value of thisOid
.float
floatValue()
static Oid
forJavaObject(Object obj)
Finds the PostgreSQL well known Oid for the given Java object.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.-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
-
-
-
Method Detail
-
forJavaObject
public static Oid forJavaObject(Object obj) throws SQLException
Finds the PostgreSQL well known Oid for the given Java object.- Parameters:
obj
- The object.- Returns:
- The well known Oid or null if no such Oid could be found.
- Throws:
SQLException
-
forTypeName
public static Oid forTypeName(String typeString) throws SQLException
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.
- Throws:
SQLException
- if the type could not be found
-
forSqlType
public static Oid forSqlType(int sqlType) throws SQLException
Finds the PostgreSQL well known Oid for the XOPEN Sql type.- Parameters:
sqlType
- The XOPEN type code.- Throws:
SQLException
- if the type could not be found
-
getTypeId
public static Oid getTypeId()
Returns the PostgreSQL type id for the Oid type.
-
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.
-
doubleValue
public double doubleValue()
- Specified by:
doubleValue
in classNumber
-
equals
public boolean equals(Object o)
Checks to see if the other object is anOid
, and if so, if the native value of thatOid
equals the native value of thisOid
.
-
floatValue
public float floatValue()
- Specified by:
floatValue
in classNumber
-
getJavaClass
public Class getJavaClass() throws SQLException
- Throws:
SQLException
-
hashCode
public int hashCode()
The native value is used as the hash code.
-
-