- All Known Subinterfaces:
Attribute
,CatalogObject.Addressed<T>
,Database
,Extension
,ProceduralLanguage
,RegClass
,RegClass.Known<T>
,RegCollation
,RegConfig
,RegDictionary
,RegNamespace
,RegOperator
,RegProcedure<M>
,RegRole
,RegRole.Grantee
,RegType
,RegType.Unresolved
oid
.
The oid
by itself does not constitute an object address until
combined with a classId
identifying the catalog to which it belongs.
This topmost interface, therefore, represents a catalog object when only
the oid
is known, and the classId
is: unknown, or simply
understood from context. An instance of this interface can be explicitly
combined with a classId
, using the of(classId)
method,
which will yield an instance of an interface that extends CatalogObject.Addressed
and is specific to catalog objects of that class.
A classId
, in turn, is simply an instance of
RegClass
(the catalog of relations, whose name "class"
reflects PostgreSQL's object-relational origins). It identifies the specific
relation in the PostgreSQL catalogs where objects with that classId
can be looked up.
Every user relation, of course, is also represented by a RegClass
instance, but not one that can be used to form a catalog object address.
For that matter, not every class in the PostgreSQL catalogs is modeled by
a class in PL/Java. Therefore, not just any RegClass
instance can be
passed to of(classId)
as a classId
. Those that can be
have the more-specific type RegClass.Known<T>
, which also identifies
the Java model class T that will be returned.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Interface for any catalog object with an access control list (a list of some type ofGrant
).static interface
CatalogObject.Addressed<T extends CatalogObject.Addressed<T>>
A catalog object that has bothoid
andclassId
specified, and can be looked up in the PostgreSQL catalogs (where it may, or may not, be found).static interface
Interface for an object that is regarded as a component of some, other, addressed catalog object, and is identified by that other object'sclassId
andoid
along with an integersubId
.static interface
Interface representing any singleGrant
(or ACL item), a grant of some set of possible privileges, to some role, granted by some role.static interface
CatalogObject.Named<T extends Lexicals.Identifier.Unqualified<T>>
Interface for any catalog object that has a name, which can be anIdentifier.Simple
or anIdentifier.Operator
.static interface
Interface for any catalog object that has a name and also a namespace or schema (an associated instance ofRegNamespace
).static interface
Interface for any catalog object that has an owner (an associated instance ofRegRole
. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isValid()
Whether this catalog object has a validoid
(any value other thanInvalidOid
).<T extends CatalogObject.Addressed<T>>
Tof
(RegClass.Known<T> classId) Return a catalog object as anAddressed
instance in a known class.int
oid()
This catalog object's object ID; the integer value that identifies the object to PostgreSQL when the containing catalog is known.
-
Field Details
-
Method Details
-
oid
int oid()This catalog object's object ID; the integer value that identifies the object to PostgreSQL when the containing catalog is known. -
isValid
boolean isValid()Whether this catalog object has a validoid
(any value other thanInvalidOid
).This is not the same as whether any corresponding catalog object actually exists. This question can be answered directly from the value of
oid()
. The existence question (which can be asked sensibly only of anAddressed
instance with itsexists()
method} can be answered only through a lookup attempt for theoid
in the corresponding catalog.There is not a unique singleton invalid catalog object instance. Rather, there can be distinct
Addressed
instances that have the invalidoid
and distinctclassId
s, as well as one singletonCatalogObject
that has the invalidoid
and no validclassId
.When applied to a
RegRole.Grantee
, this method simply returns the negation ofisPublic
, which is the method that should be preferred for clarity in that case. -
of
Return a catalog object as anAddressed
instance in a known class.For example, if a
CatalogObject o
is read from anoid
column known to represent a namespace,o.of(RegNamespace.CLASSID)
will return aRegNamespace
instance.An instance whose class id is already the desired one will return itself. On an instance that lacks a valid class id,
of
can apply any desired class id (a different instance will be returned). The invalid instance of any class can be converted to the (distinct) invalid instance of any other class. On an instance that is valid and already has a valid class id,of
will throw an exception if the desired class id differs.- Type Parameters:
T
- Specific subtype of Addressed that represents catalog objects with the given class id.- Parameters:
classId
- A known class id, often from the CLASSID field of a known CatalogObject subclass.- Returns:
- An instance with this instance's oid and the desired class id (this instance, if the class id matches).
-