T - Class that corresponds to a database tablepublic abstract class AbstractStatement<T> extends AbstractQuery
| Constructor and Description |
|---|
AbstractStatement(Class<T> cls,
Connection connection)
Creates a base for a SELECT statement.
|
| Modifier and Type | Method and Description |
|---|---|
<U extends AbstractStatement<T>> |
add(AbstractAndOrConnection<T,U> andOrConnection) |
<S> void |
add(AbstractJoinClause<S,T> joinClause) |
AbstractAndOrConnection<T,AbstractStatement<T>> |
and() |
protected String |
assembleFullSelectQuery()
Creates a fully assembled and executable Select Query.
|
protected String |
assembleQuery()
Assembles the restriction part of the the query.
|
T |
byId(UUID id)
Selects an Object directly by its Id.
|
protected abstract T |
byId(UUID id,
Map<Object,Object> handledObjects)
Selects an Object directly by its Id or returns a cached Object of the
current session.
|
abstract List<T> |
execute() |
abstract List<T> |
execute(Collection<?> args) |
Class<T> |
getType()
Returns the table class for this statement.
|
AbstractAndOrConnection<T,AbstractStatement<T>> |
or() |
AbstractStatement<T> |
query(String whereClause)
Adds a plain SQL Where string to the Query.
|
String |
toString() |
executeQuery, executeQuery, getConnectionpublic AbstractStatement(Class<T> cls, Connection connection)
cls - Class that corresponds to a database tableconnection - Database connectionpublic <U extends AbstractStatement<T>> void add(AbstractAndOrConnection<T,U> andOrConnection)
public <S> void add(AbstractJoinClause<S,T> joinClause)
public AbstractAndOrConnection<T,AbstractStatement<T>> and()
public AbstractAndOrConnection<T,AbstractStatement<T>> or()
public T byId(UUID id)
id - Id of the entryprotected abstract T byId(UUID id, Map<Object,Object> handledObjects)
id - Id of the entryhandledObjects - Object cache of fetched entries in the same sessionprotected String assembleFullSelectQuery()
protected String assembleQuery()
public Class<T> getType()
public AbstractStatement<T> query(String whereClause)
select(Foo.class).query("id = 1").execute()
whereClause - Plain SQL Where part.public abstract List<T> execute(Collection<?> args)
Copyright © 2019. All rights reserved.