Interface BindMarkersFactory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
This class creates new
BindMarkers
instances to bind
parameter to a specific Statement
.
Bind markers can be typically represented as placeholder and identifier. Placeholders are used within the query to execute so the underlying database system can substitute the placeholder with the actual value. Identifiers are used in R2DBC drivers to bind a value to a bind marker. Identifiers are typically a part of an entire bind marker when using indexed or named bind markers.
- Since:
- 5.3
- Author:
- Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic BindMarkersFactory
Create anonymous, index-based bind marker using a static placeholder.create()
Create a newBindMarkers
instance.default boolean
Return whether theBindMarkersFactory
uses identifiable placeholders:false
if multiple placeholders cannot be distinguished by just theplaceholder
identifier.static BindMarkersFactory
Create index-basedBindMarkers
using indexes to bind parameters.static BindMarkersFactory
Create namedBindMarkers
using identifiers to bind parameters.static BindMarkersFactory
Create namedBindMarkers
using identifiers to bind parameters.
-
Method Details
-
create
BindMarkers create()Create a newBindMarkers
instance. -
identifiablePlaceholders
default boolean identifiablePlaceholders()Return whether theBindMarkersFactory
uses identifiable placeholders:false
if multiple placeholders cannot be distinguished by just theplaceholder
identifier. -
indexed
Create index-basedBindMarkers
using indexes to bind parameters. Allows customization of the bind marker placeholderprefix
to represent the bind marker as placeholder within the query.- Parameters:
prefix
- bind parameter prefix that is included inBindMarker.getPlaceholder()
but not the actual identifierbeginWith
- the first index to use- Returns:
- a
BindMarkersFactory
usingprefix
andbeginWith
- See Also:
-
anonymous
Create anonymous, index-based bind marker using a static placeholder. Instances are bound by the ordinal position ordered by the appearance of the placeholder. This implementation creates indexed bind markers using an anonymous placeholder that correlates with an index.- Parameters:
placeholder
- parameter placeholder- Returns:
- a
BindMarkersFactory
usingplaceholder
- See Also:
-
named
Create namedBindMarkers
using identifiers to bind parameters. Named bind markers can supportname hints
. If nohint
is given, named bind markers can use a counter or a random value source to generate unique bind markers. Allows customization of the bind marker placeholderprefix
andnamePrefix
to represent the bind marker as placeholder within the query.- Parameters:
prefix
- bind parameter prefix that is included inBindMarker.getPlaceholder()
but not the actual identifiernamePrefix
- prefix for bind marker name that is included inBindMarker.getPlaceholder()
and the actual identifiermaxLength
- maximal length of parameter names when using name hints- Returns:
- a
BindMarkersFactory
usingprefix
andbeginWith
- See Also:
-
named
static BindMarkersFactory named(String prefix, String namePrefix, int maxLength, Function<String, String> hintFilterFunction) Create namedBindMarkers
using identifiers to bind parameters. Named bind markers supportname hints
. If nohint
is given, named bind markers can use a counter or a random value source to generate unique bind markers.- Parameters:
prefix
- bind parameter prefix that is included inBindMarker.getPlaceholder()
but not the actual identifiernamePrefix
- prefix for bind marker name that is included inBindMarker.getPlaceholder()
and the actual identifiermaxLength
- maximal length of parameter names when using name hintshintFilterFunction
- filterFunction
to consider database-specific limitations in bind marker/variable names such as ASCII chars only- Returns:
- a
BindMarkersFactory
usingprefix
andbeginWith
- See Also:
-