org.ujoframework.orm
Class CriterionDecoder

java.lang.Object
  extended by org.ujoframework.orm.CriterionDecoder

public class CriterionDecoder
extends java.lang.Object

SQL Criterion Decoder.

Author:
Pavel Ponec

Constructor Summary
CriterionDecoder(Criterion criterion, MetaDatabase database, java.util.List<UjoProperty> orderByItems)
           
CriterionDecoder(Criterion e, MetaTable ormTable)
           
 
Method Summary
 UjoProperty getBaseProperty()
          Returns the first direct property.
 MetaColumn getColumn(int i)
          Returns direct column
 int getColumnCount()
          Returns a column count
 Criterion getCriterion()
          Returns the criterion from costructor.
 OrmHandler getHandler()
          Returns handler
 Operator getOperator(int i)
          Returns operator.
protected  UjoProperty[] getPropertyRelations()
          Returns the unique direct property relations.
 MetaTable[] getTables(MetaTable baseTable)
          Returns all participated tables include the parameter table.
 MetaTable[] getTablesSorted(MetaTable baseTable)
          Returns all participated tables include the parameter table.
 java.lang.Object getValue(int i)
          Returns value
 java.lang.Object getValueExtended(int i)
          Returns an extended value to the SQL statement
 java.lang.String getWhere()
          Returns a SQL WHERE 'expression' of an empty string if no conditon is found.
 boolean isEmpty()
          Is the SQL statement empty?
 java.lang.String toString()
          Returns the criterion
protected  void unpack(Criterion c)
          Unpack criterion.
protected  void writeRelations()
          Writer a relation conditions:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CriterionDecoder

public CriterionDecoder(Criterion e,
                        MetaTable ormTable)

CriterionDecoder

public CriterionDecoder(Criterion criterion,
                        MetaDatabase database,
                        java.util.List<UjoProperty> orderByItems)
Parameters:
orderBy - The order item list is not mandatory (can be null).
Method Detail

unpack

protected void unpack(Criterion c)
Unpack criterion.


getColumnCount

public int getColumnCount()
Returns a column count


getColumn

public MetaColumn getColumn(int i)
Returns direct column


getOperator

public Operator getOperator(int i)
Returns operator.


getValue

public java.lang.Object getValue(int i)
Returns value


getValueExtended

public java.lang.Object getValueExtended(int i)
Returns an extended value to the SQL statement


getCriterion

public Criterion getCriterion()
Returns the criterion from costructor.


getWhere

public java.lang.String getWhere()
Returns a SQL WHERE 'expression' of an empty string if no conditon is found.


isEmpty

public boolean isEmpty()
Is the SQL statement empty?


getBaseProperty

public UjoProperty getBaseProperty()
Returns the first direct property.


writeRelations

protected void writeRelations()
Writer a relation conditions:


getPropertyRelations

protected UjoProperty[] getPropertyRelations()
Returns the unique direct property relations.


getTables

public MetaTable[] getTables(MetaTable baseTable)
Returns all participated tables include the parameter table.


getTablesSorted

public MetaTable[] getTablesSorted(MetaTable baseTable)
Returns all participated tables include the parameter table. The 'baseTable' is on the first position always.


getHandler

public OrmHandler getHandler()
Returns handler


toString

public java.lang.String toString()
Returns the criterion

Overrides:
toString in class java.lang.Object


Copyright © 2010. All Rights Reserved.