Class StatementMapper.SelectSpec
java.lang.Object
org.springframework.data.r2dbc.core.StatementMapper.SelectSpec
- Enclosing interface:
- StatementMapper
SELECT
specification.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SelectSpec
(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.SelectSpec
Create anSELECT
specification fortable
.static StatementMapper.SelectSpec
create
(org.springframework.data.relational.core.sql.SqlIdentifier table) Create anSELECT
specification 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.CriteriaDefinition
int
getLimit()
org.springframework.data.relational.core.sql.LockMode
getLock()
The used lockmodelong
Deprecated.List<org.springframework.data.relational.core.sql.Expression>
getSort()
org.springframework.data.relational.core.sql.Table
getTable()
boolean
limit
(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 aCriteria
with the select and return a newStatementMapper.SelectSpec
.Associate aPageable
with the select and create a newStatementMapper.SelectSpec
.withProjection
(String... projectedFields) AssociateprojectedFields
with the select and create a newStatementMapper.SelectSpec
.withProjection
(Collection<org.springframework.data.relational.core.sql.Expression> projectedFields) AssociateprojectedFields
with the select and create a newStatementMapper.SelectSpec
.withProjection
(org.springframework.data.relational.core.sql.Expression... expressions) Associateexpressions
with the select list and create a newStatementMapper.SelectSpec
.withProjection
(org.springframework.data.relational.core.sql.SqlIdentifier... projectedFields) AssociateprojectedFields
with the select and create a newStatementMapper.SelectSpec
.AssociateSort
with 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 anSELECT
specification fortable
.- Parameters:
table
-- Returns:
- the
StatementMapper.SelectSpec
.
-
create
public static StatementMapper.SelectSpec create(org.springframework.data.relational.core.sql.SqlIdentifier table) Create anSELECT
specification 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
AssociateprojectedFields
with 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) AssociateprojectedFields
with 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) Associateexpressions
with 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) AssociateprojectedFields
with 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 aCriteria
with the select and return a newStatementMapper.SelectSpec
.- Parameters:
criteria
-- Returns:
- the
StatementMapper.SelectSpec
.
-
withSort
AssociateSort
with the select and create a newStatementMapper.SelectSpec
.- Parameters:
sort
-- Returns:
- the
StatementMapper.SelectSpec
.
-
withPage
Associate aPageable
with 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
- theLockMode
we 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.