public class PostgreSQLNameIndex extends DbNameIndex
DbNameIndex but does not make use of the
Statement.RETURN_GENERATED_KEYS feature as it is not
provided by the underlying database driver for PostgreSQL.| Modifier and Type | Field and Description |
|---|---|
protected String |
generatedKeySelectSQL |
conHelper, indexSelectSQL, nameInsertSQL, nameSelectSQL| Constructor and Description |
|---|
PostgreSQLNameIndex(ConnectionHelper connectionHelper,
String schemaObjectPrefix) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
getGeneratedKey()
Retrieves the last assigned key from the database.
|
protected void |
init(String schemaObjectPrefix)
Inits this index and prepares the statements.
|
protected int |
insertString(String string)
Inserts a string into the database and returns the new index.
|
close, getIndex, getString, indexToString, stringToIndexprotected String generatedKeySelectSQL
public PostgreSQLNameIndex(ConnectionHelper connectionHelper, String schemaObjectPrefix) throws SQLException
SQLExceptionprotected void init(String schemaObjectPrefix) throws SQLException
init in class DbNameIndexschemaObjectPrefix - the prefix for table namesSQLException - if the statements cannot be prepared.protected int insertString(String string)
Instead of using the Statement.RETURN_GENERATED_KEYS
feature, the newly inserted index is retrieved by a 2nd select statement.
insertString in class DbNameIndexstring - the string to insertprotected int getGeneratedKey()
Copyright © 2004–2020 The Apache Software Foundation. All rights reserved.