| com.versant.core.jdbc.sql.JdbcNameGenerator
All known Subclasses: com.versant.core.jdbc.sql.DefaultJdbcNameGenerator,
JdbcNameGenerator | public interface JdbcNameGenerator (Code) | | This is responsible for generating and validating names for different
JDBC entities (tables, columns, indexes and constraints). The SqlDriver
for each store creates and configures a name generator instance for the
store. This may be replaced by a user configured generator.
|
Method Summary | |
public void | addColumnName(String tableName, String columnName) Add a column name. | public void | addIndexName(String tableName, String indexName) Add an index name. | public void | addPkConstraintName(String tableName, String pkConstraintName) Add the primary key constaint name specified in jdo meta data. | public void | addRefConstraintName(String tableName, String refConstraintName) Add the referential integrity constaint name specified in jdo meta data. | public void | addTableName(String name) Add a table name specified in jdo meta data.
exception: IllegalArgumentException - if the name is invalid(e.g. | public String | generateClassIdColumnName(String tableName) Generate and add the name for a classId column. | public String | generateClassTableName(String className) Generate a table name for a persistent class. | public String | generateDatastorePKName(String tableName) Generate and add a name for the primary key column for a PC class using
datastore identity. | public String | generateFieldColumnName(String tableName, String fieldName, boolean primaryKey) Generate and add the name for a field column. | public String | generateIndexName(String tableName, String[] columnNames) Generate and add an index name. | public void | generateLinkTableMainRefNames(String tableName, String[] mainTablePkNames, String[] linkMainRefNames) Generate and add names for the column(s) in a link table that reference
the primary key of the main table. | public String | generateLinkTableName(String tableName, String fieldName, String elementTableName) Generate a table name for a link table (normally used to hold the values
of a collection). | public String | generateLinkTableSequenceName(String tableName) Generate and add the name for a the column in a link table that stores
the element sequence number. | public String | generateLinkTableValueName(String tableName, Class valueCls, boolean key) Generate and add the name for a the column in a link table that stores
the value where the value is not a PC class (int, String etc). | public void | generateLinkTableValueRefNames(String tableName, String[] valuePkNames, String valueClassName, String[] linkValueRefNames, boolean key) Generate and add names for the column(s) in a link table that reference
the primary key of the value table. | public String | generatePkConstraintName(String tableName) Generate a name for the primary key constaint for tableName. | public void | generatePolyRefFieldColumnNames(String tableName, String fieldName, String[] columnNames) Generate and add names for one or more columns for a field that is
a polymorphic reference to any other PC class. | public String | generateRefConstraintName(String tableName, String refTableName, String[] fkNames, String[] refPkNames) Generate a name for a referential integrity constaint for tableName. | public void | generateRefFieldColumnNames(String tableName, String fieldName, String[] columnNames, String refTableName, String[] refPkNames, boolean otherRefs) Generate and add names for one or more columns for a field that is
a reference to another PC class. | public boolean | isColumnInTable(String tableName, String columnName) | public void | removeTableName(String name) Remove all information about table. | public void | setDatabaseType(String db) This is called immediately after the name generator has been constructed
to indicate which database is in use. |
generateDatastorePKName | public String generateDatastorePKName(String tableName)(Code) | | Generate and add a name for the primary key column for a PC class using
datastore identity.
|
generateFieldColumnName | public String generateFieldColumnName(String tableName, String fieldName, boolean primaryKey)(Code) | | Generate and add the name for a field column.
|
generateLinkTableMainRefNames | public void generateLinkTableMainRefNames(String tableName, String[] mainTablePkNames, String[] linkMainRefNames)(Code) | | Generate and add names for the column(s) in a link table that reference
the primary key of the main table. Some of the columns may already
have names which must be kept (no need to add them).
Parameters: tableName - The link table Parameters: mainTablePkNames - The names of the main table primary key Parameters: linkMainRefNames - The corresponding column names in the link table |
generateLinkTableName | public String generateLinkTableName(String tableName, String fieldName, String elementTableName)(Code) | | Generate a table name for a link table (normally used to hold the values
of a collection). The name generator must 'add' it.
Parameters: tableName - The table on the 1 side of the the link Parameters: fieldName - The field the link table is for Parameters: elementTableName - The table on the n side of the link or null ifnone (e.g. a link table for a collection of String's) See Also: JdbcNameGenerator.addTableName |
generateLinkTableSequenceName | public String generateLinkTableSequenceName(String tableName)(Code) | | Generate and add the name for a the column in a link table that stores
the element sequence number.
|
generateLinkTableValueName | public String generateLinkTableValueName(String tableName, Class valueCls, boolean key)(Code) | | Generate and add the name for a the column in a link table that stores
the value where the value is not a PC class (int, String etc).
Parameters: tableName - The link table Parameters: valueCls - The value class Parameters: key - Is this a key in a link table for a map? |
generateLinkTableValueRefNames | public void generateLinkTableValueRefNames(String tableName, String[] valuePkNames, String valueClassName, String[] linkValueRefNames, boolean key)(Code) | | Generate and add names for the column(s) in a link table that reference
the primary key of the value table. This is called for collections of
PC classes. Some of the columns may already have names which must be
kept (no need to add them).
Parameters: tableName - The link table Parameters: valuePkNames - The names of the value table primary key (may benull if the value class is not stored in JDBC) Parameters: valueClassName - The name of the value class Parameters: linkValueRefNames - The corresponding column names in the link table Parameters: key - Is this a key in a link table for a map? |
generatePolyRefFieldColumnNames | public void generatePolyRefFieldColumnNames(String tableName, String fieldName, String[] columnNames) throws IllegalArgumentException(Code) | | Generate and add names for one or more columns for a field that is
a polymorphic reference to any other PC class. Some of the columns may
already have names.
Parameters: columnNames - Store the column names here (some may already havenames if specified in the .jdo meta data). The class-id columnis at index 0. exception: IllegalArgumentException - if any existing names are invalid |
generateRefConstraintName | public String generateRefConstraintName(String tableName, String refTableName, String[] fkNames, String[] refPkNames)(Code) | | Generate a name for a referential integrity constaint for tableName.
The name generator must add it.
Parameters: tableName - The table with the constraint Parameters: refTableName - The table being referenced Parameters: fkNames - The names of the foreign keys in tableName Parameters: refPkNames - The names of the primary key of refTableName See Also: JdbcNameGenerator.addRefConstraintName |
generateRefFieldColumnNames | public void generateRefFieldColumnNames(String tableName, String fieldName, String[] columnNames, String refTableName, String[] refPkNames, boolean otherRefs) throws IllegalArgumentException(Code) | | Generate and add names for one or more columns for a field that is
a reference to another PC class. Some of the columns may already have
names.
Parameters: columnNames - Store the column names here (some may already havenames if specified in the .jdo meta data) Parameters: refTableName - The table being referenced (null if not a JDBC class) Parameters: refPkNames - The names of the primary key columns of refTableName Parameters: otherRefs - Are there other field referencing the same class here? exception: IllegalArgumentException - if any existing names are invalid |
isColumnInTable | public boolean isColumnInTable(String tableName, String columnName)(Code) | | Does the table contain the column?
|
removeTableName | public void removeTableName(String name)(Code) | | Remove all information about table.
|
setDatabaseType | public void setDatabaseType(String db)(Code) | | This is called immediately after the name generator has been constructed
to indicate which database is in use.
Parameters: db - Database type (mssql, sybase, oracle, informix et al.). |
|
|