Interface ProceduralLanguage.PLJavaBased
- All Superinterfaces:
RegProcedure.Memo<ProceduralLanguage.PLJavaBased>
,RegProcedure.Memo.How<ProceduralLanguage.PLJavaBased>
- Enclosing interface:
ProceduralLanguage
How
memo attached to a RegProcedure
that represents
a PL/Java-based routine, retaining additional information useful to
a PL/Java-based language implementation.
A valid memo of this type will be maintained by PL/Java's dispatcher
on RegProcedure
instances that represent PL/Java-based routines.
When passing such a RegProcedure
to a language-handler method,
the dispatcher also passes the memo.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.postgresql.pljava.model.RegProcedure.Memo
RegProcedure.Memo.How<M extends RegProcedure.Memo.How<M>>, RegProcedure.Memo.Why<M extends RegProcedure.Memo.Why<M>>
-
Method Summary
Modifier and TypeMethodDescriptionATupleDescriptor
describing the expected parameters, based only on the routine declaration.ATupleDescriptor
describing the expected result, based only on the routine declaration.A list ofTransform
instances (null if none) indicating transforms to be applied on data types supplied to or supplied by this routine.ABitSet
indicating (by zero-based index intoinputsTemplate
) which of the input parameter types need resolution against actual supplied argument types at a call site.ABitSet
indicating (by zero-based index intooutputsTemplate
) which result types need resolution against actual supplied argument types at each call site.
-
Method Details
-
inputsTemplate
TupleDescriptor inputsTemplate()ATupleDescriptor
describing the expected parameters, based only on the routine declaration.The
TupleDescriptor
returned here depends only on the static catalog information for theRegProcedure
carrying this memo. A language handler can use it to generate template code that can be cached with the targetRegProcedure
, independently of any one call site.Lexicals.Identifier.None
may be encountered among the member names; parameters do not have to be named.Some reported types may have
needsResolution
true, and require resolution to specific types using the expression context at a given call site.For a routine declared variadic, if the declared type of the variadic parameter is the wildcard
"any"
type,arguments()
.size()
at a call site can differ frominputsTemplate().size()
, the variadic arguments delivered in "spread" form as distinct (and individually typed) arguments. Variadic arguments of any other declared type are always delivered in "collected" form as a PostgreSQL array of that type. A variadic"any"
routine can also receive its arguments collected, when it has been called that way; therefore, there is an ambiguity when such a routine is called with a single array argument in the variadic position. A language handler must callLookup.inputsAreSpread()
to determine the caller's intent in that case.- See Also:
-
unresolvedInputs
BitSet unresolvedInputs()ABitSet
indicating (by zero-based index intoinputsTemplate
) which of the input parameter types need resolution against actual supplied argument types at a call site.If the set is empty, such per-call-site resolution can be skipped.
- Returns:
- a cloned
BitSet
-
outputsTemplate
TupleDescriptor outputsTemplate()ATupleDescriptor
describing the expected result, based only on the routine declaration.The
TupleDescriptor
returned here depends only on the static catalog information for theRegProcedure
carrying this memo. A language handler can use it to generate template code that can be cached with the targetRegProcedure
, independently of any one call site.For a function whose return type (in SQL) is not composite (or a function with only one output parameter, which PostgreSQL treats the same way), this method returns a synthetic ephemeral descriptor with one attribute of the declared return type. This convention allows
TupleTableSlot
to be the uniform API for the data type conversions to and from PostgreSQL, regardless of how a routine is declared.This method returns null in two cases: if the target returns
VOID
and no descriptor is needed, or if the target is a function whose call sites must supply a column definition list, so there is no template descriptor that can be cached with the routine proper. A descriptor can only be obtained later fromoutputsDescriptor()
when a call site is at hand.Some reported types may have
needsResolution
true, and require resolution to specific types using the expression context at a given call site.Lexicals.Identifier.None
will be the name of the single attribute in the synthetic descriptor wrapping a scalar. Because PL/Java's function dispatcher will undo the wrapping to return a scalar to PostgreSQL, the name matters not.- Returns:
- a
TupleDescriptor
, null if the target returnsVOID
, or is a function and can only be called with a column definition list supplied at the call site. - See Also:
-
unresolvedOutputs
BitSet unresolvedOutputs()ABitSet
indicating (by zero-based index intooutputsTemplate
) which result types need resolution against actual supplied argument types at each call site.If the set is empty, such per-call-site resolution can be skipped.
- Returns:
- a cloned
BitSet
. In the two circumstances whereoutputsTemplate
returns null, this method returns either null or an emptyBitSet
. It is null for the unspecified-record-returning case, where a column definition list must be consulted at each call site; it is an empty set for theVOID
-returning case where no further resolution is needed (just as an emptyBitSet
here would normally indicate).
-
transforms
A list ofTransform
instances (null if none) indicating transforms to be applied on data types supplied to or supplied by this routine.When this method returns a non-null result, each
Transform
in the list has already been checked by the language implementation'sessentialTransformChecks
method. Any exceptions those checks might throw should have been thrown when the dispatcher invoked this method before dispatching to the language handler, so a language handler using this method need not normally expect to handle them.
-