net.ontopia.persistence.proxy
Class SQLGenerator

java.lang.Object
  extended by net.ontopia.persistence.proxy.SQLGenerator

public class SQLGenerator
extends java.lang.Object

INTERNAL: Utility class that can generate SQL statements.


Constructor Summary
SQLGenerator()
           
 
Method Summary
static void bindMultipleParameters(java.util.Iterator identities, FieldInfoIF finfo, java.sql.PreparedStatement stm, int batchSize)
           
static void bindMultipleParameters(java.util.Iterator identities, FieldInfoIF finfo, java.sql.PreparedStatement stm, int offset, int batchSize)
           
static java.lang.String getDeleteStatement(java.lang.String table, FieldInfoIF[] where_fields)
          INTERNAL: Generates a SQL delete statement for the specified table with a where clause referencing the given field infos.
static java.lang.String getDeleteStatement(java.lang.String table, java.lang.String[] where_columns)
          INTERNAL: Generates a SQL delete statement for the specified table with a where clause referencing the given columns.
static java.lang.String getInsertStatement(java.lang.String table, FieldInfoIF[] value_fields)
          INTERNAL: Generates a SQL insert statement for the specified table with a value clause referencing the given field infos.
static java.lang.String getInsertStatement(java.lang.String table, java.lang.String[] value_columns)
          INTERNAL: Generates a SQL insert statement for the specified table with a value clause referencing the given columns.
static java.lang.String getSelectStatement(java.lang.String table, FieldInfoIF[] select_fields, FieldInfoIF[] where_fields, int multiple)
          INTERNAL: Generates a SQL select statement for the specified table with a select clause and a where clause referencing the given field infos.
static java.lang.String getSelectStatement(java.lang.String table, java.lang.String[] select_columns, java.lang.String[] where_columns, int multiple)
          INTERNAL: Generates a SQL select statement for the specified table with a select clause and a where clause referencing the given columns.
static java.lang.String getSelectStatement(java.lang.String jointable, java.lang.String datatable, java.lang.String[] jointable_keys, java.lang.String[] datatable_keys, java.lang.String[] datatable_select_columns, java.lang.String[] jointable_where_columns, int multiple)
          INTERNAL: Generates a SQL select statement that joins two tables.
static java.lang.String getUpdateStatement(java.lang.String table, FieldInfoIF[] set_fields, FieldInfoIF[] where_fields)
          INTERNAL: Generates a SQL update statement for the specified table with a set clause and a where clause referencing the given field infos.
static java.lang.String getUpdateStatement(java.lang.String table, java.lang.String[] set_columns, java.lang.String[] where_columns)
          INTERNAL: Generates a SQL update statement for the specified table with a set clause and a where clause referencing the given columns.
static java.lang.String processMultipleLoadParameters(java.util.Collection identities, java.lang.String sql)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLGenerator

public SQLGenerator()
Method Detail

getDeleteStatement

public static java.lang.String getDeleteStatement(java.lang.String table,
                                                  FieldInfoIF[] where_fields)
INTERNAL: Generates a SQL delete statement for the specified table with a where clause referencing the given field infos.


getDeleteStatement

public static java.lang.String getDeleteStatement(java.lang.String table,
                                                  java.lang.String[] where_columns)
INTERNAL: Generates a SQL delete statement for the specified table with a where clause referencing the given columns.


getInsertStatement

public static java.lang.String getInsertStatement(java.lang.String table,
                                                  FieldInfoIF[] value_fields)
INTERNAL: Generates a SQL insert statement for the specified table with a value clause referencing the given field infos.


getInsertStatement

public static java.lang.String getInsertStatement(java.lang.String table,
                                                  java.lang.String[] value_columns)
INTERNAL: Generates a SQL insert statement for the specified table with a value clause referencing the given columns.


getUpdateStatement

public static java.lang.String getUpdateStatement(java.lang.String table,
                                                  FieldInfoIF[] set_fields,
                                                  FieldInfoIF[] where_fields)
INTERNAL: Generates a SQL update statement for the specified table with a set clause and a where clause referencing the given field infos.


getUpdateStatement

public static java.lang.String getUpdateStatement(java.lang.String table,
                                                  java.lang.String[] set_columns,
                                                  java.lang.String[] where_columns)
INTERNAL: Generates a SQL update statement for the specified table with a set clause and a where clause referencing the given columns.


getSelectStatement

public static java.lang.String getSelectStatement(java.lang.String table,
                                                  FieldInfoIF[] select_fields,
                                                  FieldInfoIF[] where_fields,
                                                  int multiple)
INTERNAL: Generates a SQL select statement for the specified table with a select clause and a where clause referencing the given field infos.


getSelectStatement

public static java.lang.String getSelectStatement(java.lang.String table,
                                                  java.lang.String[] select_columns,
                                                  java.lang.String[] where_columns,
                                                  int multiple)
INTERNAL: Generates a SQL select statement for the specified table with a select clause and a where clause referencing the given columns.


getSelectStatement

public static java.lang.String getSelectStatement(java.lang.String jointable,
                                                  java.lang.String datatable,
                                                  java.lang.String[] jointable_keys,
                                                  java.lang.String[] datatable_keys,
                                                  java.lang.String[] datatable_select_columns,
                                                  java.lang.String[] jointable_where_columns,
                                                  int multiple)
INTERNAL: Generates a SQL select statement that joins two tables.


processMultipleLoadParameters

public static java.lang.String processMultipleLoadParameters(java.util.Collection identities,
                                                             java.lang.String sql)

bindMultipleParameters

public static void bindMultipleParameters(java.util.Iterator identities,
                                          FieldInfoIF finfo,
                                          java.sql.PreparedStatement stm,
                                          int batchSize)
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

bindMultipleParameters

public static void bindMultipleParameters(java.util.Iterator identities,
                                          FieldInfoIF finfo,
                                          java.sql.PreparedStatement stm,
                                          int offset,
                                          int batchSize)
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException


Copyright © 2000-2012 Ontopia.