|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDbNameDeterminer
This interface represents the database name determiner to be used with Mr. Persister.
The responsibility of the database name determiner is to determine which column name of a
given collection of names exists in the table in the database.
The database name determiner is used internally in the object mapper. The collection of
possible column names is usually generated by the database name guesser, also used
internally in the object mapper.
Method Summary | |
---|---|
java.lang.String |
determineColumnName(java.util.Collection names,
java.lang.String tableName,
java.sql.Connection connection)
Determines which, if any, of the given possible column names in the given collection is matching a column name in the given table. |
java.lang.String |
determineTableName(java.util.Collection names,
java.sql.Connection connection)
Determines which, if any, of the given possible table names in the given collection is matching a table name in the database. |
java.lang.String |
determineTableName(java.util.Collection names,
java.lang.String databaseName,
java.sql.Connection connection)
Determines which, if any, of the given possible table names in the given collection is matching a table name in the database. |
int |
getColumnType(java.lang.String columnName,
java.lang.String tableName)
Returns the type for a given column in a given table. |
Method Detail |
---|
int getColumnType(java.lang.String columnName, java.lang.String tableName)
columnName
- The name of the column to get the data type for.tableName
- The name of the table where the column is defined.
java.lang.String determineColumnName(java.util.Collection names, java.lang.String tableName, java.sql.Connection connection) throws PersistenceException
names
- The collection of possible column names.tableName
- The name of the database table to check for column matches in.connection
- The connection to the database to determine column name in.
PersistenceException
- If anything goes wrong during the name determining, or if
more than one of the possible column names matches a column in the
table.java.lang.String determineTableName(java.util.Collection names, java.sql.Connection connection) throws PersistenceException
PersistenceException
is thrown. If more than one of the possible table names matches a
table in the database a PersistenceException is also thrown.
names
- The collection of possible table names.connection
- The connection to the database to determine table name in.
PersistenceException
- If anything goes wrong during the name determining, or if
none or more than one of the possible table names matches a table in the
database.java.lang.String determineTableName(java.util.Collection names, java.lang.String databaseName, java.sql.Connection connection) throws PersistenceException
PersistenceException
is thrown. If more than one of the possible table names matches a
table in the database a PersistenceException is also thrown.
names
- The collection of possible table names.databaseName
- The name of the database. Set to null if not known. The database name is usually
implicitly referenced in the database connection, so you most often won't need to
set this parameter to anything but null.connection
- The connection to the database to determine table name in.
PersistenceException
- If anything goes wrong during the name determining, or if
none or more than one of the possible table names matches a table in the
database.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |