|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.dbtools.DBSelect<gDBR>
public class DBSelect<gDBR extends DBRecord>
DBSelect
represents an SQL select statement.
Constructor Summary | |
---|---|
DBSelect(DBFactory<gDBR> fact)
Constructor |
|
DBSelect(DBFactory<gDBR> fact,
DBWhere where)
Constructor |
|
DBSelect(DBFactory<gDBR> fact,
java.lang.String where)
Constructor |
Method Summary | |
---|---|
DBWhere |
createDBWhere()
Creates a new DBWhere instance (calling 'setWhere(...)' is still required in order to used the created DBWhere instance for this DBSelect). |
DBFactory<gDBR> |
getFactory()
Gets the table DBFactory instance for this DBSelect |
long |
getLimit()
Gets the defined limit |
long |
getOffset()
Gets the defined offset |
java.lang.String[] |
getOrderByFields()
Gets the order-byte fields |
java.lang.String[] |
getSelectedFields()
Gets the selected fields |
java.lang.String |
getTranslatedTableName()
Gets the table name for this DBSelect |
java.lang.String |
getTranslatedTableName(DBProvider dbp)
Gets the table name for this DBSelect |
java.lang.String |
getUntranslatedTableName()
Gets the table name for this DBSelect |
java.lang.String |
getWhere()
Gets the where clause for this DBSelect |
boolean |
hasFactory()
Returns true if a DBFactory instance has been properly defined for this instance |
boolean |
hasLimit()
Returns true if a limit has been defined for this DBSelect |
boolean |
hasOffset()
Returns true if a offset has been defined for this DBSelect |
boolean |
hasOrderByFields()
Returns true if this DBSelect has order-by fields defined |
boolean |
hasSelectedFields()
Returns true if this DBSelect has selected fields defined |
boolean |
hasWhere()
Returns true if this DBSelect has a defined where clause |
boolean |
isOrderAscending()
Returns true if the ording is ascending, false if descending |
void |
setLastRecordKey(DBRecordKey<gDBR> rcdKey)
Sets the DBRecordKey of the last record retrieved by this DBSelect. Called by DBRecordIterator to allow subclasses of this DBSelect to adjust the selection criteria if necessary. |
void |
setLimit(long limit)
Sets the LIMIT for this DBSelect |
void |
setOffset(long offset)
Sets the OFFSET for this DBSelect |
void |
setOrderAscending(boolean ascending)
Set ascending/descending sort order |
void |
setOrderByFields(java.lang.String... obf)
Sets the order-by fields |
void |
setSelectedFields(java.util.Set<java.lang.String> sf)
Sets a list of selected fields |
void |
setSelectedFields(java.lang.String... sf)
Sets an array of selected fields |
void |
setUntranslatedTableName(java.lang.String utableName)
Sets the untranslated table name for this DBSelect (if not set, the table name of the defined DBFactory will be used). |
void |
setWhere(DBWhere wh)
Sets the DBWhere instance used for this DBSelect |
void |
setWhere(java.lang.String wh)
Sets the where clause used for this DBSelect |
boolean |
supportsLimit()
Returns true if the DBProvider supports a LIMIT clause |
boolean |
supportsOffset()
Returns true if the DBProvider supports a OFFSET clause |
java.lang.String |
toString()
Returns the DBSelect statement as a String representation |
java.lang.String |
toString(java.lang.String dbpName)
Returns the DBSelect statement as a String representation, for the specified DBProvider name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DBSelect(DBFactory<gDBR> fact)
fact
- The table DBFactory instancepublic DBSelect(DBFactory<gDBR> fact, java.lang.String where)
fact
- The table DBFactory instancewhere
- The initial selection SQL 'WHERE' clausepublic DBSelect(DBFactory<gDBR> fact, DBWhere where)
fact
- The table DBFactory instancewhere
- The initial selection SQL 'WHERE' clauseMethod Detail |
---|
public boolean hasFactory()
public DBFactory<gDBR> getFactory()
public void setSelectedFields(java.util.Set<java.lang.String> sf)
sf
- An Set of field names to selectpublic void setSelectedFields(java.lang.String... sf)
sf
- An array of field names to selectpublic boolean hasSelectedFields()
public java.lang.String[] getSelectedFields()
public void setUntranslatedTableName(java.lang.String utableName)
utableName
- The untranslated table namepublic java.lang.String getUntranslatedTableName()
public java.lang.String getTranslatedTableName(DBProvider dbp)
public java.lang.String getTranslatedTableName()
public DBWhere createDBWhere()
public void setWhere(DBWhere wh)
wh
- The DBWhere instance used for this DBSelectpublic void setWhere(java.lang.String wh)
wh
- The where clause used for this DBSelectpublic boolean hasWhere()
public java.lang.String getWhere()
public void setOrderByFields(java.lang.String... obf)
obf
- The field names by which the returned results set will be sortedpublic boolean hasOrderByFields()
public void setOrderAscending(boolean ascending)
ascending
- True to sort ascending, false to sort descendingpublic boolean isOrderAscending()
public java.lang.String[] getOrderByFields()
public boolean supportsLimit()
public void setLimit(long limit)
limit
- The record limitpublic boolean hasLimit()
public long getLimit()
public boolean supportsOffset()
public void setOffset(long offset)
offset
- The record offsetpublic boolean hasOffset()
public long getOffset()
public void setLastRecordKey(DBRecordKey<gDBR> rcdKey)
rcdKey
- The DBRecordKey of the last record retrieved by this DBSelect.public java.lang.String toString(java.lang.String dbpName)
dbpName
- The DBProvider name
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |