|
SolarMetric Kodo JDO 3.1.6 generated on August 25 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--kodo.jdbc.sql.Select
Abstraction of a SQL SELECT statement.
| Field Summary | |
static int |
BATCH_INNER
Constant indicating to batch the select using an inner join. |
static int |
BATCH_OUTER
Constant indicating to batch the select using an outer join. |
static int |
BATCH_SELECT
Constant indicating to batch the select using a separate select. |
static int |
SUBS_ANY
Constant indicating to select subclasses but without adding any class conditions to the select. |
static int |
SUBS_EXACT
Constant indicating to select this class but without adding any class conditions to the select. |
static int |
SUBS_FALSE
Constant indicating to add conditions to the select to select this class only. |
static int |
SUBS_TRUE
Constant indicating to add conditions to the selcet to select this class and subclasses only. |
| Constructor Summary | |
Select(JDBCConfiguration conf)
Constructor. |
|
| Method Summary | |
void |
addBatchedType(ClassMapping type)
Record that this select is for vrow columns of the given type. |
void |
addJoins(SQLBuffer buf,
Joins joins)
Add SQL for the given joins to the given buffer. |
Joins |
and(Joins joins1,
Joins joins2)
AND the given joins together. |
Select |
batchSelect(Object key,
ClassMapping mapping,
int batchType)
Return SELECT that will be batched with this one, or null if the select cannot be batched for the given mapping and join type. |
void |
clearSelects()
Clears any selected columns or aggregates. |
Collection |
getBatchedKeys()
Return the set of batched select keys. |
Select |
getBatchedSelect(Object key)
Return the batched select for the given key, or null if none. |
JDBCConfiguration |
getConfiguration()
Return the configuration supplied on construction. |
Joins |
getJoins()
Return the joins on this select. |
int |
getJoinSyntax()
The join syntax for this select, as one of the syntax constants from Join. |
List |
getOrderings()
Return a collection of orderings on this statement. |
int |
getResultSetConcurrency()
The result set concurrency, such as ResultSet.CONCUR_READ_ONLY,
or -1 for the default. |
int |
getResultSetType(boolean forUpdate)
The result set type, such as ResultSet.TYPE_FORWARD_ONLY,
or -1 for the default. |
List |
getSelectAliases()
Return the aliases of all selected columns and all selected buffers, in the order they were selected. |
Collection |
getSelectedTableAliases()
Return the set of selected table aliases. |
Collection |
getSelectedTables()
Return the set of selected tables. |
List |
getSelects()
Return all selected columns and buffer ids, in the order they were selected. |
SQLBuffer |
getWhere()
Return the WHERE clause, minus any necessary end joins. |
boolean |
isAggregate()
Return true if this is an aggregate select. |
boolean |
isDistinct()
Return true if this is a SELECT DISTINCT. |
Select |
joinsSelect()
Return a SELECT with the same aliases as this one. |
Joins |
newJoins()
Return a new instance to use for joining. |
Joins |
or(Joins joins1,
Joins joins2)
OR the given joins together. |
void |
orderBy(Column[] cols,
boolean ascending)
Add an ORDER BY clause. |
void |
orderBy(Column[] cols,
boolean ascending,
Joins joins)
Add an ORDER BY clause. |
void |
orderBy(Column col,
boolean ascending)
Add an ORDER BY clause. |
void |
orderBy(Column col,
boolean ascending,
Joins joins)
Add an ORDER BY clause. |
void |
orderBy(SQLBuffer sql,
boolean ascending)
Add an ORDER BY clause. |
void |
orderBy(SQLBuffer sql,
boolean ascending,
Joins joins)
Add an ORDER BY clause. |
Joins |
outer(Joins joins)
Return a join set making the given joins outer joins. |
String |
reserveTableAlias(Table table)
Reserve the next alias for the given table. |
void |
select(ClassMapping mapping,
int subclasses,
JDBCStoreManager store,
JDBCFetchConfiguration fetch,
int batch)
Select the columns of the given mapping, possibly including subclasses. |
void |
select(ClassMapping mapping,
int subclasses,
JDBCStoreManager store,
JDBCFetchConfiguration fetch,
int batch,
Joins joins)
Select the columns of the given mapping, possibly including subclasses. |
void |
select(Column col)
Select the given column. |
void |
select(Column[] cols)
Select the given columns. |
void |
select(Column[] cols,
Joins joins)
Select the given columns. |
void |
select(Column col,
Joins joins)
Select the given column. |
void |
select(SQLBuffer buf,
Object id)
Select the given buffer; the given id object is an identifier to use when retrieving the corresponding value from a Result. |
void |
select(SQLBuffer buf,
Object id,
Joins joins)
Select the given buffer; the given id object is an identifier to use when retrieving the corresponding value from a Result. |
void |
selectPrimaryKey(ClassMapping mapping)
Select the primary key columns of the given mapping, joining to superclasses as necessary to get all columns needed to construct an object id. |
void |
selectPrimaryKey(ClassMapping mapping,
Joins joins)
Select the primary key columns of the given mapping, joining to superclasses as necessary to get all columns needed to construct an object id. |
void |
setAggregate(boolean agg)
Set to true for aggregate selects. |
void |
setJoinSyntax(int joinSyntax)
The join syntax for this select, as one of the syntax constants from Join. |
void |
setResultSetConcurrency(int concur)
The result set concurrency, such as ResultSet.CONCUR_READ_ONLY,
or -1 for the default. |
void |
setResultSetType(int type)
The result set type, such as ResultSet.TYPE_FORWARD_ONLY,
or -1 for the default. |
Select |
subSelect(Joins parentJoins)
Return a subselect of this one. |
SQLBuffer |
toSelect(boolean forUpdate)
Return this select as a SQL statement formatted for the given dictionary. |
SQLBuffer |
toSelectCount()
Return this select as a COUNT SQL statement formatted for the given dictionary. |
String |
toString()
Implement toString to generate SQL string for profiling/debuggging. |
void |
where(Joins joins)
Add the given where conditions. |
void |
where(SQLBuffer sql)
Add the given where conditions. |
void |
where(SQLBuffer sql,
Joins joins)
Add the given where conditions. |
void |
whereForeignKey(ForeignKey fk,
Object oid,
ClassMapping mapping)
Add where conditions setting the given foreign key to the given oid values. |
void |
whereForeignKey(ForeignKey fk,
Object oid,
ClassMapping mapping,
Joins joins)
Add where conditions setting the given foreign key to the given oid values. |
void |
wherePrimaryKey(Object oid,
ClassMapping mapping)
Add where conditions setting the mapping's primary key to the given oid values. |
void |
wherePrimaryKey(Object oid,
ClassMapping mapping,
Joins joins)
Add where conditions setting the mapping's primary key to the given oid values. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int BATCH_INNER
public static final int BATCH_OUTER
public static final int BATCH_SELECT
public static final int SUBS_TRUE
public static final int SUBS_FALSE
public static final int SUBS_ANY
public static final int SUBS_EXACT
| Constructor Detail |
public Select(JDBCConfiguration conf)
| Method Detail |
public JDBCConfiguration getConfiguration()
public SQLBuffer toSelect(boolean forUpdate)
public SQLBuffer toSelectCount()
public boolean isDistinct()
public Collection getSelectedTables()
public Collection getSelectedTableAliases()
public List getSelects()
public List getSelectAliases()
public List getOrderings()
SQLBuffer for the ordering criteria, and
then a string for the order - "ASC" or "DESC".public SQLBuffer getWhere()
public Joins getJoins()
public int getResultSetType(boolean forUpdate)
ResultSet.TYPE_FORWARD_ONLY,
or -1 for the default.public void setResultSetType(int type)
ResultSet.TYPE_FORWARD_ONLY,
or -1 for the default.public int getResultSetConcurrency()
ResultSet.CONCUR_READ_ONLY,
or -1 for the default.public void setResultSetConcurrency(int concur)
ResultSet.CONCUR_READ_ONLY,
or -1 for the default.public int getJoinSyntax()
Join.public void setJoinSyntax(int joinSyntax)
Join.public String reserveTableAlias(Table table)
public boolean isAggregate()
public void setAggregate(boolean agg)
public void select(SQLBuffer buf,
Object id)
Result.
public void select(SQLBuffer buf,
Object id,
Joins joins)
Result.public void select(Column col)
public void select(Column col,
Joins joins)
public void select(Column[] cols)
public void select(Column[] cols,
Joins joins)
public void select(ClassMapping mapping,
int subclasses,
JDBCStoreManager store,
JDBCFetchConfiguration fetch,
int batch)
public void select(ClassMapping mapping,
int subclasses,
JDBCStoreManager store,
JDBCFetchConfiguration fetch,
int batch,
Joins joins)
public void clearSelects()
public void selectPrimaryKey(ClassMapping mapping)
public void selectPrimaryKey(ClassMapping mapping,
Joins joins)
public void wherePrimaryKey(Object oid,
ClassMapping mapping)
public void wherePrimaryKey(Object oid,
ClassMapping mapping,
Joins joins)
public void whereForeignKey(ForeignKey fk,
Object oid,
ClassMapping mapping)
wherePrimaryKey(java.lang.Object, kodo.jdbc.meta.ClassMapping)
public void whereForeignKey(ForeignKey fk,
Object oid,
ClassMapping mapping,
Joins joins)
wherePrimaryKey(java.lang.Object, kodo.jdbc.meta.ClassMapping)public void where(Joins joins)
public void where(SQLBuffer sql)
public void where(SQLBuffer sql,
Joins joins)
public void orderBy(SQLBuffer sql,
boolean ascending)
public void orderBy(SQLBuffer sql,
boolean ascending,
Joins joins)
public void orderBy(Column col,
boolean ascending)
public void orderBy(Column col,
boolean ascending,
Joins joins)
public void orderBy(Column[] cols,
boolean ascending)
public void orderBy(Column[] cols,
boolean ascending,
Joins joins)
public Select subSelect(Joins parentJoins)
public Select joinsSelect()
public Select getBatchedSelect(Object key)
public Collection getBatchedKeys()
public Select batchSelect(Object key,
ClassMapping mapping,
int batchType)
key - the key for the batched selectmapping - the type the select is batchingbatchType - BATCH_INNER, BATCH_OUTER, or
BATCH_SELECTpublic void addBatchedType(ClassMapping type)
public Joins newJoins()
public void addJoins(SQLBuffer buf,
Joins joins)
public Joins and(Joins joins1,
Joins joins2)
public Joins or(Joins joins1,
Joins joins2)
public Joins outer(Joins joins)
public String toString()
toString in class Object
|
SolarMetric Kodo JDO 3.1.6 generated on August 25 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||