public class AmberSelectQuery extends AbstractQuery
_embeddedAliases, _fromList
Modifier and Type | Method and Description |
---|---|
boolean |
exists(FromItem item)
Returns true if the item must have at least one entry in the database.
|
java.lang.String |
generateLoadSQL() |
java.lang.String |
generateLoadSQL(boolean fullSelect)
Generates the load SQL.
|
long |
getCacheMaxAge()
Returns the expire time.
|
java.lang.Class |
getConstructorClass()
Gets the constructor class for SELECT NEW.
|
int |
getLimit()
Gets the LIMIT value.
|
int |
getOffset()
Gets the OFFSET value.
|
AbstractQuery |
getParentQuery()
Gets the parent query.
|
java.util.ArrayList<AmberExpr> |
getResultList()
Returns the result list.
|
java.lang.String |
getSQL()
Returns the id load sql
|
boolean |
invalidateTable(java.lang.String table)
Returns true if modifying the given table modifies a cached query.
|
boolean |
isCacheable()
Returns true for cacheable queries.
|
boolean |
isTableReadOnly()
Are the tables read-only
|
void |
setLimit(int limit)
Sets the LIMIT value.
|
void |
setOffset(int offset)
Sets the OFFSET value.
|
java.lang.String |
toString()
Debug view.
|
boolean |
usesFrom(FromItem item,
int type)
Returns true if the from item is used by the query.
|
addEmbeddedAlias, complete, createDependentFromItem, createFromItem, createFromItem, getArgList, getEmbeddedAliases, getFromList, getPreparedMapping, getQueryString, hasSubQuery, prepare, setHasSubQuery
public java.lang.Class getConstructorClass()
public AbstractQuery getParentQuery()
getParentQuery
in class AbstractQuery
public java.util.ArrayList<AmberExpr> getResultList()
public java.lang.String getSQL()
getSQL
in class AbstractQuery
public long getCacheMaxAge()
getCacheMaxAge
in class AbstractQuery
public boolean isCacheable()
public boolean isTableReadOnly()
public void setOffset(int offset)
public int getOffset()
public void setLimit(int limit)
public int getLimit()
public boolean exists(FromItem item)
exists
in class AbstractQuery
public boolean usesFrom(FromItem item, int type)
usesFrom
in class AbstractQuery
public java.lang.String generateLoadSQL()
public java.lang.String generateLoadSQL(boolean fullSelect)
fullSelect
- true if the load entity expressions
should be fully loaded for all entity
fields. Otherwise, only the entity id
will be loaded: select o.id from ...
It is implemented to optimize the SQL
and allow for databases that only
support single columns in subqueries.
Derby is an example. An additional
condition to generate only the o.id
is the absence of group by. If there
is a group by the full select will
always be generated.
See also com.caucho.amber.expr.ExistsExprpublic boolean invalidateTable(java.lang.String table)
public java.lang.String toString()
toString
in class java.lang.Object