public class CriterionDecoder extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CriterionDecoder.Relation
Relation definition
|
| Modifier and Type | Field and Description |
|---|---|
protected MetaTable |
baseTable |
protected org.ujorm.criterion.Criterion |
criterion |
protected SqlDialect |
dialect |
protected OrmHandler |
handler |
protected List<org.ujorm.criterion.ValueCriterion> |
nullValues
List of the nullable criterion values
|
protected List<org.ujorm.Key> |
orderBy |
protected boolean |
printAllJoinedTables
EFFECTIVA REQUEST: to enforce printing all Ujorm joined tables
|
protected Set<TableWrapper> |
tables
All table set where a predicable order is required (by inserts)
|
protected List<org.ujorm.criterion.ValueCriterion> |
values
List of the non-null criterion values
|
protected String |
where
The WHERE condition in SQL format
|
| Constructor and Description |
|---|
CriterionDecoder(org.ujorm.criterion.Criterion criterion,
MetaTable baseTable)
Constructor
|
CriterionDecoder(org.ujorm.criterion.Criterion criterion,
MetaTable baseTable,
List<org.ujorm.Key> orderByItems)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
org.ujorm.Key |
getBaseProperty()
Returns the first direct key.
|
MetaTable |
getBaseTable()
Get Base Table
|
MetaColumn |
getColumn(int i)
Returns direct column or throw an exception
|
int |
getColumnCount()
Returns a column count
|
org.ujorm.criterion.Criterion |
getCriterion()
Returns the criterion from constructor.
|
OrmHandler |
getHandler()
Returns handler
|
org.ujorm.criterion.Operator |
getOperator(int i)
Returns operator.
|
protected Collection<AliasKey> |
getPropertyRelations()
Returns the unique direct key relation set with the predicable order (by inserts).
|
List<CriterionDecoder.Relation> |
getRelations()
Return relations
|
int |
getTableCount()
Returns all participated tables include the parameter table.
|
TableWrapper[] |
getTables()
Returns all participated tables include the parameter table.
|
TableWrapper[] |
getTablesSorted()
Returns all participated tables include the parameter table.
|
Object |
getValue(int i)
Returns value
|
Object |
getValueExtended(int i)
Returns an extended value to the SQL statement
|
String |
getWhere()
Returns a SQL WHERE 'expression' of an empty string if no condition is found.
|
protected String |
initWhere()
Returns a SQL WHERE 'expression' of an empty string if no condition is found.
|
boolean |
isEmpty()
Is the SQL statement empty?
|
String |
toString()
Returns the criterion
|
protected void |
unpack(org.ujorm.criterion.Criterion c,
StringBuilder sql)
Unpack criterion and write value conditions to SQL buffer
|
protected void |
writeConditions(StringBuilder sql)
Unpack binary criterions and write all value conditions
|
protected void |
writeRelations(StringBuilder sql)
Write the relation conditions
|
protected final OrmHandler handler
protected final SqlDialect dialect
protected final org.ujorm.criterion.Criterion criterion
protected final List<org.ujorm.Key> orderBy
protected final List<org.ujorm.criterion.ValueCriterion> values
protected final List<org.ujorm.criterion.ValueCriterion> nullValues
protected final Set<TableWrapper> tables
protected final MetaTable baseTable
protected final boolean printAllJoinedTables
protected final String where
public CriterionDecoder(org.ujorm.criterion.Criterion criterion,
MetaTable baseTable)
criterion - Criterion non-nullbaseTable - Base ORM table modelprotected void unpack(org.ujorm.criterion.Criterion c,
StringBuilder sql)
c - The non-null criterionsql - SQL output buffer;public int getColumnCount()
public MetaColumn getColumn(int i) throws IllegalArgumentException
IllegalArgumentExceptionpublic org.ujorm.criterion.Operator getOperator(int i)
public Object getValue(int i)
public Object getValueExtended(int i)
public org.ujorm.criterion.Criterion getCriterion()
protected final String initWhere()
public String getWhere()
public boolean isEmpty()
public org.ujorm.Key getBaseProperty()
protected void writeConditions(StringBuilder sql)
protected void writeRelations(StringBuilder sql)
protected Collection<AliasKey> getPropertyRelations()
public MetaTable getBaseTable()
public int getTableCount()
public TableWrapper[] getTables()
public TableWrapper[] getTablesSorted()
public OrmHandler getHandler()
public List<CriterionDecoder.Relation> getRelations()
Copyright 2013, Pavel Ponec