com.cassinidivision.core.eoaccess
Class SchemaHelper

java.lang.Object
  extended bycom.cassinidivision.core.eoaccess.SchemaHelper

public class SchemaHelper
extends Object

SQL Generation utility methods.


Constructor Summary
SchemaHelper()
           
 
Method Summary
 NSMutableDictionary optionsDictionary(boolean createTables, boolean dropTables, boolean createPrimaryKeySupport, boolean dropPrimaryKeySupport, boolean primaryKeyConstraints, boolean foreignKeyConstraints, boolean indexesForPrimaryKeys, boolean indexesForForeignKeys)
          Convenience method: build an options dictionary from the arguments specified.
 void runSQLForModelWithOptions(EOModel model, boolean createTables, boolean dropTables, boolean createPrimaryKeySupport, boolean dropPrimaryKeySupport, boolean primaryKeyConstraints, boolean foreignKeyConstraints, boolean indexesForPrimaryKeys, boolean indexesForForeignKeys)
          Execute EOF SQL generation for the specified EOModel and given options.
 void runSQLForModelWithOptions(EOModel model, NSDictionary options)
          Execute EOF SQL generation for the specified EOModel and given options.
 void runSQLWithOptionsForModels(NSDictionary options, NSArray models)
          Convenience method: execute SQL generation for multiple EOModels simultaneously.
 void runStatementsWithAdaptorChannel(NSArray statements, EOAdaptorChannel channel)
          Convenience method: execute a sequence of SQL expressions.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaHelper

public SchemaHelper()
Method Detail

optionsDictionary

public NSMutableDictionary optionsDictionary(boolean createTables,
                                             boolean dropTables,
                                             boolean createPrimaryKeySupport,
                                             boolean dropPrimaryKeySupport,
                                             boolean primaryKeyConstraints,
                                             boolean foreignKeyConstraints,
                                             boolean indexesForPrimaryKeys,
                                             boolean indexesForForeignKeys)
Convenience method: build an options dictionary from the arguments specified.

Parameters:
createTables - SQL should be generated to build database tables.
dropTables - SQL should be generated to drop database tables.
createPrimaryKeySupport - SQL should be generated to create primary key support.
dropPrimaryKeySupport - SQL should be generated to drop primary key support.
primaryKeyConstraints - SQL should be generated to create primary key constraints.
foreignKeyConstraints - SQL should be generated to create foreign key support.
indexesForPrimaryKeys - This parameter is currently ignored by EOF.
indexesForForeignKeys - This parameter is currently ignored by EOF.
Returns:
The resulting dictionary.

runSQLForModelWithOptions

public void runSQLForModelWithOptions(EOModel model,
                                      boolean createTables,
                                      boolean dropTables,
                                      boolean createPrimaryKeySupport,
                                      boolean dropPrimaryKeySupport,
                                      boolean primaryKeyConstraints,
                                      boolean foreignKeyConstraints,
                                      boolean indexesForPrimaryKeys,
                                      boolean indexesForForeignKeys)
Execute EOF SQL generation for the specified EOModel and given options.

Parameters:
createTables - SQL should be generated to build database tables.
dropTables - SQL should be generated to drop database tables.
createPrimaryKeySupport - SQL should be generated to create primary key support.
dropPrimaryKeySupport - SQL should be generated to drop primary key support.
primaryKeyConstraints - SQL should be generated to create primary key constraints.
foreignKeyConstraints - SQL should be generated to create foreign key support.
indexesForPrimaryKeys - This parameter is currently ignored by EOF.
indexesForForeignKeys - This parameter is currently ignored by EOF.

runSQLForModelWithOptions

public void runSQLForModelWithOptions(EOModel model,
                                      NSDictionary options)
Execute EOF SQL generation for the specified EOModel and given options.

Parameters:
model - EOModel for which to generate SQL.
options - containing key-value pairs corresponding to SQL generation options. See runSQLForModelWithOptions(EOModel,boolean, boolean, boolean, boolean, boolean, boolean, boolean, boolean) for further information.

runStatementsWithAdaptorChannel

public void runStatementsWithAdaptorChannel(NSArray statements,
                                            EOAdaptorChannel channel)
Convenience method: execute a sequence of SQL expressions.

Parameters:
statements - Array containing EOSQLExpression instances.
channel - An available adaptor channel.

runSQLWithOptionsForModels

public void runSQLWithOptionsForModels(NSDictionary options,
                                       NSArray models)
Convenience method: execute SQL generation for multiple EOModels simultaneously.

Parameters:
options - containing key-value pairs corresponding to SQL generation options. See runSQLForModelWithOptions(EOModel,boolean, boolean, boolean, boolean, boolean, boolean, boolean, boolean) for further information.
models - Array containing EOModel instances.