Class StatementMapper.SelectSpec
java.lang.Object
org.springframework.data.r2dbc.core.StatementMapper.SelectSpec
- Enclosing interface:
- StatementMapper
SELECT specification.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSelectSpec(org.springframework.data.relational.core.sql.Table table, List<String> projectedFields, List<org.springframework.data.relational.core.sql.Expression> selectList, org.springframework.data.relational.core.query.CriteriaDefinition criteria, Sort sort, int limit, long offset, boolean distinct, org.springframework.data.relational.core.sql.LockMode lockMode) -
Method Summary
Modifier and TypeMethodDescriptionstatic StatementMapper.SelectSpecCreate anSELECTspecification fortable.static StatementMapper.SelectSpeccreate(org.springframework.data.relational.core.sql.SqlIdentifier table) Create anSELECTspecification fortable.distinct()Associate a result statement distinct with the select and create a newStatementMapper.SelectSpec.doWithTable(BiFunction<org.springframework.data.relational.core.sql.Table, StatementMapper.SelectSpec, StatementMapper.SelectSpec> function) org.springframework.data.relational.core.query.CriteriaDefinitionintgetLimit()org.springframework.data.relational.core.sql.LockModegetLock()The used lockmodelongDeprecated.List<org.springframework.data.relational.core.sql.Expression>getSort()org.springframework.data.relational.core.sql.TablegetTable()booleanlimit(int limit) Associate a result limit with the select and create a newStatementMapper.SelectSpec.lock(org.springframework.data.relational.core.sql.LockMode lockMode) Associate a lock mode with the select and create a newStatementMapper.SelectSpec.offset(long offset) Associate a result offset with the select and create a newStatementMapper.SelectSpec.withCriteria(org.springframework.data.relational.core.query.CriteriaDefinition criteria) Associate aCriteriawith the select and return a newStatementMapper.SelectSpec.Associate aPageablewith the select and create a newStatementMapper.SelectSpec.withProjection(String... projectedFields) AssociateprojectedFieldswith the select and create a newStatementMapper.SelectSpec.withProjection(Collection<org.springframework.data.relational.core.sql.Expression> projectedFields) AssociateprojectedFieldswith the select and create a newStatementMapper.SelectSpec.withProjection(org.springframework.data.relational.core.sql.Expression... expressions) Associateexpressionswith the select list and create a newStatementMapper.SelectSpec.withProjection(org.springframework.data.relational.core.sql.SqlIdentifier... projectedFields) AssociateprojectedFieldswith the select and create a newStatementMapper.SelectSpec.AssociateSortwith the select and create a newStatementMapper.SelectSpec.
-
Constructor Details
-
SelectSpec
protected SelectSpec(org.springframework.data.relational.core.sql.Table table, List<String> projectedFields, List<org.springframework.data.relational.core.sql.Expression> selectList, @Nullable org.springframework.data.relational.core.query.CriteriaDefinition criteria, Sort sort, int limit, long offset, boolean distinct, org.springframework.data.relational.core.sql.LockMode lockMode)
-
-
Method Details
-
create
Create anSELECTspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.SelectSpec.
-
create
public static StatementMapper.SelectSpec create(org.springframework.data.relational.core.sql.SqlIdentifier table) Create anSELECTspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.SelectSpec. - Since:
- 1.1
-
doWithTable
public StatementMapper.SelectSpec doWithTable(BiFunction<org.springframework.data.relational.core.sql.Table, StatementMapper.SelectSpec, StatementMapper.SelectSpec> function) -
withProjection
AssociateprojectedFieldswith the select and create a newStatementMapper.SelectSpec.- Parameters:
projectedFields-- Returns:
- the
StatementMapper.SelectSpec. - Since:
- 1.1
-
withProjection
public StatementMapper.SelectSpec withProjection(org.springframework.data.relational.core.sql.SqlIdentifier... projectedFields) AssociateprojectedFieldswith the select and create a newStatementMapper.SelectSpec.- Parameters:
projectedFields-- Returns:
- the
StatementMapper.SelectSpec. - Since:
- 1.1
-
withProjection
public StatementMapper.SelectSpec withProjection(org.springframework.data.relational.core.sql.Expression... expressions) Associateexpressionswith the select list and create a newStatementMapper.SelectSpec.- Parameters:
expressions-- Returns:
- the
StatementMapper.SelectSpec. - Since:
- 1.1
-
withProjection
public StatementMapper.SelectSpec withProjection(Collection<org.springframework.data.relational.core.sql.Expression> projectedFields) AssociateprojectedFieldswith the select and create a newStatementMapper.SelectSpec.- Parameters:
projectedFields-- Returns:
- the
StatementMapper.SelectSpec. - Since:
- 1.1
-
withCriteria
public StatementMapper.SelectSpec withCriteria(org.springframework.data.relational.core.query.CriteriaDefinition criteria) Associate aCriteriawith the select and return a newStatementMapper.SelectSpec.- Parameters:
criteria-- Returns:
- the
StatementMapper.SelectSpec.
-
withSort
AssociateSortwith the select and create a newStatementMapper.SelectSpec.- Parameters:
sort-- Returns:
- the
StatementMapper.SelectSpec.
-
withPage
Associate aPageablewith the select and create a newStatementMapper.SelectSpec.- Parameters:
page-- Returns:
- the
StatementMapper.SelectSpec.
-
offset
Associate a result offset with the select and create a newStatementMapper.SelectSpec.- Parameters:
offset-- Returns:
- the
StatementMapper.SelectSpec.
-
limit
Associate a result limit with the select and create a newStatementMapper.SelectSpec.- Parameters:
limit-- Returns:
- the
StatementMapper.SelectSpec.
-
distinct
Associate a result statement distinct with the select and create a newStatementMapper.SelectSpec.- Returns:
- the
StatementMapper.SelectSpec.
-
lock
public StatementMapper.SelectSpec lock(org.springframework.data.relational.core.sql.LockMode lockMode) Associate a lock mode with the select and create a newStatementMapper.SelectSpec.- Parameters:
lockMode- theLockModewe want to use. This might be null- Returns:
- the
StatementMapper.SelectSpec.
-
getLock
The used lockmode- Returns:
- might be null if no lockmode defined.
-
getTable
public org.springframework.data.relational.core.sql.Table getTable() -
getProjectedFields
Deprecated.since 1.1, usegetSelectList()instead.- Returns:
-
getSelectList
-
getCriteria
-
getSort
-
getOffset
public long getOffset() -
getLimit
public int getLimit() -
isDistinct
public boolean isDistinct()
-
getSelectList()instead.