|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.basedb.core.dbengine.AbstractDbEngine
net.sf.basedb.core.dbengine.PostgresDbEngine
public class PostgresDbEngine
Database engine for Postgres.
| Constructor Summary | |
|---|---|
PostgresDbEngine()
Create PostgresDbEngine. |
|
| Method Summary | |
|---|---|
boolean |
analyzeAfterBatchOperation()
Return true. |
private void |
appendList(StringBuilder sb,
Collection<String> items)
|
boolean |
caseInsensitiveComparison()
Returns FALSE. |
boolean |
checkForInvalidNumberOperation()
Returns TRUE. |
String |
getAnalyzeTableSql(String catalog,
String schema,
String table)
Generate ANALYZE <schema>. |
String |
getApproximateRowCountSql(String catalog,
String schema,
String table)
Get an SQL statement that returns an approximate count for the number of rows in the given table. |
String |
getCreateForeignKeySql(String catalog,
String schema,
String table,
String name,
Set<String> columns,
String refTable,
Set<String> refColumns)
Generate ALTER TABLE schema.table ADD CONSTRAINT name
FOREIGN KEY (columns) REFERERENCES refTable (refColumns) |
String |
getCreateIndexSql(String catalog,
String schema,
String table,
String name,
Set<String> columns,
boolean unique)
Generate ALTER TABLE <schema>. |
String |
getCreatePrimaryKeySql(String catalog,
String schema,
String table,
String name,
Set<String> columns)
Generate ALTER TABLE schema.table ADD CONSTRAINT name
PRIMARY KEY (columns). |
String |
getDropForeignKeySql(String catalog,
String schema,
String table,
String name)
Generate ALTER TABLE <schema>. |
String |
getDropIndexSql(String catalog,
String schema,
String table,
String name,
boolean unique)
Generate ALTER TABLE <schema>. |
String |
getDropPrimaryKey(String catalog,
String schema,
String table,
String name)
Generate ALTER TABLE schema.table DROP CONSTRAINT name |
String |
getInsertAutoIncrementSql(PersistentClass pc)
Return a SQL fragment that can be used in an INSERT INTO statement to generate an ID for new rows. |
String |
getOptimizeTableSql(String catalog,
String schema,
String table)
Generate VACUUM FULL <schema>. |
String |
inspectSchemaGenerationSQL(String sql,
Dialect dialect,
SchemaGenerator.Mode mode)
Skip all "create index" statements since Hibernate doesn't generate those with unique names. |
String |
rlike(String value,
String regexp)
Return <value> ~ <regexp>. |
boolean |
selectOrderByColumnsIfDistinct()
Returns TRUE. |
boolean |
supportColumnAliasInGroupBy()
Returns TRUE. |
boolean |
supportColumnAliasInHaving()
Returns FALSE. |
boolean |
supportColumnAliasInOrderBy()
Returns TRUE. |
boolean |
supportsColumnAliasInWhere()
Returns FALSE. |
boolean |
useSavePointToContinueTransactionFromSqlFailure()
If the underlying database need to create a savepoint before executing an SQL statement that results in an error in order to be able to continue using the same transaction for other SQL queries. |
boolean |
useThetaJoin()
Always false. |
| Methods inherited from class net.sf.basedb.core.dbengine.AbstractDbEngine |
|---|
abs, castToDate, exp, getCaseSensitiveVarchar, getQuotedName, isValidColumnName, isValidName, isValidTableName, ln, makeSafeCreateTable, power |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.basedb.core.dbengine.DbEngine |
|---|
abs, castToDate, exp, getCaseSensitiveVarchar, getQuotedName, isValidColumnName, isValidTableName, ln, makeSafeCreateTable, power |
| Constructor Detail |
|---|
public PostgresDbEngine()
| Method Detail |
|---|
public boolean useThetaJoin()
useThetaJoin in interface DbEngineuseThetaJoin in class AbstractDbEngine
public String getCreateIndexSql(String catalog,
String schema,
String table,
String name,
Set<String> columns,
boolean unique)
ALTER TABLE <schema>.<table> ADD CONSTRAINT <name>
UNIQUE (<columns>) for a unique index,
CREATE INDEX <schema>.<name> ON <schema>.<table> (<columns>)
for other indexes.
The catalog parameter is not supported.
getCreateIndexSql in interface DbEnginecatalog - The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema - The name of the schema where the table is located, or
null if is located in the current schematable - The name of the tablename - The name of the index to be createdcolumns - The name of the columns in the indexunique - If the index must contain unique values or not
public String getDropIndexSql(String catalog,
String schema,
String table,
String name,
boolean unique)
ALTER TABLE <schema>.<table> DROP CONSTRAINT <name>
for unique indexes, DROP INDEX <schema>.<name> for other indexes.
The catalog parameter is not supported.
getDropIndexSql in interface DbEnginecatalog - The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema - The name of the schema where the table is located, or
null if is located in the current schematable - The name of the tablename - The name of the indexunique - If the index contains unique values or not
public String getCreateForeignKeySql(String catalog,
String schema,
String table,
String name,
Set<String> columns,
String refTable,
Set<String> refColumns)
ALTER TABLE schema.table ADD CONSTRAINT name
FOREIGN KEY (columns) REFERERENCES refTable (refColumns)
getCreateForeignKeySql in interface DbEnginecatalog - The name of the catalog (database) where the tables are
located, or null if it is located in the current catalogschema - The name of the schema where the tables are located, or
null if is located in the current schematable - The name of the foreign key tablename - The name of the foreign keycolumns - The columns that make up the foreign keyrefTable - The table that is referenced by the foreign keyrefColumns - The columns that are referenced by the foreign key
public String getDropForeignKeySql(String catalog,
String schema,
String table,
String name)
ALTER TABLE <schema>.<table> DROP CONSTRAINT <name>
getDropForeignKeySql in interface DbEnginecatalog - The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema - The name of the schema where the table is located, or
null if is located in the current schematable - The name of the tablename - The name of the foreign key
public String getCreatePrimaryKeySql(String catalog,
String schema,
String table,
String name,
Set<String> columns)
ALTER TABLE schema.table ADD CONSTRAINT name
PRIMARY KEY (columns).
getCreatePrimaryKeySql in interface DbEnginecatalog - The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema - The name of the schema where the table is located, or
null if is located in the current schematable - The name of the tablename - The name of the primary keycolumns - The name of the columns in the primary key
public String getDropPrimaryKey(String catalog,
String schema,
String table,
String name)
ALTER TABLE schema.table DROP CONSTRAINT name
getDropPrimaryKey in interface DbEnginecatalog - The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema - The name of the schema where the table is located, or
null if is located in the current schematable - The name of the tablename - The name of the primary key
public String getInsertAutoIncrementSql(PersistentClass pc)
DbEngine
getInsertAutoIncrementSql in interface DbEnginepc - The persistent class
public boolean analyzeAfterBatchOperation()
analyzeAfterBatchOperation in interface DbEngine
public String getOptimizeTableSql(String catalog,
String schema,
String table)
VACUUM FULL <schema>.<table>.
The catalog parameter is not supported.
getOptimizeTableSql in interface DbEnginecatalog - The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema - The name of the schema where the table is located, or
null if is located in the current schematable - The name of the table to optimize
DbEngine.getAnalyzeTableSql(String, String, String)
public String getAnalyzeTableSql(String catalog,
String schema,
String table)
ANALYZE <schema>.<table>.
The catalog parameter is not supported.
getAnalyzeTableSql in interface DbEnginecatalog - The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema - The name of the schema where the table is located, or
null if is located in the current schematable - The name of the table to analyze
DbEngine.getOptimizeTableSql(String, String, String)public boolean caseInsensitiveComparison()
caseInsensitiveComparison in interface DbEnginepublic boolean supportsColumnAliasInWhere()
supportsColumnAliasInWhere in interface DbEnginesupportsColumnAliasInWhere in class AbstractDbEnginepublic boolean supportColumnAliasInOrderBy()
supportColumnAliasInOrderBy in interface DbEnginesupportColumnAliasInOrderBy in class AbstractDbEnginepublic boolean supportColumnAliasInGroupBy()
supportColumnAliasInGroupBy in interface DbEnginesupportColumnAliasInGroupBy in class AbstractDbEnginepublic boolean supportColumnAliasInHaving()
supportColumnAliasInHaving in interface DbEnginesupportColumnAliasInHaving in class AbstractDbEnginepublic boolean checkForInvalidNumberOperation()
checkForInvalidNumberOperation in interface DbEnginecheckForInvalidNumberOperation in class AbstractDbEnginepublic boolean selectOrderByColumnsIfDistinct()
selectOrderByColumnsIfDistinct in interface DbEngineselectOrderByColumnsIfDistinct in class AbstractDbEngine
public String rlike(String value,
String regexp)
<value> ~ <regexp>.
rlike in interface DbEnginerlike in class AbstractDbEnginevalue - The left valueregexp - The regular expression as a string
public String inspectSchemaGenerationSQL(String sql,
Dialect dialect,
SchemaGenerator.Mode mode)
inspectSchemaGenerationSQL in interface DbEngineinspectSchemaGenerationSQL in class AbstractDbEnginesql - The original SQL statment as generated by Hibernatedialect - The Hibernate dialect currently in usemode - The installation mode
public boolean useSavePointToContinueTransactionFromSqlFailure()
DbEngine
useSavePointToContinueTransactionFromSqlFailure in interface DbEngineuseSavePointToContinueTransactionFromSqlFailure in class AbstractDbEngine
public String getApproximateRowCountSql(String catalog,
String schema,
String table)
DbEngine
getApproximateRowCountSql in interface DbEnginegetApproximateRowCountSql in class AbstractDbEnginecatalog - The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema - The name of the schema where the table is located, or
null if is located in the current schematable - The name of the table
private void appendList(StringBuilder sb,
Collection<String> items)
|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||