public class SelectEngine extends Object
Modifier and Type | Field and Description |
---|---|
private Select |
sql |
private int[] |
tableMap |
private ArrayList |
tasks |
Constructor and Description |
---|
SelectEngine(Select select) |
Modifier and Type | Method and Description |
---|---|
private Data |
aggregateQuery(Data data)
execute an aggregate query
|
Data |
execute() |
private int |
findTableIndex(Table t,
Table[] tables) |
private Task |
fromClause() |
private Data |
getData()
Resolve the from clause to a single set of data
|
private boolean |
isAggregate()
An aggregate query is true if any function is an aggregate function
|
private void |
mergeData(MemoryData memData,
Object[] _row,
int columnIndex,
RewindableData[] datas,
int[] datasColumnCount,
int dataIndex)
merge the data from several datasets to a single dataset
|
private Data |
nonAggregateQuery(Data data)
non aggregate so simply return the column's wanted
running any function requested
|
private Data |
orderBy(Data data)
sort the data
todo: allow for sorting non-memory data
|
private Object |
resolveColumn(Data data,
Object column)
resolve a column down to it's final value
|
private Data |
where(MemoryData data,
Object where)
execute the where clause
|
private boolean |
whereCheckRow(Data data,
Object where)
Check the where constraint against a single row
|
private boolean |
whereCheckRowConditon(Data data,
Condition condition)
Check a condtion portion of the where constraint against a single row
left and right of conditon is either another condition or an equation
|
private boolean |
whereCheckRowEquation(Data data,
Equation eq)
Check an equation portion of the where contraints against a single row
|
private Task |
whereClause(Task task) |
public SelectEngine(Select select)
public Data execute() throws SQLException
SQLException
private Task fromClause()
private boolean isAggregate()
private Data aggregateQuery(Data data) throws SQLException
SQLException
private Data getData() throws SQLException
SQLException
private void mergeData(MemoryData memData, Object[] _row, int columnIndex, RewindableData[] datas, int[] datasColumnCount, int dataIndex) throws SQLException
SQLException
private Data nonAggregateQuery(Data data) throws SQLException
SQLException
private Object resolveColumn(Data data, Object column) throws SQLException
data
- the value from the data setcolumn
- the object from the sql querySQLException
private Data orderBy(Data data)
data
- private Data where(MemoryData data, Object where) throws SQLException
SQLException
private boolean whereCheckRow(Data data, Object where) throws SQLException
data
- where
- SQLException
private boolean whereCheckRowEquation(Data data, Equation eq) throws SQLException
data
- eq
- SQLException
private boolean whereCheckRowConditon(Data data, Condition condition) throws SQLException
data
- condition
- SQLException
Copyright © 2016 Open Microscopy Environment