|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.engine.platform.PlatformDefaultImpl
public class PlatformDefaultImpl
Default implementation for the Platform interface.
Field Summary | |
---|---|
private Map<SchemaType,Domain> |
schemaDomainMap
|
Fields inherited from interface org.apache.torque.engine.platform.Platform |
---|
IDENTITY, SEQUENCE |
Constructor Summary | |
---|---|
PlatformDefaultImpl()
Default constructor. |
Method Summary | |
---|---|
boolean |
createNotNullBeforeAutoincrement()
Returns whether the "not null part" of the definition of a column should be generated before the "autoincrement part" in a "create table" statement. |
String |
filterInvalidDefaultValues(String defaultValue)
|
String |
getAutoIncrement()
|
Domain |
getDomainForSchemaType(SchemaType jdbcType)
Returns the db specific domain for a jdbcType. |
int |
getMaxColumnNameLength()
Returns the max column length supported by the db. |
String |
getNativeIdMethod()
Returns the native IdMethod (sequence|identity) |
String |
getNullString(boolean notNull)
|
List<String> |
getPrimaryKeys(DatabaseMetaData dbMeta,
String dbSchema,
String tableName)
Retrieves a list of the columns composing the primary key for a given table. |
String |
getSchemaName(String artifactId)
Given an artifact id, return a string a schema name based on the artifact id that is allowed by the db vendor |
Long |
getSequenceNextVal(Connection con,
String schema,
String sequenceName)
|
String |
getServerUrl(String url)
Given a JDBC url return a url that can connect directly to the database server itself. |
List<String> |
getTableNames(DatabaseMetaData dbMeta,
String databaseSchema)
Get all the table names in the current database that are not system tables. |
String |
getViewDefinition(Connection con,
String schema,
String viewName)
|
boolean |
hasScale(String sqlType)
Returns if the RDBMS-specific SQL type has a scale attribute. |
boolean |
hasSize(String sqlType)
Returns if the RDBMS-specific SQL type has a size attribute. |
private void |
initialize()
|
boolean |
isSpecialDefault(String defaultValue)
|
protected void |
setSchemaDomainMapping(Domain domain)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Map<SchemaType,Domain> schemaDomainMap
Constructor Detail |
---|
public PlatformDefaultImpl()
Method Detail |
---|
private void initialize()
protected void setSchemaDomainMapping(Domain domain)
public String getServerUrl(String url)
Platform
getServerUrl
in interface Platform
public String getSchemaName(String artifactId)
Platform
getSchemaName
in interface Platform
public int getMaxColumnNameLength()
Platform
getMaxColumnNameLength
in interface Platform
Platform.getMaxColumnNameLength()
public String getNativeIdMethod()
Platform
getNativeIdMethod
in interface Platform
Platform.getNativeIdMethod()
public Domain getDomainForSchemaType(SchemaType jdbcType)
Platform
getDomainForSchemaType
in interface Platform
jdbcType
- the jdbcType name
Platform.getDomainForSchemaType(SchemaType)
public String getNullString(boolean notNull)
getNullString
in interface Platform
Platform.getNullString(boolean)
public String getAutoIncrement()
getAutoIncrement
in interface Platform
Platform.getAutoIncrement()
public boolean hasScale(String sqlType)
Platform
hasScale
in interface Platform
sqlType
- the SQL type
TODO collect info for all platforms
public boolean hasSize(String sqlType)
Platform
hasSize
in interface Platform
sqlType
- the SQL type
TODO collect info for all platforms
public boolean createNotNullBeforeAutoincrement()
Platform
createNotNullBeforeAutoincrement
in interface Platform
Platform.createNotNullBeforeAutoincrement()
public String filterInvalidDefaultValues(String defaultValue)
filterInvalidDefaultValues
in interface Platform
public boolean isSpecialDefault(String defaultValue)
isSpecialDefault
in interface Platform
public Long getSequenceNextVal(Connection con, String schema, String sequenceName)
getSequenceNextVal
in interface Platform
public String getViewDefinition(Connection con, String schema, String viewName)
getViewDefinition
in interface Platform
public List<String> getPrimaryKeys(DatabaseMetaData dbMeta, String dbSchema, String tableName) throws SQLException
getPrimaryKeys
in interface Platform
dbMeta
- JDBC metadata.tableName
- Table from which to retrieve PK information.
tableName
.
SQLException
public List<String> getTableNames(DatabaseMetaData dbMeta, String databaseSchema) throws SQLException
getTableNames
in interface Platform
dbMeta
- JDBC database metadata.
SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |