Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.hibernate.dialect.Dialect
org.hibernate.dialect.PostgreSQLDialect
public class PostgreSQLDialect
extends Dialect
Field Summary |
Fields inherited from class org.hibernate.dialect.Dialect | |
CLOSED_QUOTE , DEFAULT_BATCH_SIZE , NO_BATCH , QUOTE |
Constructor Summary | |
Method Summary | |
boolean |
|
boolean |
|
String |
|
String |
|
String |
|
String |
|
String |
|
String |
|
String |
|
String |
|
String |
|
String |
|
String |
|
Class |
|
String |
|
String |
|
String |
|
String |
|
String |
|
ViolatedConstraintNameExtracter | |
boolean |
|
boolean |
|
boolean | |
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
String |
|
boolean |
|
public boolean bindLimitParametersInReverseOrder()
ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit. Does this dialect require us to bind the parameters in reverse order?
- Overrides:
- bindLimitParametersInReverseOrder in interface Dialect
- Returns:
- true if the correct order is limit, offset
public boolean dropConstraints()
Do we need to drop constraints before dropping tables in this dialect?
- Overrides:
- dropConstraints in interface Dialect
- Returns:
- True if constraints must be dropped prior to dropping the table; false otherwise.
public String getAddColumnString()
The syntax used to add a column to a table (optional).
- Overrides:
- getAddColumnString in interface Dialect
- Returns:
- The "add column" fragment.
public String getCascadeConstraintsString()
Completely optional cascading drop clause
- Overrides:
- getCascadeConstraintsString in interface Dialect
- Returns:
- String
public String getCreateSequenceString(String sequenceName)
Typically dialects which support sequences can create a sequence with a single command. This is convenience form ofgetCreateSequenceStrings
to help facilitate that. Dialects which support sequences and can create a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to create a sequence should instead overridegetCreateSequenceStrings
.
- Overrides:
- getCreateSequenceString in interface Dialect
- Parameters:
sequenceName
- The name of the sequence
- Returns:
- The sequence creation command
public String getCreateTemporaryTablePostfix()
Get any fragments needing to be postfixed to the command for temporary table creation.
- Overrides:
- getCreateTemporaryTablePostfix in interface Dialect
- Returns:
- Any required postfix.
public String getCreateTemporaryTableString()
Command used to create a temporary table.
- Overrides:
- getCreateTemporaryTableString in interface Dialect
- Returns:
- The command used to create a temporary table.
public String getCurrentTimestampSelectString()
Retrieve the command used to retrieve the current timestammp from the database.
- Overrides:
- getCurrentTimestampSelectString in interface Dialect
- Returns:
- The command.
public String getDropSequenceString(String sequenceName)
Typically dialects which support sequences can drop a sequence with a single command. This is convenience form ofDialect.getDropSequenceStrings(String)
to help facilitate that. Dialects which support sequences and can drop a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to drop a sequence should instead overrideDialect.getDropSequenceStrings(String)
.
- Overrides:
- getDropSequenceString in interface Dialect
- Parameters:
sequenceName
- The name of the sequence
- Returns:
- The sequence drop commands
public String getForUpdateString(String aliases)
Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.
- Overrides:
- getForUpdateString in interface Dialect
- Parameters:
aliases
- The columns to be write locked.
- Returns:
- The appropriate FOR UPDATE OF column_list clause string.
public String getIdentityColumnString(int type)
The syntax used during DDL to define a column as being an IDENTITY of a particular type.
- Overrides:
- getIdentityColumnString in interface Dialect
- Parameters:
type
- Thejava.sql.Types
type code.
- Returns:
- The appropriate DDL fragment.
public String getIdentitySelectString(String table, String column, int type)
Get the select command to use to retrieve the last generated IDENTITY value for a particuar table
- Overrides:
- getIdentitySelectString in interface Dialect
- Parameters:
table
- The table into which the insert was donecolumn
- The PK column.type
- Thejava.sql.Types
type code.
- Returns:
- The appropriate select command
public String getLimitString(String sql, boolean hasOffset)
Apply s limit clause to the query. Typically dialects utilizevariable
limit caluses when they support limits. Thus, when building the select command we do not actually need to know the limit or the offest since we will just be using placeholders. Here we do still pass along whether or not an offset was specified so that dialects not supporting offsets can generate proper exceptions. In general, dialects will override one or the other of this method andDialect.getLimitString(String,int,int)
.
- Overrides:
- getLimitString in interface Dialect
- Parameters:
hasOffset
- Is the query requesting an offset?
- Returns:
- the modified SQL
public Class getNativeIdentifierGeneratorClass()
The class (which implementsIdentifierGenerator
) which acts as this dialects native generation strategy. Comes into play whenever the user specifies the native generator.
- Overrides:
- getNativeIdentifierGeneratorClass in interface Dialect
- Returns:
- The native generator class.
public String getNoColumnsInsertString()
The fragment used to insert a row without specifying any column values. This is not possible on some databases.
- Overrides:
- getNoColumnsInsertString in interface Dialect
- Returns:
- The appropriate empty values clause.
public String getQuerySequencesString()
Get the select command used retrieve the names of all sequences.
- Overrides:
- getQuerySequencesString in interface Dialect
- Returns:
- The select command; or null if sequences are not supported.
- See Also:
SchemaUpdate
public String getSelectClauseNullString(int sqlType)
Workaround for postgres bug #1453
- Overrides:
- getSelectClauseNullString in interface Dialect
public String getSelectSequenceNextValString(String sequenceName)
Generate the select expression fragment that will retreive the next value of a sequence as part of another (typically DML) statement. This differs fromDialect.getSequenceNextValString(String)
in that this should return an expression usable within another statement.
- Overrides:
- getSelectSequenceNextValString in interface Dialect
- Parameters:
sequenceName
- the name of the sequence
- Returns:
- The "nextval" fragment.
public String getSequenceNextValString(String sequenceName)
Generate the appropriate select statement to to retreive the next value of a sequence. This should be a "stand alone" select statement.
- Overrides:
- getSequenceNextValString in interface Dialect
- Parameters:
sequenceName
- the name of the sequence
- Returns:
- String The "nextval" select string.
public ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter()
- Overrides:
- getViolatedConstraintNameExtracter in interface Dialect
public boolean hasDataTypeInIdentityColumn()
Whether this dialect have an Identity clause added to the data type or a completely seperate identity data type
- Overrides:
- hasDataTypeInIdentityColumn in interface Dialect
- Returns:
- boolean
public boolean isCurrentTimestampSelectStringCallable()
Should the value returned byDialect.getCurrentTimestampSelectString()
be treated as callable. Typically this indicates that JDBC escape sytnax is being used...
- Overrides:
- isCurrentTimestampSelectStringCallable in interface Dialect
- Returns:
- True if the
Dialect.getCurrentTimestampSelectString()
return is callable; false otherwise.
public boolean supportsCurrentTimestampSelection()
Does this dialect support a way to retrieve the database's current timestamp value?
- Overrides:
- supportsCurrentTimestampSelection in interface Dialect
- Returns:
- True if the current timestamp can be retrieved; false otherwise.
public boolean supportsEmptyInList()
Does this dialect support empty IN lists? For example, is [where XYZ in ()] a supported construct?
- Overrides:
- supportsEmptyInList in interface Dialect
- Returns:
- True if empty in lists are supported; false otherwise.
- Since:
- 3.2
public boolean supportsExpectedLobUsagePattern()
Expected LOB usage pattern is such that I can perform an insert via prepared statement with a parameter binding for a LOB value without crazy casting to JDBC driver implementation-specific classes... Part of the trickiness here is the fact that this is largely driver dependent. For example, Oracle (which is notoriously bad with LOB support in their drivers historically) actually does a pretty good job with LOB support as of the 10.2.x versions of their drivers...
- Overrides:
- supportsExpectedLobUsagePattern in interface Dialect
- Returns:
- True if normal LOB usage patterns can be used with this driver; false if driver-specific hookiness needs to be applied.
- Since:
- 3.2
public boolean supportsIdentityColumns()
Does this dialect support identity column key generation?
- Overrides:
- supportsIdentityColumns in interface Dialect
- Returns:
- True if IDENTITY columns are supported; false otherwise.
public boolean supportsLimit()
Does this dialect support some form of limiting query results via a SQL clause?
- Overrides:
- supportsLimit in interface Dialect
- Returns:
- True if this dialect supports some form of LIMIT.
public boolean supportsOuterJoinForUpdate()
Does this dialect support FOR UPDATE in conjunction with outer joined rows?
- Overrides:
- supportsOuterJoinForUpdate in interface Dialect
- Returns:
- True if outer joined rows can be locked via FOR UPDATE.
public boolean supportsSequences()
Does this dialect support sequences?
- Overrides:
- supportsSequences in interface Dialect
- Returns:
- True if sequences supported; false otherwise.
public boolean supportsTemporaryTables()
Does this dialect support temporary tables?
- Overrides:
- supportsTemporaryTables in interface Dialect
- Returns:
- True if temp tables are supported; false otherwise.
public boolean supportsUnionAll()
Does this dialect support UNION ALL, which is generally a faster variant of UNION?
- Overrides:
- supportsUnionAll in interface Dialect
- Returns:
- True if UNION ALL is supported; false otherwise.
public String toBooleanValueString(boolean bool)
The SQL literal value to which this database maps boolean values.
- Overrides:
- toBooleanValueString in interface Dialect
- Parameters:
bool
- The boolean value
- Returns:
- The appropriate SQL literal.
public boolean useInputStreamToInsertBlob()
Should LOBs (both BLOB and CLOB) be bound using stream operations (i.e.java.sql.PreparedStatement.setBinaryStream
).
- Overrides:
- useInputStreamToInsertBlob in interface Dialect
- Returns:
- True if BLOBs and CLOBs should be bound using stream operations.
- Since:
- 3.2