|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.hibernate.dialect.Dialect
Represents a dialect of SQL implemented by a particular RDBMS.
Subclasses implement Hibernate compatibility with different systems.
Subclasses should provide a public default constructor that register()
a set of type mappings and default Hibernate properties.
Subclasses should be immutable.
Field Summary | |
static String |
CLOSED_QUOTE
|
static String |
QUOTE
Characters used for quoting SQL identifiers |
Constructor Summary | |
protected |
Dialect()
|
Method Summary | |
String |
appendIdentitySelectToInsert(String insertSQL)
Generate SQL to get the identifier of an inserted row. |
boolean |
bindLimitParametersFirst()
Does the LIMIT clause come at the start of the SELECT statement, rather than at the end? |
boolean |
bindLimitParametersInReverseOrder()
Does the LIMIT clause specify arguments in the "reverse" order limit, offset instead of offset, limit? |
SQLExceptionConverter |
buildSQLExceptionConverter()
Build an instance of the SQLExceptionConverter preferred by this dialect for converting SQLExceptions into Hibernate's JDBCException hierarchy. |
char |
closeQuote()
The closing quote for a quoted identifier |
CaseFragment |
createCaseFragment()
Create a CaseFragment for this dialect. |
JoinFragment |
createOuterJoinFragment()
Create an OuterJoinGenerator for this dialect. |
boolean |
dropConstraints()
Do we need to drop constraints before dropping tables in this dialect? |
String |
getAddColumnString()
The syntax used to add a column to a table (optional). |
String |
getAddForeignKeyConstraintString(String constraintName,
String[] foreignKey,
String referencedTable,
String[] primaryKey)
The syntax used to add a foreign key constraint to a table. |
String |
getAddPrimaryKeyConstraintString(String constraintName)
The syntax used to add a primary key constraint to a table. |
String |
getCascadeConstraintsString()
Completely optional cascading drop clause |
String |
getCreateSequenceString(String sequenceName)
The syntax used to create a sequence, if sequences are supported. |
Properties |
getDefaultProperties()
Retrieve a set of default Hibernate properties for this database. |
static Dialect |
getDialect()
Get the Dialect specified by the current System properties. |
static Dialect |
getDialect(Properties props)
Get the Dialect specified by the given properties or system properties. |
String |
getDropForeignKeyString()
|
String |
getDropSequenceString(String sequenceName)
The syntax used to drop a sequence, if sequences are supported. |
Map |
getFunctions()
SQL functions as defined in general. |
String |
getIdentityColumnString()
The keyword used to specify an identity column, if identity column key generation is supported. |
String |
getIdentityInsertString()
The keyword used to insert a generated value into an identity column (or null) |
String |
getIdentitySelectString()
The syntax that returns the identity value of the last insert, if identity column key generation is supported. |
String |
getLimitString(String querySelect,
boolean hasOffset)
Add a LIMIT clause to the given SQL SELECT |
String |
getLimitString(String querySelect,
boolean hasOffset,
int limit)
|
String |
getLowercaseFunction()
The name of the SQL function that transforms a string to lowercase |
String |
getNoColumnsInsertString()
The keyword used to insert a row without specifying any column values |
String |
getNullColumnString()
The keyword used to specify a nullable column. |
String |
getQuerySequencesString()
A query used to find all sequences |
char |
getSchemaSeparator()
The separator between the schema/tablespace name and the table name. |
String |
getSequenceNextValString(String sequenceName)
The syntax that fetches the next value of a sequence, if sequences are supported. |
String |
getTypeName(int code)
Get the name of the database type associated with the given java.sql.Types typecode. |
String |
getTypeName(int code,
int length)
Get the name of the database type associated with the given java.sql.Types typecode. |
ViolatedConstraintNameExtracter |
getViolatedConstraintNameExtracter()
|
boolean |
hasAlterTable()
Does this dialect support the ALTER TABLE syntax? |
boolean |
hasDataTypeInIdentityColumn()
Whether this dialect have an Identity clause added to the data type or a completely seperate identity data type |
char |
openQuote()
The opening quote for a quoted identifier |
boolean |
qualifyIndexName()
Do we need to qualify index names with the schema name? |
protected void |
registerColumnType(int code,
int capacity,
String name)
Subclasses register a typename for the given type code and maximum column length. |
protected void |
registerColumnType(int code,
String name)
Subclasses register a typename for the given type code. |
protected void |
registerFunction(String name,
SQLFunction function)
|
boolean |
supportsCheck()
Does this dialect support check constraints? |
boolean |
supportsForUpdate()
Does this dialect support the FOR UPDATE syntax? |
boolean |
supportsForUpdateNowait()
Does this dialect support the Oracle-style FOR UPDATE NOWAIT syntax? |
boolean |
supportsForUpdateOf()
Does this dialect support FOR UPDATE OF, allowing particular rows to be locked? |
boolean |
supportsIdentityColumns()
Does this dialect support identity column key generation? |
boolean |
supportsIfExistsAfterTableName()
|
boolean |
supportsIfExistsBeforeTableName()
|
boolean |
supportsLimit()
Does this Dialect have some kind of LIMIT syntax? |
boolean |
supportsLimitOffset()
Does this dialect support an offset? |
boolean |
supportsSequences()
Does this dialect support sequences? |
boolean |
supportsUnique()
Does this dialect support the UNIQUE column syntax? |
boolean |
supportsUniqueConstraintInCreateAlterTable()
Does this dialect support adding Unique constraints via create and alter table ? |
boolean |
supportsVariableLimit()
|
String |
toString()
|
boolean |
useMaxForLimit()
Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows? |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String QUOTE
public static final String CLOSED_QUOTE
Constructor Detail |
protected Dialect()
Method Detail |
public String toString()
public String getTypeName(int code) throws HibernateException
code
- java.sql.Types typecode
HibernateException
public String getTypeName(int code, int length) throws HibernateException
code
- java.sql.Types typecodelength
- the length of the column
HibernateException
protected void registerFunction(String name, SQLFunction function)
protected void registerColumnType(int code, int capacity, String name)
code
- java.sql.Types typecodecapacity
- maximum length of database typename
- the database type nameprotected void registerColumnType(int code, String name)
code
- java.sql.Types typecodename
- the database type namepublic boolean hasAlterTable()
public boolean dropConstraints()
public boolean qualifyIndexName()
public boolean supportsForUpdate()
public boolean supportsForUpdateOf()
public boolean supportsForUpdateNowait()
public boolean supportsUnique()
public boolean supportsUniqueConstraintInCreateAlterTable()
public String getAddColumnString()
public String getDropForeignKeyString()
public String getAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey)
public String getAddPrimaryKeyConstraintString(String constraintName)
public String getNullColumnString()
public boolean supportsIdentityColumns()
public boolean supportsSequences()
public String appendIdentitySelectToInsert(String insertSQL)
insertSQL
- a parameterized SQL statement to insert a row into a table.
null
if this dialect doesn't support this feature.public String getIdentitySelectString() throws MappingException
MappingException
- if no native key generationpublic String getIdentityColumnString() throws MappingException
MappingException
- if no native key generationpublic String getIdentityInsertString()
public String getNoColumnsInsertString()
public String getSequenceNextValString(String sequenceName) throws MappingException
sequenceName
- the name of the sequence
MappingException
- if no sequencespublic String getCreateSequenceString(String sequenceName) throws MappingException
sequenceName
- the name of the sequence
MappingException
- if no sequencespublic String getDropSequenceString(String sequenceName) throws MappingException
sequenceName
- the name of the sequence
MappingException
- if no sequencespublic String getQuerySequencesString()
SchemaUpdate
public static Dialect getDialect() throws HibernateException
HibernateException
public static Dialect getDialect(Properties props) throws HibernateException
props
-
HibernateException
public final Properties getDefaultProperties()
public String getCascadeConstraintsString()
public JoinFragment createOuterJoinFragment()
public CaseFragment createCaseFragment()
public String getLowercaseFunction()
public boolean supportsLimit()
public boolean supportsLimitOffset()
public String getLimitString(String querySelect, boolean hasOffset)
public String getLimitString(String querySelect, boolean hasOffset, int limit)
public boolean supportsVariableLimit()
public boolean bindLimitParametersInReverseOrder()
public boolean bindLimitParametersFirst()
public boolean useMaxForLimit()
public char openQuote()
public char closeQuote()
public final Map getFunctions()
public boolean supportsIfExistsBeforeTableName()
public boolean supportsIfExistsAfterTableName()
public char getSchemaSeparator()
public boolean supportsCheck()
public boolean hasDataTypeInIdentityColumn()
public SQLExceptionConverter buildSQLExceptionConverter()
public ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |