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 asDbNameIndexbut does not make use of theStatement.RETURN_GENERATED_KEYSfeature as it is not provided by the underlying database driver for PostgreSQL.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringgeneratedKeySelectSQL-
Fields inherited from class org.apache.jackrabbit.core.persistence.pool.DbNameIndex
conHelper, indexSelectSQL, nameInsertSQL, nameSelectSQL
-
-
Constructor Summary
Constructors Constructor Description PostgreSQLNameIndex(ConnectionHelper connectionHelper, String schemaObjectPrefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetGeneratedKey()Retrieves the last assigned key from the database.protected voidinit(String schemaObjectPrefix)Inits this index and prepares the statements.protected intinsertString(String string)Inserts a string into the database and returns the new index.-
Methods inherited from class org.apache.jackrabbit.core.persistence.pool.DbNameIndex
close, getIndex, getString, indexToString, stringToIndex
-
-
-
-
Field Detail
-
generatedKeySelectSQL
protected String generatedKeySelectSQL
-
-
Constructor Detail
-
PostgreSQLNameIndex
public PostgreSQLNameIndex(ConnectionHelper connectionHelper, String schemaObjectPrefix) throws SQLException
- Throws:
SQLException
-
-
Method Detail
-
init
protected void init(String schemaObjectPrefix) throws SQLException
Inits this index and prepares the statements.- Overrides:
initin classDbNameIndex- Parameters:
schemaObjectPrefix- 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_KEYSfeature, the newly inserted index is retrieved by a 2nd select statement.- Overrides:
insertStringin classDbNameIndex- 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.
-
-