@@ -148,7 +148,7 @@ public abstract class AbstractR2dbcConfiguration implements ApplicationContextAw
|
||||
|
||||
/**
|
||||
* Creates a {@link ReactiveDataAccessStrategy} using the configured
|
||||
* {@link #r2dbcConverter(Optional, R2dbcCustomConversions)} R2dbcConverter}.
|
||||
* {@link #r2dbcConverter(R2dbcMappingContext, R2dbcCustomConversions) R2dbcConverter}.
|
||||
*
|
||||
* @param converter the configured {@link R2dbcConverter}.
|
||||
* @return must not be {@literal null}.
|
||||
|
||||
@@ -21,7 +21,7 @@ import io.r2dbc.spi.Wrapped;
|
||||
/**
|
||||
* Sub interface of {@link Connection} to be implemented by Connection proxies. Allows access to the underlying target
|
||||
* Connection.
|
||||
* <p/>
|
||||
* <p>
|
||||
* This interface can be checked when there is a need to cast to a native R2DBC {@link Connection}.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
@@ -33,7 +33,7 @@ public interface ConnectionProxy extends Connection, Wrapped<Connection> {
|
||||
|
||||
/**
|
||||
* Return the target {@link Connection} of this proxy.
|
||||
* <p/>
|
||||
* <p>
|
||||
* This will typically be the native driver {@link Connection} or a wrapper from a connection pool.
|
||||
*
|
||||
* @return the underlying Connection (never {@literal null})
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ConnectionFactoryInitializer implements InitializingBean, Disposabl
|
||||
/**
|
||||
* The {@link ConnectionFactory} for the database to populate when this component is initialized and to clean up when
|
||||
* this component is shut down.
|
||||
* <p/>
|
||||
* <p>
|
||||
* This property is mandatory with no default provided.
|
||||
*
|
||||
* @param connectionFactory the R2DBC {@link ConnectionFactory}.
|
||||
|
||||
@@ -160,7 +160,7 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
||||
|
||||
/**
|
||||
* Specify the statement separator, if a custom one.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Defaults to {@code ";"} if not specified and falls back to {@code "\n"} as a last resort; may be set to
|
||||
* {@link ScriptUtils#EOF_STATEMENT_SEPARATOR} to signal that each script contains a single statement without a
|
||||
* separator.
|
||||
@@ -173,7 +173,7 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
||||
|
||||
/**
|
||||
* Set the prefix that identifies single-line comments within the SQL scripts.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Defaults to {@code "--"}.
|
||||
*
|
||||
* @param commentPrefix the prefix for single-line comments
|
||||
@@ -184,7 +184,7 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
||||
|
||||
/**
|
||||
* Set the start delimiter that identifies block comments within the SQL scripts.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Defaults to {@code "/*"}.
|
||||
*
|
||||
* @param blockCommentStartDelimiter the start delimiter for block comments (never {@literal null} or empty).
|
||||
@@ -199,7 +199,7 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
||||
|
||||
/**
|
||||
* Set the end delimiter that identifies block comments within the SQL scripts.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Defaults to {@code "*/"}.
|
||||
*
|
||||
* @param blockCommentEndDelimiter the end delimiter for block comments (never {@literal null} or empty)
|
||||
@@ -214,7 +214,7 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
||||
|
||||
/**
|
||||
* Flag to indicate that all failures in SQL should be logged but not cause a failure.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Defaults to {@literal false}.
|
||||
*
|
||||
* @param continueOnError {@literal true} if script execution should continue on error.
|
||||
@@ -225,10 +225,10 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
||||
|
||||
/**
|
||||
* Flag to indicate that a failed SQL {@code DROP} statement can be ignored.
|
||||
* <p/>
|
||||
* <p>
|
||||
* This is useful for a non-embedded database whose SQL dialect does not support an {@code IF EXISTS} clause in a
|
||||
* {@code DROP} statement.
|
||||
* <p/>
|
||||
* <p>
|
||||
* The default is {@literal false} so that if the populator runs accidentally, it will fail fast if a script starts
|
||||
* with a {@code DROP} statement.
|
||||
*
|
||||
@@ -240,7 +240,7 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
||||
|
||||
/**
|
||||
* Set the {@link DataBufferFactory} to use for {@link Resource} loading.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Defaults to {@link DefaultDataBufferFactory}.
|
||||
*
|
||||
* @param dataBufferFactory the {@link DataBufferFactory} to use, must not be {@literal null}.
|
||||
@@ -269,7 +269,7 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
||||
|
||||
/**
|
||||
* Execute this {@link ResourceDatabasePopulator} against the given {@link ConnectionFactory}.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Delegates to {@link DatabasePopulatorUtils#execute}.
|
||||
*
|
||||
* @param connectionFactory the {@link ConnectionFactory} to execute against, must not be {@literal null}..
|
||||
|
||||
@@ -44,7 +44,7 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Generic utility methods for working with SQL scripts.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Mainly for internal use within the framework.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
@@ -61,14 +61,14 @@ public abstract class ScriptUtils {
|
||||
|
||||
/**
|
||||
* Fallback statement separator within SQL scripts: {@code "\n"}.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Used if neither a custom separator nor the {@link #DEFAULT_STATEMENT_SEPARATOR} is present in a given script.
|
||||
*/
|
||||
public static final String FALLBACK_STATEMENT_SEPARATOR = "\n";
|
||||
|
||||
/**
|
||||
* End of file (EOF) SQL statement separator: {@code "^^^ END OF SCRIPT ^^^"}.
|
||||
* <p/>
|
||||
* <p>
|
||||
* This value may be supplied as the {@code separator} to
|
||||
* {@link #executeSqlScript(Connection, EncodedResource, DataBufferFactory, boolean, boolean, String, String, String, String)}
|
||||
* to denote that an SQL script contains a single statement (potentially spanning multiple lines) with no explicit
|
||||
@@ -100,7 +100,7 @@ public abstract class ScriptUtils {
|
||||
/**
|
||||
* Split an SQL script into separate statements delimited by the provided separator character. Each individual
|
||||
* statement will be added to the provided {@link List}.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Within the script, {@value #DEFAULT_COMMENT_PREFIX} will be used as the comment prefix; any text beginning with the
|
||||
* comment prefix and extending to the end of the line will be omitted from the output. Similarly,
|
||||
* {@value #DEFAULT_BLOCK_COMMENT_START_DELIMITER} and {@value #DEFAULT_BLOCK_COMMENT_END_DELIMITER} will be used as
|
||||
@@ -121,7 +121,7 @@ public abstract class ScriptUtils {
|
||||
/**
|
||||
* Split an SQL script into separate statements delimited by the provided separator string. Each individual statement
|
||||
* will be added to the provided {@link List}.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Within the script, {@value #DEFAULT_COMMENT_PREFIX} will be used as the comment prefix; any text beginning with the
|
||||
* comment prefix and extending to the end of the line will be omitted from the output. Similarly,
|
||||
* {@value #DEFAULT_BLOCK_COMMENT_START_DELIMITER} and {@value #DEFAULT_BLOCK_COMMENT_END_DELIMITER} will be used as
|
||||
@@ -143,7 +143,7 @@ public abstract class ScriptUtils {
|
||||
/**
|
||||
* Split an SQL script into separate statements delimited by the provided separator string. Each individual statement
|
||||
* will be added to the provided {@link List}.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Within the script, the provided {@code commentPrefix} will be honored: any text beginning with the comment prefix
|
||||
* and extending to the end of the line will be omitted from the output. Similarly, the provided
|
||||
* {@code blockCommentStartDelimiter} and {@code blockCommentEndDelimiter} delimiters will be honored: any text
|
||||
@@ -255,7 +255,7 @@ public abstract class ScriptUtils {
|
||||
/**
|
||||
* Read a script without blocking from the provided resource, using the supplied comment prefix and statement
|
||||
* separator, and build a {@link String} and build a String containing the lines.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Lines <em>beginning</em> with the comment prefix are excluded from the results; however, line comments anywhere
|
||||
* else — for example, within a statement — will be included in the results.
|
||||
*
|
||||
@@ -291,7 +291,7 @@ public abstract class ScriptUtils {
|
||||
/**
|
||||
* Read a script from the provided {@link LineNumberReader}, using the supplied comment prefix and statement
|
||||
* separator, and build a {@link String} containing the lines.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Lines <em>beginning</em> with the comment prefix are excluded from the results; however, line comments anywhere
|
||||
* else — for example, within a statement — will be included in the results.
|
||||
*
|
||||
@@ -372,10 +372,10 @@ public abstract class ScriptUtils {
|
||||
/**
|
||||
* Execute the given SQL script using default settings for statement separators, comment delimiters, and exception
|
||||
* handling flags.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Statement separators and comments will be removed before executing individual statements within the supplied
|
||||
* script.
|
||||
* <p/>
|
||||
* <p>
|
||||
* <strong>Warning</strong>: this method does <em>not</em> release the provided {@link Connection}.
|
||||
*
|
||||
* @param connection the R2DBC connection to use to execute the script; already configured and ready to use.
|
||||
@@ -398,10 +398,10 @@ public abstract class ScriptUtils {
|
||||
/**
|
||||
* Execute the given SQL script using default settings for statement separators, comment delimiters, and exception
|
||||
* handling flags.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Statement separators and comments will be removed before executing individual statements within the supplied
|
||||
* script.
|
||||
* <p/>
|
||||
* <p>
|
||||
* <strong>Warning</strong>: this method does <em>not</em> release the provided {@link Connection}.
|
||||
*
|
||||
* @param connection the R2DBC connection to use to execute the script; already configured and ready to use.
|
||||
@@ -424,10 +424,10 @@ public abstract class ScriptUtils {
|
||||
|
||||
/**
|
||||
* Execute the given SQL script.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Statement separators and comments will be removed before executing individual statements within the supplied
|
||||
* script.
|
||||
* <p/>
|
||||
* <p>
|
||||
* <strong>Warning</strong>: this method does <em>not</em> release the provided {@link Connection}.
|
||||
*
|
||||
* @param connection the R2DBC connection to use to execute the script; already configured and ready to use.
|
||||
|
||||
@@ -76,7 +76,7 @@ public interface R2dbcConverter
|
||||
* Return whether the {@code type} is a simple type. Simple types are database primitives or types with a custom
|
||||
* mapping strategy.
|
||||
*
|
||||
* @param valueType the type to inspect, must not be {@literal null}.
|
||||
* @param type the type to inspect, must not be {@literal null}.
|
||||
* @return {@literal true} if the type is a simple one.
|
||||
* @see org.springframework.data.mapping.model.SimpleTypeHolder
|
||||
* @since 1.2
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.dao.DataAccessException;
|
||||
* Interface declaring methods that accept callback {@link Function} to operate within the scope of a
|
||||
* {@link Connection}. Callback functions operate on a provided connection and must not close the connection as the
|
||||
* connections may be pooled or be subject to other kinds of resource management.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Callback functions are responsible for creating a {@link org.reactivestreams.Publisher} that defines the scope of how
|
||||
* long the allocated {@link Connection} is valid. Connections are released after the publisher terminates.
|
||||
*
|
||||
|
||||
@@ -243,7 +243,7 @@ public class R2dbcEntityTemplate implements R2dbcEntityOperations, BeanFactoryAw
|
||||
* Set the {@link ReactiveEntityCallbacks} instance to use when invoking
|
||||
* {@link org.springframework.data.mapping.callback.ReactiveEntityCallbacks callbacks} like the
|
||||
* {@link BeforeSaveCallback}.
|
||||
* <p />
|
||||
* <p>
|
||||
* Overrides potentially existing {@link ReactiveEntityCallbacks}.
|
||||
*
|
||||
* @param entityCallbacks must not be {@literal null}.
|
||||
|
||||
@@ -4,7 +4,7 @@ package org.springframework.data.r2dbc.dialect;
|
||||
* Bind markers represent placeholders in SQL queries for substitution for an actual parameter. Using bind markers
|
||||
* allows creating safe queries so query strings are not required to contain escaped values but rather the driver
|
||||
* encodes parameter in the appropriate representation.
|
||||
* <p/>
|
||||
* <p>
|
||||
* {@link BindMarkers} is stateful and can be only used for a single binding pass of one or more parameters. It
|
||||
* maintains bind indexes/bind parameter names.
|
||||
*
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* This class creates new {@link BindMarkers} instances to bind parameter for a specific {@link io.r2dbc.spi.Statement}.
|
||||
* <p/>
|
||||
* <p>
|
||||
* 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
|
||||
@@ -106,7 +106,7 @@ public interface BindMarkersFactory extends org.springframework.r2dbc.core.bindi
|
||||
* Create named {@link BindMarkers} using identifiers to bind parameters. Named bind markers can support
|
||||
* {@link BindMarkers#next(String) name hints}. If no {@link BindMarkers#next(String) hint} is given, named bind
|
||||
* markers can use a counter or a random value source to generate unique bind markers.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Allow customization of the bind marker placeholder {@code prefix} and {@code namePrefix} to represent the bind
|
||||
* marker as placeholder within the query.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user