Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tonbeller.wcf.param
Class SqlGenerator

    java.lang.Object
      com.tonbeller.wcf.param.SqlGenerator

All Implemented Interfaces:
  SqlExprVisitor

public class SqlGenerator
extends java.lang.Object
implements SqlExprVisitor

Since:
  31.01.2005
Author:
  av

Field Summary
`static java.lang.String` | `DEFAULT_COLUMN_ID` if no columnId is set in an SqlExpr use this string to look up the column name

Constructor Summary
`SqlGenerator()`
`SqlGenerator(java.util.Map columnMap)`
`SqlGenerator(java.lang.String defaultColumn)`

Method Summary
`protected boolean` | `containsNull(java.lang.Object[] values)`
`protected SqlGenerator` | `copyGenerator()` returns a new SqlGenerator that shares the same settings as this.
`void` | `genAndOr(com.tonbeller.wcf.param.SqlExprWithOperands exp, java.lang.String keyword)`
`java.lang.String` | `generate(SqlExpr sqlExpr)` generates SQL string from expression
`protected java.lang.String` | `generateList(java.lang.Object[] values)`
`protected java.lang.String` | `generateOpd(SqlExpr opd)` generates SQL for opd in a new SqlGenerator
`java.util.Map` | `getColumnMap()` maps columnIds to column names.
`protected java.lang.String` | `getColumnName(SqlColumnConstraint scc)`
`protected java.lang.Object[]` | `removeNulls(java.lang.Object[] values)`
`void` | `setColumnMap(java.util.Map columnMap)` maps columnIds to column names.
`void` | `visitSqlAndExpr(SqlAndExpr exp)`
`void` | `visitSqlBetweenExpr(SqlBetweenExpr exp)`
`void` | `visitSqlDummyExpr(SqlDummyExpr exp)`
`void` | `visitSqlEqualExpr(SqlEqualExpr exp)`
`void` | `visitSqlInExpr(SqlInExpr exp)`
`void` | `visitSqlOrExpr(SqlOrExpr exp)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_COLUMN_ID

    public static final java.lang.String DEFAULT_COLUMN_ID

  if no columnId is set in an SqlExpr use this string to look up the column name

  See Also:
    Constant Field Values

Constructor Detail

### SqlGenerator

    public SqlGenerator()

### SqlGenerator

    public SqlGenerator(java.lang.String defaultColumn)

Parameters:
  `defaultColumn` - the name of the generated column if no column id is present in the SqlExpr

### SqlGenerator

    public SqlGenerator(java.util.Map columnMap)

Method Detail

### copyGenerator

    protected SqlGenerator copyGenerator()

  returns a new SqlGenerator that shares the same settings as this.

### generateOpd

    protected java.lang.String generateOpd(SqlExpr opd)

  generates SQL for opd in a new SqlGenerator

### getColumnName

    protected java.lang.String getColumnName(SqlColumnConstraint scc)

### genAndOr

    public void genAndOr(com.tonbeller.wcf.param.SqlExprWithOperands exp,
                         java.lang.String keyword)

### visitSqlAndExpr

    public void visitSqlAndExpr(SqlAndExpr exp)

  Specified by:
    `visitSqlAndExpr` in interface `SqlExprVisitor`

### visitSqlOrExpr

    public void visitSqlOrExpr(SqlOrExpr exp)

  Specified by:
    `visitSqlOrExpr` in interface `SqlExprVisitor`

### visitSqlBetweenExpr

    public void visitSqlBetweenExpr(SqlBetweenExpr exp)

  Specified by:
    `visitSqlBetweenExpr` in interface `SqlExprVisitor`

### visitSqlEqualExpr

    public void visitSqlEqualExpr(SqlEqualExpr exp)

  Specified by:
    `visitSqlEqualExpr` in interface `SqlExprVisitor`

### visitSqlDummyExpr

    public void visitSqlDummyExpr(SqlDummyExpr exp)

  Specified by:
    `visitSqlDummyExpr` in interface `SqlExprVisitor`

### visitSqlInExpr

    public void visitSqlInExpr(SqlInExpr exp)

  Specified by:
    `visitSqlInExpr` in interface `SqlExprVisitor`

### generateList

    protected java.lang.String generateList(java.lang.Object[] values)

### removeNulls

    protected java.lang.Object[] removeNulls(java.lang.Object[] values)

### containsNull

    protected boolean containsNull(java.lang.Object[] values)

### generate

    public java.lang.String generate(SqlExpr sqlExpr)

  generates SQL string from expression

### getColumnMap

    public java.util.Map getColumnMap()

  maps columnIds to column names. Example: "CUSTOMER" -> "CUSTOMER_TABLE.CUSTOMER_FK"

### setColumnMap

    public void setColumnMap(java.util.Map columnMap)

  maps columnIds to column names. Example: "CUSTOMER" -> "CUSTOMER_TABLE.CUSTOMER_FK"

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD