RS
- The result set typePS
- The prepared statement typepublic abstract class AbstractSqlRepositoryOperations<RS,PS> extends java.lang.Object implements RepositoryOperations
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractSqlRepositoryOperations.StoredInsert<T>
A stored insert statement.
|
Modifier and Type | Field and Description |
---|---|
protected ResultReader<RS,java.lang.Integer> |
columnIndexResultSetReader |
protected ResultReader<RS,java.lang.String> |
columnNameResultSetReader |
protected static SqlQueryBuilder |
DEFAULT_SQL_BUILDER |
protected java.util.Map<java.lang.Class,Dialect> |
dialects |
protected static java.util.regex.Pattern |
IN_EXPRESSION_PATTERN |
protected static java.lang.String |
NOT_TRUE_EXPRESSION |
protected QueryStatement<PS,java.lang.Integer> |
preparedStatementWriter |
protected static org.slf4j.Logger |
QUERY_LOG |
protected java.util.Map<Dialect,SqlQueryBuilder> |
queryBuilders |
Modifier | Constructor and Description |
---|---|
protected |
AbstractSqlRepositoryOperations(ResultReader<RS,java.lang.String> columnNameResultSetReader,
ResultReader<RS,java.lang.Integer> columnIndexResultSetReader,
QueryStatement<PS,java.lang.Integer> preparedStatementWriter)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
<T> RuntimePersistentEntity<T> |
getEntity(java.lang.Class<T> type)
Retrieves the entity for the given type.
|
protected RuntimePersistentProperty<java.lang.Object> |
getIdReader(java.lang.Object o)
Obtain an ID reader for the given object.
|
protected boolean |
isSqlServerWithoutOrderBy(java.lang.String query,
Dialect dialect)
In the dialect SQL server and is order by required.
|
protected <T> AbstractSqlRepositoryOperations.StoredInsert |
resolveInsert(EntityOperation<T> operation)
Resolve the INSERT for the given
EntityOperation . |
protected <T> void |
setInsertParameters(AbstractSqlRepositoryOperations.StoredInsert<T> insert,
T entity,
PS stmt)
Sets the insert parameters for the given insert, entity and statement.
|
protected void |
setStatementParameter(PS preparedStatement,
int index,
DataType dataType,
java.lang.Object value)
Set the parameter value on the given statement.
|
protected int |
sizeOf(java.lang.Object value)
Compute the size of the given object.
|
protected <T> Sort |
sortById(RuntimePersistentEntity<T> persistentEntity)
Build a sort for ID for the given entity.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
count, deleteAll, executeUpdate, exists, findAll, findAll, findOne, findOne, findPage, findStream, findStream, getQueryHints, persist, persistAll
protected static final org.slf4j.Logger QUERY_LOG
protected static final SqlQueryBuilder DEFAULT_SQL_BUILDER
protected static final java.util.regex.Pattern IN_EXPRESSION_PATTERN
protected static final java.lang.String NOT_TRUE_EXPRESSION
protected final ResultReader<RS,java.lang.String> columnNameResultSetReader
protected final ResultReader<RS,java.lang.Integer> columnIndexResultSetReader
protected final QueryStatement<PS,java.lang.Integer> preparedStatementWriter
protected final java.util.Map<java.lang.Class,Dialect> dialects
protected final java.util.Map<Dialect,SqlQueryBuilder> queryBuilders
protected AbstractSqlRepositoryOperations(ResultReader<RS,java.lang.String> columnNameResultSetReader, ResultReader<RS,java.lang.Integer> columnIndexResultSetReader, QueryStatement<PS,java.lang.Integer> preparedStatementWriter)
columnNameResultSetReader
- The column name result readercolumnIndexResultSetReader
- The column index result readerpreparedStatementWriter
- The prepared statement writer@NonNull public final <T> RuntimePersistentEntity<T> getEntity(@NonNull java.lang.Class<T> type)
RepositoryOperations
getEntity
in interface RepositoryOperations
T
- The generic Typetype
- The typeprotected final <T> void setInsertParameters(@NonNull AbstractSqlRepositoryOperations.StoredInsert<T> insert, @NonNull T entity, @NonNull PS stmt)
T
- The entity typeinsert
- The insertentity
- The entitystmt
- The statement@NonNull protected final <T> AbstractSqlRepositoryOperations.StoredInsert resolveInsert(@NonNull EntityOperation<T> operation)
EntityOperation
.T
- The entity typeoperation
- The operation@NonNull protected final RuntimePersistentProperty<java.lang.Object> getIdReader(@NonNull java.lang.Object o)
o
- The object@NonNull protected final <T> Sort sortById(RuntimePersistentEntity<T> persistentEntity)
T
- The entity typepersistentEntity
- The entityprotected final boolean isSqlServerWithoutOrderBy(java.lang.String query, Dialect dialect)
query
- The querydialect
- The dialectprotected final int sizeOf(java.lang.Object value)
value
- The valueprotected final void setStatementParameter(PS preparedStatement, int index, DataType dataType, java.lang.Object value)
preparedStatement
- The prepared statementindex
- The indexdataType
- The data typevalue
- The value