|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dbforms.config.Table org.dbforms.config.Query
public class Query
This class represents the query tag in dbforms-config.xml (dbforms config xml file)
it's derived from the table class and overloads the necessary methods.
Field Summary |
---|
Fields inherited from class org.dbforms.config.Table |
---|
BLOB_CLASSIC, BLOB_INTERCEPTOR, CALC_FIELD, DB_FIELD, SEARCH_FIELD |
Constructor Summary | |
---|---|
Query()
|
Method Summary | |
---|---|
void |
addSearchField(Field field)
adds a Field-Object to this table and puts it into othere datastructure for further references (this method gets called from DbFormsConfig) |
Field |
getField(int fieldId)
returns the Field-Objet with specified id overloaded from Table Specials: 1. if fieldId is in range from search fields, get from search fields 2. |
Field |
getFieldByName(String name)
returns the field-objects as specified by name (or null if no field with the specified name exists in this table) overloaded from Table Specials: 1. |
Vector |
getFields()
returns the vector of fields this table constists of overloaded from Table Specials: if view has field defined, use this otherwise use fields from parent table |
String |
getHaving()
DOCUMENT ME! |
Vector |
getKey()
returns the key of this table (consisting of Field-Objects representing key-fields) overloaded from Table Specials: if key of view is not defined (if view has not defined fields) use keys from parent table |
Hashtable |
getNamesHashtable(String core)
DOCUMENT ME! |
String |
getQueryFrom()
returns the from part of a query. overloaded from Table if from is defind in dbforms-config.xml use this, else method from Table |
protected String |
getQueryOrderBy(FieldValue[] fvOrder)
returns the part of the orderby-clause represented by this FieldValue object. |
String |
getQuerySelect(Vector fieldsToSelect)
returns the select part of a query overloaded from Table extends fieldnames with getting expression |
Vector |
getSearchFields()
Returns the search fields search fields are fields in the query which are only used in the where part, not in the select part |
String |
getSelectQuery(Vector fieldsToSelect,
FieldValue[] fvEqual,
FieldValue[] fvOrder,
String sqlFilter,
int compareMode)
Prepares the Querystring for the select statement Order of parts: 1. |
boolean |
hasDistinctSet()
DOCUMENT ME! |
boolean |
needOrderWithPos()
return OrderWithPos OrderWithPos will be set if - groupBy is set - OrderWithPos is defined in dbforms-config.xml |
int |
populateWhereEqualsClause(FieldValue[] fvEqual,
PreparedStatement ps,
int curCol)
situation: we have built a query (involving the getWhereEqualsClause() method) and now we want to prepare the statemtent - provide actual values for the the '?' |
void |
setDistinct(String value)
DOCUMENT ME! |
void |
setFollowAfterWhere(String followAfterWhere)
Sets the followAfterWhere. |
void |
setFrom(String value)
set from, if defined in dbforms-config-xml (this method gets called from XML-digester) |
void |
setGroupBy(String value)
set groupBy, if defined in dbforms-config-xml (this method gets called from XML-digester) |
void |
setHaving(String value)
DOCUMENT ME! |
void |
setOrderWithPos(String value)
set OrderWithPos, if defined in dbforms-config-xml (this method gets called from XML-digester) if set the ORDER BY statment will use position number instead of field names in ORDER BY |
void |
setWhere(String value)
set whereClause, if defined in dbforms-config-xml (this method gets called from XML-digester) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Query()
Method Detail |
---|
public void setDistinct(String value)
value
- the value to setpublic Field getField(int fieldId)
getField
in class Table
fieldId
- The id of the field to be returned
public Field getFieldByName(String name)
getFieldByName
in class Table
name
- The name of the field
public Vector getFields()
getFields
in class Table
public void setFollowAfterWhere(String followAfterWhere)
followAfterWhere
- The followAfterWhere to setpublic void setFrom(String value)
value
- sql frompublic void setGroupBy(String value)
value
- sql group bypublic void setHaving(String value)
value
- the value to setpublic String getHaving()
public Vector getKey()
getKey
in class Table
public Hashtable getNamesHashtable(String core)
getNamesHashtable
in class Table
core
- starting tag for the fields
public void setOrderWithPos(String value)
value
- sets orderWithPospublic String getQueryFrom()
getQueryFrom
in class Table
public String getQuerySelect(Vector fieldsToSelect)
getQuerySelect
in class Table
fieldsToSelect
- fieldlist
public Vector getSearchFields()
public String getSelectQuery(Vector fieldsToSelect, FieldValue[] fvEqual, FieldValue[] fvOrder, String sqlFilter, int compareMode)
getSelectQuery
in class Table
fieldsToSelect
- vector of fields to be selectedfvEqual
- fieldValues representing values we are looking forfvOrder
- fieldValues representing needs for order clausessqlFilter
- sql condition to and with the where clausecompareMode
- compare mode value for generating the order clause
public void setWhere(String value)
value
- sql wherepublic void addSearchField(Field field) throws Exception
field
- field to add
Exception
- DOCUMENT ME!public boolean hasDistinctSet()
public boolean needOrderWithPos()
public int populateWhereEqualsClause(FieldValue[] fvEqual, PreparedStatement ps, int curCol) throws SQLException
populateWhereEqualsClause
in class Table
fvEqual
- the array of FieldValue objectsps
- the PreparedStatement objectcurCol
- the current PreparedStatement column; points to a
PreparedStatement xxx value
SQLException
- if any error occursprotected String getQueryOrderBy(FieldValue[] fvOrder)
getQueryOrderBy
in class Table
fvOrder
- order list
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |