org.apache.jackrabbit.core.persistence.pool
Class PostgreSQLNameIndex
java.lang.Object
org.apache.jackrabbit.core.persistence.pool.DbNameIndex
org.apache.jackrabbit.core.persistence.pool.PostgreSQLNameIndex
- All Implemented Interfaces:
- StringIndex
public class PostgreSQLNameIndex
- extends DbNameIndex
Same as 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.
Method Summary |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
generatedKeySelectSQL
protected String generatedKeySelectSQL
PostgreSQLNameIndex
public PostgreSQLNameIndex(ConnectionHelper connectionHelper,
String schemaObjectPrefix)
throws SQLException
- Throws:
SQLException
init
protected void init(String schemaObjectPrefix)
throws SQLException
- Inits this index and prepares the statements.
- Overrides:
init
in class DbNameIndex
- Parameters:
con
- the jdbc connectionschemaObjectPrefix
- the prefix for table names
- Throws:
SQLException
- if the statements cannot be prepared.
insertString
protected int insertString(String string)
- Inserts a string into the database and returns the new index.
Instead of using the
Statement.RETURN_GENERATED_KEYS
feature, the newly inserted index is retrieved by a 2nd select statement.
- Overrides:
insertString
in class DbNameIndex
- Parameters:
string
- the string to insert
- Returns:
- the new index.
getGeneratedKey
protected int getGeneratedKey()
- Retrieves the last assigned key from the database.
- Returns:
- the index.
Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.