|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.hajdbc.dialect.StandardDialect
public class StandardDialect
| Constructor Summary | |
|---|---|
StandardDialect()
|
|
| Method Summary | |
|---|---|
protected String |
alterIdentityColumnFormat()
|
protected String |
alterSequenceFormat()
|
protected String |
createForeignKeyConstraintFormat()
|
protected String |
createUniqueConstraintFormat()
|
protected String |
currentDatePattern()
|
protected String |
currentTimePattern()
|
protected String |
currentTimestampFunction()
|
protected String |
currentTimestampPattern()
|
protected String |
dateLiteralFormat()
|
protected String |
dropConstraintFormat()
|
protected String |
dropForeignKeyConstraintFormat()
|
protected String |
dropUniqueConstraintFormat()
|
protected String |
dummyTable()
|
String |
evaluateCurrentDate(String sql,
Date date)
Replaces non-deterministic CURRENT_DATE functions with deterministic static values. |
String |
evaluateCurrentTime(String sql,
Time time)
Replaces non-deterministic CURRENT_TIME functions with deterministic static values. |
String |
evaluateCurrentTimestamp(String sql,
Timestamp timestamp)
Replaces non-deterministic CURRENT_TIMESTAMP functions with deterministic static values. |
String |
evaluateRand(String sql)
Replaces non-deterministic RAND() functions with deterministic static values. |
protected String |
executeFunction(Connection connection,
String function)
|
protected String |
executeFunctionFormat()
|
protected String |
executeFunctionSQL(String function)
|
protected List<String> |
executeQuery(Connection connection,
String sql)
|
String |
getAlterIdentityColumnSQL(TableProperties table,
ColumnProperties column,
long value)
Returns a SQL statement used reset the current value of an identity column. |
String |
getAlterSequenceSQL(SequenceProperties sequence,
long value)
Returns a SQL statement used reset the current value of a sequence. |
int |
getColumnType(ColumnProperties properties)
Returns the data type of the specified column of the specified schema and table. |
String |
getCreateForeignKeyConstraintSQL(ForeignKeyConstraint key)
Returns a SQL statement used to create a foreign key constraint. |
String |
getCreateUniqueConstraintSQL(UniqueConstraint constraint)
Returns a SQL statement used to create a unique constraint. |
List<String> |
getDefaultSchemas(DatabaseMetaData metaData)
Returns a search path of schemas |
String |
getDropForeignKeyConstraintSQL(ForeignKeyConstraint key)
Returns a SQL statement used to drop a foreign key constraint. |
String |
getDropUniqueConstraintSQL(UniqueConstraint constraint)
Returns a SQL statement used to drop a unique constraint. |
Pattern |
getIdentifierPattern(DatabaseMetaData metaData)
Returns a pattern for identifiers that do not require quoting |
String |
getNextSequenceValueSQL(SequenceProperties sequence)
Returns a SQL statement for obtaining the next value the specified sequence |
Collection<QualifiedName> |
getSequences(DatabaseMetaData metaData)
Returns a collection of all sequences in this database. |
String |
getSimpleSQL()
Returns a simple SQL statement used to validate whether a database is alive or not. |
String |
getTruncateTableSQL(TableProperties properties)
Returns a SQL statement used to truncate a table. |
protected String |
insertIntoTablePattern()
|
boolean |
isIdentity(ColumnProperties properties)
Indicates whether or not the specified column is an identity column. |
boolean |
isSelectForUpdate(String sql)
Determines whether the specified SQL is a SELECT ... |
protected String |
nextSequenceValueFormat()
|
protected String |
parse(Pattern pattern,
String string)
|
String |
parseInsertTable(String sql)
Parses a table name from the specified INSERT SQL statement that may contain identity columns. |
String |
parseSequence(String sql)
Parses a sequence name from the specified SQL statement. |
protected String |
randomPattern()
|
protected String |
selectForUpdatePattern()
|
protected String |
sequencePattern()
|
protected String |
sequenceTableType()
|
protected String |
timeLiteralFormat()
|
protected String |
timestampLiteralFormat()
|
protected String |
truncateTableFormat()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StandardDialect()
| Method Detail |
|---|
protected String selectForUpdatePattern()
protected String insertIntoTablePattern()
protected String sequencePattern()
protected String currentDatePattern()
protected String currentTimePattern()
protected String currentTimestampPattern()
protected String randomPattern()
public String getSimpleSQL()
Dialect
getSimpleSQL in interface DialectDialect.getSimpleSQL()protected String executeFunctionFormat()
protected String executeFunctionSQL(String function)
protected String currentTimestampFunction()
protected String dummyTable()
public String getTruncateTableSQL(TableProperties properties)
Dialect
getTruncateTableSQL in interface Dialectproperties - table meta data
Dialect.getTruncateTableSQL(net.sf.hajdbc.TableProperties)protected String truncateTableFormat()
public String getCreateForeignKeyConstraintSQL(ForeignKeyConstraint key)
Dialect
getCreateForeignKeyConstraintSQL in interface Dialectkey - foreign key constraint meta data
Dialect.getCreateForeignKeyConstraintSQL(net.sf.hajdbc.ForeignKeyConstraint)protected String createForeignKeyConstraintFormat()
public String getDropForeignKeyConstraintSQL(ForeignKeyConstraint key)
Dialect
getDropForeignKeyConstraintSQL in interface Dialectkey - foreign key constraint meta data
Dialect.getDropForeignKeyConstraintSQL(net.sf.hajdbc.ForeignKeyConstraint)protected String dropForeignKeyConstraintFormat()
protected String dropConstraintFormat()
public String getCreateUniqueConstraintSQL(UniqueConstraint constraint)
Dialect
getCreateUniqueConstraintSQL in interface Dialectconstraint - unique constraint meta data
Dialect.getCreateUniqueConstraintSQL(net.sf.hajdbc.UniqueConstraint)protected String createUniqueConstraintFormat()
public String getDropUniqueConstraintSQL(UniqueConstraint constraint)
Dialect
getDropUniqueConstraintSQL in interface Dialectconstraint - unique constraint meta data
Dialect.getDropUniqueConstraintSQL(net.sf.hajdbc.UniqueConstraint)protected String dropUniqueConstraintFormat()
public boolean isIdentity(ColumnProperties properties)
Dialect
isIdentity in interface Dialectproperties - a table column
Dialect.isIdentity(net.sf.hajdbc.ColumnProperties)public boolean isSelectForUpdate(String sql)
Dialect
isSelectForUpdate in interface Dialectsql - a SQL statement
Dialect.isSelectForUpdate(java.lang.String)public String parseInsertTable(String sql)
Dialect
parseInsertTable in interface Dialectsql - a SQL statement
Dialect.parseInsertTable(java.lang.String)
public List<String> getDefaultSchemas(DatabaseMetaData metaData)
throws SQLException
Dialect
getDefaultSchemas in interface DialectSQLExceptionDialect.getDefaultSchemas(java.sql.DatabaseMetaData)
protected String executeFunction(Connection connection,
String function)
throws SQLException
SQLException
protected List<String> executeQuery(Connection connection,
String sql)
throws SQLException
SQLExceptionpublic String parseSequence(String sql)
Dialect
parseSequence in interface Dialectsql - a SQL statement
Dialect.parseSequence(java.lang.String)public int getColumnType(ColumnProperties properties)
Dialect
getColumnType in interface Dialectproperties - table column meta data
Dialect.getColumnType(net.sf.hajdbc.ColumnProperties)
public Collection<QualifiedName> getSequences(DatabaseMetaData metaData)
throws SQLException
Dialect
getSequences in interface DialectmetaData - database meta data
SQLExceptionDialect.getSequences(java.sql.DatabaseMetaData)protected String sequenceTableType()
public String getNextSequenceValueSQL(SequenceProperties sequence)
Dialect
getNextSequenceValueSQL in interface Dialectsequence - a sequence name
Dialect.getNextSequenceValueSQL(net.sf.hajdbc.SequenceProperties)protected String nextSequenceValueFormat()
public String getAlterSequenceSQL(SequenceProperties sequence,
long value)
Dialect
getAlterSequenceSQL in interface Dialectsequence - a sequence namevalue - a sequence value
Dialect.getAlterSequenceSQL(net.sf.hajdbc.SequenceProperties, long)protected String alterSequenceFormat()
public String getAlterIdentityColumnSQL(TableProperties table,
ColumnProperties column,
long value)
throws SQLException
Dialect
getAlterIdentityColumnSQL in interface Dialecttable - a sequence namecolumn - a sequence namevalue - a sequence value
SQLExceptionprotected String alterIdentityColumnFormat()
public Pattern getIdentifierPattern(DatabaseMetaData metaData)
throws SQLException
Dialect
getIdentifierPattern in interface DialectSQLExceptionDialect.getIdentifierPattern(java.sql.DatabaseMetaData)
protected String parse(Pattern pattern,
String string)
public String evaluateCurrentDate(String sql,
Date date)
Dialect
evaluateCurrentDate in interface Dialectsql - an SQL statementdate - the replacement date
Dialect.evaluateCurrentDate(java.lang.String, java.sql.Date)protected String dateLiteralFormat()
public String evaluateCurrentTime(String sql,
Time time)
Dialect
evaluateCurrentTime in interface Dialectsql - an SQL statementtime - the replacement time
Dialect.evaluateCurrentTime(java.lang.String, java.sql.Time)protected String timeLiteralFormat()
public String evaluateCurrentTimestamp(String sql,
Timestamp timestamp)
Dialect
evaluateCurrentTimestamp in interface Dialectsql - an SQL statementtimestamp - the replacement timestamp
Dialect.evaluateCurrentTimestamp(java.lang.String, java.sql.Timestamp)protected String timestampLiteralFormat()
public String evaluateRand(String sql)
Dialect
evaluateRand in interface Dialectsql - an SQL statement
Dialect.evaluateRand(java.lang.String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||