AnyLogic
Expand
Font size

public class SelectQuery
extends Object
SelectQuery for building and execution of SELECT SQL statements

Constructor Summary

ConstructorDescription
SelectQuery(ModelDatabase database, com.querydsl.sql.RelationalPathBase<?> table, Utilities owner) 

Method Summary

Modifier and TypeMethodDescription
double[]arrayOfDouble(com.querydsl.core.types.Expression<? extends Number> valueColumn)
Executes the given SELECT query which should return 1 column with numbers.
int[]arrayOfInt(com.querydsl.core.types.Expression<? extends Number> valueColumn)
Executes the given SELECT query which should return 1 column with numbers.
longcount()
This function caches its results, to speed up default behavior Use count(false) to get non cached result every time
longcount(boolean cached) 
SelectQuerydistinct()
Set the SelectQuery to return distinct results
com.querydsl.core.types.dsl.BooleanExpressionexists()
Exists is used to test for the existence of any record in a subquery.
com.querydsl.core.TuplefirstResult(boolean cached, com.querydsl.core.types.Expression<?>... columns)
Returns first result for the given SelectQuery or null if no result is found This function caches its results, to speed up default behavior Use firstResult(columns) to get non cached result every time
<RT> RTfirstResult(boolean cached, com.querydsl.core.types.Expression<RT> column)
Returns first result for the given SelectQuery or null if no result is found
<RT, T> RTfirstResult(boolean cached, com.querydsl.core.types.Expression<T> column, Class<RT> returnType)
Returns first result for the given SelectQuery or null if no result is found
com.querydsl.core.TuplefirstResult(com.querydsl.core.types.Expression<?>... columns)
Returns first result for the given SelectQuery or null if no result is found This function caches its results, to speed up default behavior Use firstResult(columns) to get non cached result every time
<RT> RTfirstResult(com.querydsl.core.types.Expression<RT> column)
Returns first result for the given SelectQuery or null if no result is found This function caches its results, to speed up default behavior Use firstResult(false, column) to get non cached result every time
<RT, T> RTfirstResult(com.querydsl.core.types.Expression<T> column, Class<RT> returnType)
Returns first result for the given SelectQuery or null if no result is found This function caches its results, to speed up default behavior Use firstResult(false, column, returnType) to get non cached result every time
SelectQueryfullJoin(com.querydsl.core.types.EntityPath<?> table)
Adds a full join to query
<E> SelectQueryfullJoin(com.querydsl.sql.ForeignKey<E> key, com.querydsl.sql.RelationalPath<E> table)
Adds a full join to query
com.querydsl.sql.SQLQuery<com.querydsl.core.Tuple>getDSLQuery() 
ResultSetgetResults(com.querydsl.core.types.Expression<?>... columns)
Get the results as an JDBC result set
com.querydsl.sql.SQLBindingsgetSQL(com.querydsl.core.types.Expression<?>... columns)
Get the query as an SQL query string and parameters
SelectQuerygroupBy(com.querydsl.core.types.Expression<?> column)
Defines GROUP BY statement column
SelectQuerygroupBy(com.querydsl.core.types.Expression<?>... columns)
Defines GROUP BY statement columns
booleanhasResults()
This function caches its results, to speed up default behavior Use exists(false) to get non cached result every time
booleanhasResults(boolean cached) 
SelectQueryinnerJoin(com.querydsl.core.types.EntityPath<?> table)
Adds an inner join to query
<E> SelectQueryinnerJoin(com.querydsl.sql.ForeignKey<E> key, com.querydsl.sql.RelationalPath<E> table)
Adds an inner join to query
SelectQueryjoin(com.querydsl.core.types.EntityPath<?> table)
Adds a join to query
<E> SelectQueryjoin(com.querydsl.sql.ForeignKey<E> key, com.querydsl.sql.RelationalPath<E> table)
Adds a join to query
SelectQueryleftJoin(com.querydsl.core.types.EntityPath<?> table)
Adds a left join to query
<E> SelectQueryleftJoin(com.querydsl.sql.ForeignKey<E> key, com.querydsl.sql.RelationalPath<E> table)
Adds a left join to query
SelectQuerylimit(long limit)
Defines the maximum number of rows for the selection results
List<com.querydsl.core.Tuple>list()
List the results for columns of origin table we select from An empty list is returned for no results.
List<com.querydsl.core.Tuple>list(com.querydsl.core.types.Expression<?>... columns)
List the results for given columns of SelectQuery An empty list is returned for no results.
<RT> List<RT>list(com.querydsl.core.types.Expression<RT> column)
List the results for given column of SelectQuery An empty list is returned for no results.
SelectQueryoffset(long offset)
Defines the offset for the selection results
SelectQueryon(com.querydsl.core.types.Predicate condition)
Defines a condition to the last added join
SelectQueryon(com.querydsl.core.types.Predicate... conditions)
Defines a conditions to the last added join
SelectQueryorderBy(com.querydsl.core.types.OrderSpecifier<?> orderSpecifier)
Defines ORDER BY specifier
SelectQueryorderBy(com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)
Defines ORDER BY specifiers
SelectQueryrightJoin(com.querydsl.core.types.EntityPath<?> table)
Adds a right join to query
<E> SelectQueryrightJoin(com.querydsl.sql.ForeignKey<E> key, com.querydsl.sql.RelationalPath<E> table)
Adds a right join to query
TableFunctiontableFunction(TableFunction tableFunction, com.querydsl.core.types.Expression<? extends Number> argumentColumn, com.querydsl.core.types.Expression<? extends Number> valueColumn)
Executes the given SELECT query which should return 2 columns of data: the first column contains arguments numbers, the second column contains values numbers.
com.querydsl.core.TupleuniqueResult(boolean cached, com.querydsl.core.types.Expression<?>... columns)
Returns a unique result for the given SelectQuery This function caches its results, to speed up default behavior Use uniqueResult(columns) to get non cached result every time
<RT> RTuniqueResult(boolean cached, com.querydsl.core.types.Expression<RT> column)
Returns an unique result for the given SelectQuery
<RT, T> RTuniqueResult(boolean cached, com.querydsl.core.types.Expression<T> column, Class<RT> returnType)
Returns an unique result for the given SelectQuery
com.querydsl.core.TupleuniqueResult(com.querydsl.core.types.Expression<?>... columns)
Returns a unique result for the given SelectQuery This function caches its results, to speed up default behavior Use uniqueResult(columns) to get non cached result every time
<RT> RTuniqueResult(com.querydsl.core.types.Expression<RT> column)
Returns an unique result for the given SelectQuery This function caches its results, to speed up default behavior Use uniqueResult(false, column) to get non cached result every time
<RT, T> RTuniqueResult(com.querydsl.core.types.Expression<T> column, Class<RT> returnType)
Returns an unique result for the given SelectQuery This function caches its results, to speed up default behavior Use uniqueResult(false, column, returnType) to get non cached result every time
SelectQuerywhere(com.querydsl.core.types.Predicate condition)
Add condition for selection results
SelectQuerywhere(com.querydsl.core.types.Predicate... conditions)
Add conditions for selection results

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

SelectQuery

@AnyLogicInternalAPI
public SelectQuery(ModelDatabase database,
 com.querydsl.sql.RelationalPathBase<?> table,
 Utilities owner)

Method Details

getDSLQuery

@AnyLogicInternalAPI
public com.querydsl.sql.SQLQuery<com.querydsl.core.Tuple> getDSLQuery()

list

public List<com.querydsl.core.Tuple> list()
List the results for columns of origin table we select from An empty list is returned for no results.
Returns:
List list of resulting tuples that contain according values

list

public <RT> List<RT> list(com.querydsl.core.types.Expression<RT> column)
List the results for given column of SelectQuery An empty list is returned for no results.
Parameters:
column - resulting column
Returns:
List list of resulting values

getSQL

public com.querydsl.sql.SQLBindings getSQL(com.querydsl.core.types.Expression<?>... columns)
Get the query as an SQL query string and parameters
Parameters:
columns - to select
Returns:
SQLBindings containing SQL query string and its parameters

getResults

public ResultSet getResults(com.querydsl.core.types.Expression<?>... columns)
Get the results as an JDBC result set
Parameters:
columns - to select
Returns:
selected ResultSet

count

public long count()
This function caches its results, to speed up default behavior Use count(false) to get non cached result every time
Returns:
number of rows matching the given criteria

count

public long count(boolean cached)
Parameters:
cached - if true, then this method will try to use cached values to avoid database access
Returns:
number of rows matching the given criteria

distinct

public SelectQuery distinct()
Set the SelectQuery to return distinct results
Returns:
SelectQuery

exists

public com.querydsl.core.types.dsl.BooleanExpression exists()
Exists is used to test for the existence of any record in a subquery. To check that there are rows with the given select criteria use hasResults()
Returns:
BooleanExpression

hasResults

public boolean hasResults()
This function caches its results, to speed up default behavior Use exists(false) to get non cached result every time
Returns:
true, if at least one row matching the given criteria exists, otherwise false

hasResults

public boolean hasResults(boolean cached)
Parameters:
cached - if true, then this method will try to use cached values to avoid database access
Returns:
true, if at least one row matching the given criteria exists, otherwise false

fullJoin

public SelectQuery fullJoin(com.querydsl.core.types.EntityPath<?> table)
Adds a full join to query
Parameters:
table - table to join
Returns:
SelectQuery

fullJoin

public <E> SelectQuery fullJoin(com.querydsl.sql.ForeignKey<E> key,
 com.querydsl.sql.RelationalPath<E> table)
Adds a full join to query
Parameters:
key - foreign key to make join
table - table to join
Returns:
SelectQuery

groupBy

public SelectQuery groupBy(com.querydsl.core.types.Expression<?>... columns)
Defines GROUP BY statement columns
Parameters:
columns - for grouping
Returns:
SelectQuery

groupBy

public SelectQuery groupBy(com.querydsl.core.types.Expression<?> column)
Defines GROUP BY statement column
Parameters:
column - for grouping
Returns:
SelectQuery

innerJoin

public SelectQuery innerJoin(com.querydsl.core.types.EntityPath<?> table)
Adds an inner join to query
Parameters:
table - table to join
Returns:
SelectQuery

innerJoin

public <E> SelectQuery innerJoin(com.querydsl.sql.ForeignKey<E> key,
 com.querydsl.sql.RelationalPath<E> table)
Adds an inner join to query
Parameters:
key - foreign key to make join
table - table to join
Returns:
SelectQuery

join

public SelectQuery join(com.querydsl.core.types.EntityPath<?> table)
Adds a join to query
Parameters:
table - table to join
Returns:
SelectQuery

join

public <E> SelectQuery join(com.querydsl.sql.ForeignKey<E> key,
 com.querydsl.sql.RelationalPath<E> table)
Adds a join to query
Parameters:
key - foreign key to make join
table - table to join
Returns:
SelectQuery

leftJoin

public SelectQuery leftJoin(com.querydsl.core.types.EntityPath<?> table)
Adds a left join to query
Parameters:
table - table to join
Returns:
SelectQuery

leftJoin

public <E> SelectQuery leftJoin(com.querydsl.sql.ForeignKey<E> key,
 com.querydsl.sql.RelationalPath<E> table)
Adds a left join to query
Parameters:
key - foreign key to make join
table - table to join
Returns:
SelectQuery

limit

public SelectQuery limit(long limit)
Defines the maximum number of rows for the selection results
Parameters:
limit - maximum number of rows
Returns:
SelectQuery

list

public List<com.querydsl.core.Tuple> list(com.querydsl.core.types.Expression<?>... columns)
List the results for given columns of SelectQuery An empty list is returned for no results.
Parameters:
columns - resulting columns
Returns:
List list of resulting tuples that contain according values

offset

public SelectQuery offset(long offset)
Defines the offset for the selection results
Parameters:
offset -
Returns:
SelectQuery

on

public SelectQuery on(com.querydsl.core.types.Predicate... conditions)
Defines a conditions to the last added join
Parameters:
conditions -
Returns:
SelectQuery

on

public SelectQuery on(com.querydsl.core.types.Predicate condition)
Defines a condition to the last added join
Parameters:
conditions -
Returns:
SelectQuery

orderBy

public SelectQuery orderBy(com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)
Defines ORDER BY specifiers
Parameters:
orderSpecifiers - order specifiers ( example: db_table.db_column.asc() )
Returns:
SelectQuery

orderBy

public SelectQuery orderBy(com.querydsl.core.types.OrderSpecifier<?> orderSpecifier)
Defines ORDER BY specifier
Parameters:
orderSpecifier - order specifier ( example: db_table.db_column.asc() )
Returns:
SelectQuery

rightJoin

public SelectQuery rightJoin(com.querydsl.core.types.EntityPath<?> table)
Adds a right join to query
Parameters:
table - table to join
Returns:
SelectQuery

rightJoin

public <E> SelectQuery rightJoin(com.querydsl.sql.ForeignKey<E> key,
 com.querydsl.sql.RelationalPath<E> table)
Adds a right join to query
Parameters:
key - foreign key to make join
table - table to join
Returns:
SelectQuery

where

public SelectQuery where(com.querydsl.core.types.Predicate... conditions)
Add conditions for selection results
Returns:
SelectQuery

where

public SelectQuery where(com.querydsl.core.types.Predicate condition)
Add condition for selection results
Returns:
SelectQuery

firstResult

public com.querydsl.core.Tuple firstResult(com.querydsl.core.types.Expression<?>... columns)
Returns first result for the given SelectQuery or null if no result is found This function caches its results, to speed up default behavior Use firstResult(columns) to get non cached result every time
Parameters:
columns - to return as Tuple
Returns:
Tuple containing column values for matching result

uniqueResult

public com.querydsl.core.Tuple uniqueResult(com.querydsl.core.types.Expression<?>... columns)
Returns a unique result for the given SelectQuery This function caches its results, to speed up default behavior Use uniqueResult(columns) to get non cached result every time
Parameters:
columns - to return as Tuple
Returns:
Tuple containing column values for matching result
Throws:
RuntimeException - if there is no matching results or more than one matching result

firstResult

public com.querydsl.core.Tuple firstResult(boolean cached,
 com.querydsl.core.types.Expression<?>... columns)
Returns first result for the given SelectQuery or null if no result is found This function caches its results, to speed up default behavior Use firstResult(columns) to get non cached result every time
Parameters:
cached - if true, then this method will try to use cached values to avoid database access
columns - to return as Tuple
Returns:
Tuple containing column values for matching result

uniqueResult

public com.querydsl.core.Tuple uniqueResult(boolean cached,
 com.querydsl.core.types.Expression<?>... columns)
Returns a unique result for the given SelectQuery This function caches its results, to speed up default behavior Use uniqueResult(columns) to get non cached result every time
Parameters:
cached - if true, then this method will try to use cached values to avoid database access
columns - to return as Tuple
Returns:
Tuple containing column values for matching result
Throws:
RuntimeException - if there is no matching results or more than one matching result

firstResult

public <RT,
T> RT firstResult(com.querydsl.core.types.Expression<T> column,
 Class<RT> returnType)
Returns first result for the given SelectQuery or null if no result is found This function caches its results, to speed up default behavior Use firstResult(false, column, returnType) to get non cached result every time
Parameters:
column - to return
returnType - type required to be returned by this function
Returns:
the resulting value of column

firstResult

public <RT> RT firstResult(com.querydsl.core.types.Expression<RT> column)
Returns first result for the given SelectQuery or null if no result is found This function caches its results, to speed up default behavior Use firstResult(false, column) to get non cached result every time
Parameters:
column - to return
Returns:
the resulting value of column

uniqueResult

public <RT,
T> RT uniqueResult(com.querydsl.core.types.Expression<T> column,
 Class<RT> returnType)
Returns an unique result for the given SelectQuery This function caches its results, to speed up default behavior Use uniqueResult(false, column, returnType) to get non cached result every time
Parameters:
column - to return
returnType - type required to be returned by this function
Returns:
the resulting value of column
Throws:
RuntimeException - if there is no matching results or more than one matching result

uniqueResult

public <RT> RT uniqueResult(com.querydsl.core.types.Expression<RT> column)
Returns an unique result for the given SelectQuery This function caches its results, to speed up default behavior Use uniqueResult(false, column) to get non cached result every time
Parameters:
column - to return
Returns:
the resulting value of column
Throws:
RuntimeException - if there is no matching results or more than one matching result

firstResult

public <RT,
T> RT firstResult(boolean cached,
 com.querydsl.core.types.Expression<T> column,
 Class<RT> returnType)
Returns first result for the given SelectQuery or null if no result is found
Parameters:
cached - if true, then this method will try to use cached values to avoid database access
column - to return
returnType - type required to be returned by this function
Returns:
the resulting value of column

firstResult

public <RT> RT firstResult(boolean cached,
 com.querydsl.core.types.Expression<RT> column)
Returns first result for the given SelectQuery or null if no result is found
Parameters:
cached - if true, then this method will try to use cached values to avoid database access
column - to return
Returns:
the resulting value of column

uniqueResult

public <RT,
T> RT uniqueResult(boolean cached,
 com.querydsl.core.types.Expression<T> column,
 Class<RT> returnType)
Returns an unique result for the given SelectQuery
Parameters:
cached - if true, then this method will try to use cached values to avoid database access
column - to return
returnType - type required to be returned by this function
Returns:
the resulting value of column
Throws:
RuntimeException - if there is no matching results or more than one matching result

uniqueResult

public <RT> RT uniqueResult(boolean cached,
 com.querydsl.core.types.Expression<RT> column)
Returns an unique result for the given SelectQuery
Parameters:
cached - if true, then this method will try to use cached values to avoid database access
column - to return
Returns:
the resulting value of column
Throws:
RuntimeException - if there is no matching results or more than one matching result

tableFunction

public TableFunction tableFunction(TableFunction tableFunction,
 com.querydsl.core.types.Expression<? extends Number> argumentColumn,
 com.querydsl.core.types.Expression<? extends Number> valueColumn)
Executes the given SELECT query which should return 2 columns of data: the first column contains arguments numbers, the second column contains values numbers.
Parameters:
tableFunction - the table function to fill
argumentColumn - column with arguments
valueColumn - column with values
Returns:
the given table function, for convenience

arrayOfDouble

public double[] arrayOfDouble(com.querydsl.core.types.Expression<? extends Number> valueColumn)
Executes the given SELECT query which should return 1 column with numbers. Returns the array of numbers from the column. An empty array is returned for no results
Parameters:
valueColumn - column with values
Returns:
array of 'double' numbers

arrayOfInt

public int[] arrayOfInt(com.querydsl.core.types.Expression<? extends Number> valueColumn)
Executes the given SELECT query which should return 1 column with numbers. Returns the array of numbers from the column. An empty array is returned for no results
Parameters:
valueColumn - column with values
Returns:
array of 'int' numbers