Find Multiple By
Definition
The findMultipleBy
method allows you to get multiple records of a table filtered by the conditions that are supplied.
Available methods
findMultipleBy(KFindFunction<KFrom, KQuery> kFindFunction, KColumnAllowedToSelect... selects)
: Receives aKFindFunction
that allows adding conditions to the base query and a variable quantity of columns and values that will be added to theSELECT
list. Among the possible values are:KTableColumn
,KColumn
,Values
,KCondition
,Columns with over
,Columns with alias
,KRaw
,Case conditional expression
.findMultipleBy(String jdbc, KFindFunction<KFrom, KQuery> kFindFunction, KColumnAllowedToSelect... selects)
: Receives the name of datasource connection to which you need to connect, aKFindFunction
that allows adding conditions to the base query and a variable quantity of columns and values that will be added to theSELECT
list. Among the possible values are:KTableColumn
,KColumn
,Values
,KCondition
,Columns with over
,Columns with alias
,KRaw
,Case conditional expression
.
Example: KFindFunction, KColumnAllowedToSelect...
Java code:
final KCollection<Language> languages =
languageRepository.findMultipleBy(
(KFrom kFrom) ->
kFrom
.where(LANGUAGE.ID.gt(7L)),
LANGUAGE.ID,
LANGUAGE.NAME
);
SQL generated:
SELECT la.id, la.name
FROM language la
WHERE la.id > ?1
Parameters:
- ?1: 7
Example: String, KFindFunction, KColumnAllowedToSelect...
Java code:
final KCollection<Language> languages =
languageRepository.findMultipleBy(
K.JDBC_LEGACY,
(KFrom kFrom) ->
kFrom
.where(LANGUAGE.ID.gt(7L)),
LANGUAGE.ID,
LANGUAGE.NAME
);
SQL generated:
SELECT la.id, la.name
FROM language la
WHERE la.id > ?1
Parameters:
- ?1: 7