java.lang.Object
java.lang.Number
org.postgresql.pljava.internal.Oid
- All Implemented Interfaces:
Serializable
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.- Author:
- Thomas Hallgren
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublebooleanChecks to see if the other object is anOid, and if so, if the native value of thatOidequals the native value of thisOid.floatstatic OidforJavaObject(Object obj) Finds the PostgreSQL well known Oid for the given Java object.static OidforSqlType(int sqlType) Finds the PostgreSQL well known Oid for the XOPEN Sql type.static OidforTypeName(String typeString) Finds the PostgreSQL well known Oid for a type name.static OidReturns the PostgreSQL type id for the Oid type.inthashCode()The native value is used as the hash code.intintValue()longstatic voidregisterType(Class clazz, Oid typeId) A Type well known to PostgreSQL but not known as a standard XOPEN SQL type can be registered here.toString()Returns a string representation of this OID.Methods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
Oid
public Oid(int value)
-
-
Method Details
-
forJavaObject
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
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
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
Returns the PostgreSQL type id for the Oid type. -
registerType
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:
doubleValuein classNumber
-
equals
Checks to see if the other object is anOid, and if so, if the native value of thatOidequals the native value of thisOid. -
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
getJavaClass
- Throws:
SQLException
-
hashCode
public int hashCode()The native value is used as the hash code. -
intValue
public int intValue() -
longValue
public long longValue() -
toString
Returns a string representation of this OID.
-