Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.table.db
Class SQLFilterConverter

java.lang.Object
  extended by com.citra.table.db.SQLFilterConverter
Direct Known Subclasses:
DefaultCrosstabTableModel.SQLFilterPivotConverter

public class SQLFilterConverter
extends Object

SQLFilterConverter is a utility class that converts a TableFilter into an SQL string.


Field Summary
protected static String holder
          a string to use as an SQL placeholder (default is ?)
 
Constructor Summary
SQLFilterConverter()
          Constructs an SQLFilterConverter.
 
Method Summary
 String convert(Filter filter, boolean place)
          Converts the supplied filter into an SQL where clause.
 String convert(TableFilter tableFilter, DatabaseTableDefinition definition)
          Converts the supplied table filter into an SQL where clause.
 String convert(TableFilter tableFilter, DatabaseTableDefinition definition, boolean place)
          Converts the supplied table filter into an SQL where clause.
 String convertBoolean(BooleanFilter filter, boolean place)
          Converts the supplied boolean filter into an SQL where clause.
 String convertComparison(ComparisonFilter filter, boolean place)
          Converts the supplied comparison filter into an SQL where clause.
 String convertString(StringFilter filter, boolean place)
          Converts the supplied string filter into an SQL where clause.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

holder

protected static String holder
a string to use as an SQL placeholder (default is ?)

Constructor Detail

SQLFilterConverter

public SQLFilterConverter()
Constructs an SQLFilterConverter.

Method Detail

convert

public String convert(Filter filter,
                      boolean place)
Converts the supplied filter into an SQL where clause.

Parameters:
filter - the filter to convert
place - if true, converter will use placeholders (?), otherwise the filter's value
Returns:
the SQL string

convertComparison

public String convertComparison(ComparisonFilter filter,
                                boolean place)
Converts the supplied comparison filter into an SQL where clause.

Parameters:
filter - the comparison filter to convert
place - if true, converter will use placeholders (?), otherwise the filter's value
Returns:
the SQL string

convertString

public String convertString(StringFilter filter,
                            boolean place)
Converts the supplied string filter into an SQL where clause.

Parameters:
filter - the string filter to convert
place - if true, converter will use placeholders (?), otherwise the filter's value
Returns:
the SQL string

convert

public String convert(TableFilter tableFilter,
                      DatabaseTableDefinition definition)
Converts the supplied table filter into an SQL where clause.

Parameters:
tableFilter - the table filter to convert
definition - the database definition to use to find out the column names
Returns:
the SQL string

convert

public String convert(TableFilter tableFilter,
                      DatabaseTableDefinition definition,
                      boolean place)
Converts the supplied table filter into an SQL where clause.

Parameters:
tableFilter - the table filter to convert
definition - the database definition to use to find out the column names
place - if true, converter will use placeholders (?), otherwise the filter's value
Returns:
the SQL string

convertBoolean

public String convertBoolean(BooleanFilter filter,
                             boolean place)
Converts the supplied boolean filter into an SQL where clause.

Parameters:
filter - the boolean filter to convert
place - if true, converter will use placeholders (?), otherwise the filter's value
Returns:
the SQL string

Copyright © 2011 Citra Technologies. All Rights Reserved.