net.ontopia.persistence.query.sql
Class SQLBuilder

java.lang.Object
  extended by net.ontopia.persistence.query.sql.SQLBuilder

public class SQLBuilder
extends java.lang.Object

INTERNAL: Class used to build SQL queries from JDO queries.


Field Summary
protected  boolean debug
           
protected  ObjectRelationalMappingIF mapping
           
 
Constructor Summary
SQLBuilder(ObjectRelationalMappingIF mapping)
           
SQLBuilder(ObjectRelationalMappingIF mapping, boolean debug)
           
 
Method Summary
protected  java.lang.Class checkCompatibility(JDOValueIF value, java.lang.Class type, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  java.lang.Class checkCompatibility(JDOValueIF value1, JDOValueIF value2, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  FieldInfoIF getFieldInfo(JDOCollection coll, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  FieldInfoIF getFieldInfo(JDOField field, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  FieldInfoIF getFieldInfo(JDOObject object, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  FieldInfoIF getFieldInfo(JDOParameter param, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  FieldInfoIF getFieldInfo(JDOValueIF jdovalue, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  FieldInfoIF getFieldInfo(JDOVariable var, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLQuery getFirstSQLQuery(SQLSetOperation sqlset)
           
protected  java.lang.Class getIdentifiableValueType(JDOField field, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  java.lang.Class getIdentifiableValueType(JDOValueIF jdovalue, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  java.lang.String[] getInlineColumns(FieldInfoIF finfo)
           
protected  java.lang.String[] getKeyColumns(FieldInfoIF finfo)
           
protected  int getSQLOrder(JDOOrderBy orderby)
           
protected  java.lang.Class getValueType(JDOField field, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  java.lang.Class getValueType(JDOValueIF value, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  boolean isAggregateParameter(java.lang.String param, JDOQuery jdoquery)
           
protected  boolean isAggregateType(java.lang.Class type)
           
protected  boolean isAggregateVariable(java.lang.String var, JDOQuery jdoquery)
           
protected  boolean isIdentifiableParameter(java.lang.String param, JDOQuery jdoquery)
           
protected  boolean isIdentifiableType(java.lang.Class type)
           
protected  boolean isIdentifiableValueType(JDOValueIF jdovalue, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  boolean isIdentifiableVariable(java.lang.String var, JDOQuery jdoquery)
           
protected  boolean isPrimitiveParameter(java.lang.String param, JDOQuery jdoquery)
           
protected  boolean isPrimitiveType(java.lang.Class type)
           
protected  boolean isPrimitiveVariable(java.lang.String var, JDOQuery jdoquery)
           
protected  SQLExpressionIF makeAndExpression(java.util.List expressions)
           
protected  SQLExpressionIF makeOrExpression(SQLExpressionIF[] expressions)
           
 SQLQuery makeQuery(JDOQuery jdoquery, ObjectAccessIF oaccess)
           
protected  void produceAnd(JDOAnd and_expr, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  void produceBoolean(JDOBoolean boolean_expr, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLValueIF produceCollection(JDOCollection coll, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  void produceContains(JDOValueIF left, JDOValueIF right, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  void produceEndsWith(JDOValueIF left, JDOValueIF right, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  void produceEquals(JDOValueIF left, JDOValueIF right, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  void produceExpression(JDOExpressionIF jdoexpr, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLExpressionIF[] produceExpressions(JDOExpressionIF[] jdoexprs, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLValueIF produceField(JDOField field, SQLTable endtable, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  net.ontopia.persistence.query.sql.SQLBuilder.Values produceFieldValues(JDOField field, SQLTable endtable, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLValueIF produceFunction(JDOFunction func, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  void produceIsEmpty(JDOValueIF value, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  void produceLike(JDOValueIF left, JDOValueIF right, boolean caseSensitive, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  void produceLikeWithPattern(JDOValueIF left, JDOValueIF right, boolean caseSensitive, java.util.List expressions, boolean starts_not_ends, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLValueIF produceNativeValue(JDONativeValue field, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  void produceNot(JDONot not_expr, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  void produceNotEquals(JDOValueIF left, JDOValueIF right, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLValueIF produceObject(JDOObject object, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  net.ontopia.persistence.query.sql.SQLBuilder.Values produceObjectFieldValues(JDOObject obj, java.lang.String[] path, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  void produceOr(JDOOr or_expr, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLValueIF produceParameter(JDOParameter par, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLValueIF producePrimitive(JDOPrimitive primitive, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLAggregateIF produceSelectSQLAggregateIF(JDOAggregateIF aggregate, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLValueIF produceSelectSQLValueIF(JDOValueIF value, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLSetOperation produceSetOperation(JDOSetOperation setop_expr, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLOrderBy produceSQLOrderBy(JDOOrderBy orderby, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  void produceStartsWith(JDOValueIF left, JDOValueIF right, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLValueIF produceValue(JDOValueIF value, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  void produceValueExpression(JDOValueExpression jdoexpr, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLValueIF[] produceValues(JDOValueIF[] values, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLValueIF produceVariable(JDOVariable var, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  net.ontopia.persistence.query.sql.SQLBuilder.Values produceVariableFieldValues(JDOValueIF root, java.lang.String[] path, SQLTable endtable, java.util.List expressions, net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)
           
protected  SQLAggregateIF wrapAggregate(int aggtype, SQLValueIF sqlvalue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected boolean debug

mapping

protected ObjectRelationalMappingIF mapping
Constructor Detail

SQLBuilder

public SQLBuilder(ObjectRelationalMappingIF mapping)

SQLBuilder

public SQLBuilder(ObjectRelationalMappingIF mapping,
                  boolean debug)
Method Detail

makeQuery

public SQLQuery makeQuery(JDOQuery jdoquery,
                          ObjectAccessIF oaccess)

getFirstSQLQuery

protected SQLQuery getFirstSQLQuery(SQLSetOperation sqlset)

produceSQLOrderBy

protected SQLOrderBy produceSQLOrderBy(JDOOrderBy orderby,
                                       java.util.List expressions,
                                       net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

getSQLOrder

protected int getSQLOrder(JDOOrderBy orderby)

produceSelectSQLValueIF

protected SQLValueIF produceSelectSQLValueIF(JDOValueIF value,
                                             java.util.List expressions,
                                             net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

getKeyColumns

protected java.lang.String[] getKeyColumns(FieldInfoIF finfo)

getInlineColumns

protected java.lang.String[] getInlineColumns(FieldInfoIF finfo)

produceSelectSQLAggregateIF

protected SQLAggregateIF produceSelectSQLAggregateIF(JDOAggregateIF aggregate,
                                                     java.util.List expressions,
                                                     net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

wrapAggregate

protected SQLAggregateIF wrapAggregate(int aggtype,
                                       SQLValueIF sqlvalue)

makeAndExpression

protected SQLExpressionIF makeAndExpression(java.util.List expressions)

makeOrExpression

protected SQLExpressionIF makeOrExpression(SQLExpressionIF[] expressions)

produceExpression

protected void produceExpression(JDOExpressionIF jdoexpr,
                                 java.util.List expressions,
                                 net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceSetOperation

protected SQLSetOperation produceSetOperation(JDOSetOperation setop_expr,
                                              net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceBoolean

protected void produceBoolean(JDOBoolean boolean_expr,
                              java.util.List expressions,
                              net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceValueExpression

protected void produceValueExpression(JDOValueExpression jdoexpr,
                                      java.util.List expressions,
                                      net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceAnd

protected void produceAnd(JDOAnd and_expr,
                          java.util.List expressions,
                          net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceNot

protected void produceNot(JDONot not_expr,
                          java.util.List expressions,
                          net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceOr

protected void produceOr(JDOOr or_expr,
                         java.util.List expressions,
                         net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceExpressions

protected SQLExpressionIF[] produceExpressions(JDOExpressionIF[] jdoexprs,
                                               net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceEquals

protected void produceEquals(JDOValueIF left,
                             JDOValueIF right,
                             java.util.List expressions,
                             net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceNotEquals

protected void produceNotEquals(JDOValueIF left,
                                JDOValueIF right,
                                java.util.List expressions,
                                net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceContains

protected void produceContains(JDOValueIF left,
                               JDOValueIF right,
                               java.util.List expressions,
                               net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceIsEmpty

protected void produceIsEmpty(JDOValueIF value,
                              java.util.List expressions,
                              net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceStartsWith

protected void produceStartsWith(JDOValueIF left,
                                 JDOValueIF right,
                                 java.util.List expressions,
                                 net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceEndsWith

protected void produceEndsWith(JDOValueIF left,
                               JDOValueIF right,
                               java.util.List expressions,
                               net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceLike

protected void produceLike(JDOValueIF left,
                           JDOValueIF right,
                           boolean caseSensitive,
                           java.util.List expressions,
                           net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceLikeWithPattern

protected void produceLikeWithPattern(JDOValueIF left,
                                      JDOValueIF right,
                                      boolean caseSensitive,
                                      java.util.List expressions,
                                      boolean starts_not_ends,
                                      net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceValues

protected SQLValueIF[] produceValues(JDOValueIF[] values,
                                     java.util.List expressions,
                                     net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceValue

protected SQLValueIF produceValue(JDOValueIF value,
                                  java.util.List expressions,
                                  net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceField

protected SQLValueIF produceField(JDOField field,
                                  SQLTable endtable,
                                  java.util.List expressions,
                                  net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceFieldValues

protected net.ontopia.persistence.query.sql.SQLBuilder.Values produceFieldValues(JDOField field,
                                                                                 SQLTable endtable,
                                                                                 java.util.List expressions,
                                                                                 net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceVariableFieldValues

protected net.ontopia.persistence.query.sql.SQLBuilder.Values produceVariableFieldValues(JDOValueIF root,
                                                                                         java.lang.String[] path,
                                                                                         SQLTable endtable,
                                                                                         java.util.List expressions,
                                                                                         net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceObjectFieldValues

protected net.ontopia.persistence.query.sql.SQLBuilder.Values produceObjectFieldValues(JDOObject obj,
                                                                                       java.lang.String[] path,
                                                                                       net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceVariable

protected SQLValueIF produceVariable(JDOVariable var,
                                     java.util.List expressions,
                                     net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceParameter

protected SQLValueIF produceParameter(JDOParameter par,
                                      java.util.List expressions,
                                      net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

producePrimitive

protected SQLValueIF producePrimitive(JDOPrimitive primitive,
                                      net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceNativeValue

protected SQLValueIF produceNativeValue(JDONativeValue field,
                                        java.util.List expressions,
                                        net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceFunction

protected SQLValueIF produceFunction(JDOFunction func,
                                     java.util.List expressions,
                                     net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceObject

protected SQLValueIF produceObject(JDOObject object,
                                   net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

produceCollection

protected SQLValueIF produceCollection(JDOCollection coll,
                                       net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

getFieldInfo

protected FieldInfoIF getFieldInfo(JDOValueIF jdovalue,
                                   net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

getFieldInfo

protected FieldInfoIF getFieldInfo(JDOVariable var,
                                   net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

getFieldInfo

protected FieldInfoIF getFieldInfo(JDOParameter param,
                                   net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

getFieldInfo

protected FieldInfoIF getFieldInfo(JDOObject object,
                                   net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

getFieldInfo

protected FieldInfoIF getFieldInfo(JDOCollection coll,
                                   net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

getFieldInfo

protected FieldInfoIF getFieldInfo(JDOField field,
                                   net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

checkCompatibility

protected java.lang.Class checkCompatibility(JDOValueIF value1,
                                             JDOValueIF value2,
                                             net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

checkCompatibility

protected java.lang.Class checkCompatibility(JDOValueIF value,
                                             java.lang.Class type,
                                             net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

getValueType

protected java.lang.Class getValueType(JDOValueIF value,
                                       net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

getValueType

protected java.lang.Class getValueType(JDOField field,
                                       net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

isIdentifiableValueType

protected boolean isIdentifiableValueType(JDOValueIF jdovalue,
                                          net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

getIdentifiableValueType

protected java.lang.Class getIdentifiableValueType(JDOValueIF jdovalue,
                                                   net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

getIdentifiableValueType

protected java.lang.Class getIdentifiableValueType(JDOField field,
                                                   net.ontopia.persistence.query.sql.SQLBuilder.BuildInfo info)

isIdentifiableVariable

protected boolean isIdentifiableVariable(java.lang.String var,
                                         JDOQuery jdoquery)

isIdentifiableParameter

protected boolean isIdentifiableParameter(java.lang.String param,
                                          JDOQuery jdoquery)

isIdentifiableType

protected boolean isIdentifiableType(java.lang.Class type)

isAggregateVariable

protected boolean isAggregateVariable(java.lang.String var,
                                      JDOQuery jdoquery)

isAggregateParameter

protected boolean isAggregateParameter(java.lang.String param,
                                       JDOQuery jdoquery)

isAggregateType

protected boolean isAggregateType(java.lang.Class type)

isPrimitiveVariable

protected boolean isPrimitiveVariable(java.lang.String var,
                                      JDOQuery jdoquery)

isPrimitiveParameter

protected boolean isPrimitiveParameter(java.lang.String param,
                                       JDOQuery jdoquery)

isPrimitiveType

protected boolean isPrimitiveType(java.lang.Class type)


Copyright © 2000-2012 Ontopia.