Interface ProceduralLanguage.PLJavaBased
- All Superinterfaces:
RegProcedure.Memo<ProceduralLanguage.PLJavaBased>
- Enclosing interface:
ProceduralLanguage
RegProcedure.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 may be obtained within the body of
a language-handler method that has been passed am argument of
RegProcedure<PLJavaBased>
.
-
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.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 (as an emptyBitSet
here would normally indicate).
-