AnyLogic
Expand
Font size
Direct Known Subclasses:
SelectQuery

public class SelectQueryBasic<QUERY extends SelectQueryBasic<QUERY>>
extends Object
SelectQuery for building and execution of SELECT SQL statements

Constructor Summary

ConstructorDescription
SelectQueryBasic(ModelDBConnectivity database, com.querydsl.sql.RelationalPathBase<?> table) 

Method Summary

Modifier and TypeMethodDescription
longcount()
This function caches its results, to speed up default behavior Use count(false) to get non cached result every time
longcount(boolean cached) 
QUERYdistinct()
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
QUERYfullJoin(com.querydsl.core.types.EntityPath<?> table)
Adds a full join to query
<E> QUERYfullJoin(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() 
com.querydsl.sql.SQLBindingsgetSQL(com.querydsl.core.types.Expression<?>... columns)
Get the query as an SQL query string and parameters
QUERYgroupBy(com.querydsl.core.types.Expression<?> column)
Defines GROUP BY statement column
QUERYgroupBy(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) 
QUERYinnerJoin(com.querydsl.core.types.EntityPath<?> table)
Adds an inner join to query
<E> QUERYinnerJoin(com.querydsl.sql.ForeignKey<E> key, com.querydsl.sql.RelationalPath<E> table)
Adds an inner join to query
QUERYjoin(com.querydsl.core.types.EntityPath<?> table)
Adds a join to query
<E> QUERYjoin(com.querydsl.sql.ForeignKey<E> key, com.querydsl.sql.RelationalPath<E> table)
Adds a join to query
QUERYleftJoin(com.querydsl.core.types.EntityPath<?> table)
Adds a left join to query
<E> QUERYleftJoin(com.querydsl.sql.ForeignKey<E> key, com.querydsl.sql.RelationalPath<E> table)
Adds a left join to query
QUERYlimit(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.
QUERYoffset(long offset)
Defines the offset for the selection results
QUERYon(com.querydsl.core.types.Predicate condition)
Defines a condition to the last added join
QUERYon(com.querydsl.core.types.Predicate... conditions)
Defines a conditions to the last added join
QUERYorderBy(com.querydsl.core.types.OrderSpecifier<?> orderSpecifier)
Defines ORDER BY specifier
QUERYorderBy(com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)
Defines ORDER BY specifiers
QUERYrightJoin(com.querydsl.core.types.EntityPath<?> table)
Adds a right join to query
<E> QUERYrightJoin(com.querydsl.sql.ForeignKey<E> key, com.querydsl.sql.RelationalPath<E> table)
Adds a right join to query
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
QUERYwhere(com.querydsl.core.types.Predicate condition)
Add condition for selection results
QUERYwhere(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

SelectQueryBasic

@AnyLogicInternalAPI
public SelectQueryBasic(ModelDBConnectivity database,
 com.querydsl.sql.RelationalPathBase<?> table)

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

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 QUERY 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 QUERY fullJoin(com.querydsl.core.types.EntityPath<?> table)
Adds a full join to query
Parameters:
table - table to join
Returns:
SelectQuery

fullJoin

public <E> QUERY 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 QUERY groupBy(com.querydsl.core.types.Expression<?>... columns)
Defines GROUP BY statement columns
Parameters:
columns - for grouping
Returns:
SelectQuery

groupBy

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

innerJoin

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

innerJoin

public <E> QUERY 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 QUERY join(com.querydsl.core.types.EntityPath<?> table)
Adds a join to query
Parameters:
table - table to join
Returns:
SelectQuery

join

public <E> QUERY 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 QUERY leftJoin(com.querydsl.core.types.EntityPath<?> table)
Adds a left join to query
Parameters:
table - table to join
Returns:
SelectQuery

leftJoin

public <E> QUERY 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 QUERY 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 QUERY offset(long offset)
Defines the offset for the selection results
Parameters:
offset -
Returns:
SelectQuery

on

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

on

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

orderBy

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

rightJoin

public <E> QUERY 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 QUERY where(com.querydsl.core.types.Predicate... conditions)
Add conditions for selection results
Returns:
SelectQuery

where

public QUERY 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