|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.adapter.DatabaseAdapter
org.datanucleus.store.rdbms.adapter.HSQLAdapter
public class HSQLAdapter
Provides methods for adapting SQL language elements to the Hypersonic SQL Server database.
| Field Summary |
|---|
| Fields inherited from class org.datanucleus.store.rdbms.adapter.DatabaseAdapter |
|---|
catalogSeparator, datastoreMajorVersion, datastoreMinorVersion, datastoreProductName, datastoreProductVersion, datastoreRevisionVersion, driverMajorVersion, driverMinorVersion, driverName, driverVersion, identifierQuoteString, LOCALISER, LOCALISER_BASE, maxColumnNameLength, maxConstraintNameLength, maxIndexNameLength, maxTableNameLength, properties, reservedKeywords, supportedOptions |
| Fields inherited from interface org.datanucleus.store.mapped.DatastoreAdapter |
|---|
ANALYSIS_METHODS, BIT_IS_REALLY_BOOLEAN, BOOLEAN_COMPARISON, CATALOGS_IN_TABLE_DEFINITIONS, ESCAPE_EXPRESSION_IN_LIKE_PREDICATE, IDENTIFIERS_LOWERCASE, IDENTIFIERS_LOWERCASE_QUOTED, IDENTIFIERS_MIXEDCASE, IDENTIFIERS_MIXEDCASE_QUOTED, IDENTIFIERS_MIXEDCASE_QUOTED_SENSITIVE, IDENTIFIERS_MIXEDCASE_SENSITIVE, IDENTIFIERS_UPPERCASE, IDENTIFIERS_UPPERCASE_QUOTED, IDENTITY_COLUMNS, PROJECTION_IN_TABLE_REFERENCE_JOINS, SCHEMAS_IN_TABLE_DEFINITIONS, SEQUENCES |
| Constructor Summary | |
|---|---|
HSQLAdapter(java.sql.DatabaseMetaData metadata)
Constructs a Hypersonic SQL adapter based on the given JDBC metadata. |
|
| Method Summary | |
|---|---|
java.lang.String |
getAddColumnStatement(org.datanucleus.store.mapped.DatastoreContainerObject table,
Column col)
Accessor for the SQL statement to add a column to a table. |
java.lang.String |
getAddPrimaryKeyStatement(PrimaryKey pk,
org.datanucleus.store.mapped.IdentifierFactory factory)
HSQL 1.7.0 does not support ALTER TABLE to define a primary key |
java.lang.String |
getAutoIncrementKeyword()
Accessor for the auto-increment keyword for generating DDLs (CREATE TABLEs...). |
java.lang.String |
getAutoIncrementStmt(Table table,
java.lang.String columnName)
Accessor for the auto-increment sql statement for this datastore. |
java.lang.String |
getDatastoreDateStatement()
Accessor for a statement that will return the statement to use to get the datastore date. |
int |
getDatastoreIdentifierMaxLength(org.datanucleus.store.mapped.IdentifierType identifierType)
Method to return the maximum length of a datastore identifier of the specified type. |
java.lang.String |
getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
Returns the appropriate SQL to drop the given table. |
java.lang.String |
getInsertStatementForNoColumns(Table table)
Method to retutn the INSERT statement to use when inserting into a table that has no columns specified. |
java.lang.String |
getRangeByLimitSelectClause(long offset,
long count)
Method to return the SQL to append to the SELECT clause of a SELECT statement to handle restriction of ranges using the LIMUT keyword. |
java.lang.String |
getSchemaName(java.sql.Connection conn)
Accessor for the Schema Name for this datastore. |
java.lang.String |
getSequenceCreateStmt(java.lang.String sequence_name,
java.lang.String min,
java.lang.String max,
java.lang.String start,
java.lang.String increment,
java.lang.String cache_size)
Accessor for the sequence statement to create the sequence. |
java.lang.String |
getSequenceNextStmt(java.lang.String sequence_name)
Accessor for the statement for getting the next id from the sequence for this datastore. |
java.lang.String |
getVendorID()
Accessor for the vendor ID for this adapter. |
void |
initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.ManagedConnection mconn)
Initialise the types for this datastore. |
boolean |
isValidPrimaryKeyType(int datatype)
Accessor for whether the specified type is allow to be part of a PK. |
org.datanucleus.store.mapped.expression.NumericExpression |
modOperator(org.datanucleus.store.mapped.expression.ScalarExpression operand1,
org.datanucleus.store.mapped.expression.ScalarExpression operand2)
Method to generate a modulus expression. |
SQLTypeInfo |
newSQLTypeInfo(java.sql.ResultSet rs)
Create a new SQL type info from the current row of the passed ResultSet. |
org.datanucleus.store.mapped.expression.StringExpression |
trimMethod(org.datanucleus.store.mapped.expression.StringExpression str,
boolean leading,
boolean trailing)
Returns the appropriate SQL expression for the java query "trim" method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HSQLAdapter(java.sql.DatabaseMetaData metadata)
metadata - the database metadata.| Method Detail |
|---|
public void initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.ManagedConnection mconn)
initialiseTypes in interface org.datanucleus.store.mapped.DatastoreAdapterinitialiseTypes in class DatabaseAdapterhandler - SchemaHandler that we initialise the types formconn - Managed connection to usepublic java.lang.String getVendorID()
getVendorID in interface org.datanucleus.store.mapped.DatastoreAdaptergetVendorID in class DatabaseAdapterpublic int getDatastoreIdentifierMaxLength(org.datanucleus.store.mapped.IdentifierType identifierType)
getDatastoreIdentifierMaxLength in interface org.datanucleus.store.mapped.DatastoreAdaptergetDatastoreIdentifierMaxLength in class DatabaseAdapteridentifierType - Type of identifier (see IdentifierFactory.TABLE, etc)
public java.lang.String getAddColumnStatement(org.datanucleus.store.mapped.DatastoreContainerObject table,
Column col)
getAddColumnStatement in interface RDBMSAdaptergetAddColumnStatement in class DatabaseAdaptertable - The tablecol - The column
public java.lang.String getRangeByLimitSelectClause(long offset,
long count)
getRangeByLimitSelectClause in interface RDBMSAdaptergetRangeByLimitSelectClause in class DatabaseAdapteroffset - The offset to return fromcount - The number of items to return
public SQLTypeInfo newSQLTypeInfo(java.sql.ResultSet rs)
RDBMSAdapter
newSQLTypeInfo in interface RDBMSAdapternewSQLTypeInfo in class DatabaseAdapterrs - ResultSet
public java.lang.String getSchemaName(java.sql.Connection conn)
throws java.sql.SQLException
getSchemaName in interface RDBMSAdaptergetSchemaName in class DatabaseAdapterconn - Connection to the datastore
java.sql.SQLException - Thrown if error occurs in determining the schema name.
public java.lang.String getAddPrimaryKeyStatement(PrimaryKey pk,
org.datanucleus.store.mapped.IdentifierFactory factory)
getAddPrimaryKeyStatement in interface RDBMSAdaptergetAddPrimaryKeyStatement in class DatabaseAdapterpk - An object describing the primary key.factory - Identifier factory
public java.lang.String getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
DROP TABLE FOO
getDropTableStatement in interface RDBMSAdaptergetDropTableStatement in class DatabaseAdaptertable - The table to drop.
public java.lang.String getAutoIncrementStmt(Table table,
java.lang.String columnName)
getAutoIncrementStmt in interface RDBMSAdaptergetAutoIncrementStmt in class DatabaseAdaptertable - Name of the table that the autoincrement is forcolumnName - Name of the column that the autoincrement is for
public java.lang.String getAutoIncrementKeyword()
getAutoIncrementKeyword in interface RDBMSAdaptergetAutoIncrementKeyword in class DatabaseAdapterpublic java.lang.String getInsertStatementForNoColumns(Table table)
getInsertStatementForNoColumns in interface RDBMSAdaptergetInsertStatementForNoColumns in class DatabaseAdaptertable - The table
public boolean isValidPrimaryKeyType(int datatype)
isValidPrimaryKeyType in interface RDBMSAdapterisValidPrimaryKeyType in class DatabaseAdapterdatatype - The JDBC type
public java.lang.String getDatastoreDateStatement()
getDatastoreDateStatement in interface RDBMSAdaptergetDatastoreDateStatement in class DatabaseAdapter
public java.lang.String getSequenceCreateStmt(java.lang.String sequence_name,
java.lang.String min,
java.lang.String max,
java.lang.String start,
java.lang.String increment,
java.lang.String cache_size)
getSequenceCreateStmt in interface RDBMSAdaptergetSequenceCreateStmt in class DatabaseAdaptersequence_name - Name of the sequencemin - Minimum value for the sequencemax - Maximum value for the sequencestart - Start value for the sequenceincrement - Increment value for the sequencecache_size - Cache size for the sequence
public java.lang.String getSequenceNextStmt(java.lang.String sequence_name)
getSequenceNextStmt in interface RDBMSAdaptergetSequenceNextStmt in class DatabaseAdaptersequence_name - Name of the sequence
public org.datanucleus.store.mapped.expression.NumericExpression modOperator(org.datanucleus.store.mapped.expression.ScalarExpression operand1,
org.datanucleus.store.mapped.expression.ScalarExpression operand2)
modOperator in interface org.datanucleus.store.mapped.DatastoreAdaptermodOperator in interface org.datanucleus.store.mapped.expression.ExpressionOperatorAdaptermodOperator in class DatabaseAdapteroperand1 - the left expressionoperand2 - the right expression
public org.datanucleus.store.mapped.expression.StringExpression trimMethod(org.datanucleus.store.mapped.expression.StringExpression str,
boolean leading,
boolean trailing)
LTRIM(RTRIM(str))
trimMethod in interface org.datanucleus.store.mapped.expression.ExpressionMethodAdaptertrimMethod in class DatabaseAdapterstr - The first argument to the trim() method.leading - Whether to trim leading spacestrailing - Whether to trim trailing spaces
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||