|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.persistence.bundle.util.DbNameIndex
public class DbNameIndex
Implements a StringIndex that stores and retrieves the names from a
table in a database.
| Field Summary | |
|---|---|
protected ConnectionRecoveryManager |
connectionManager
The class that manages statement execution and recovery from connection loss. |
protected java.lang.String |
indexSelectSQL
|
protected java.lang.String |
nameInsertSQL
|
protected java.lang.String |
nameSelectSQL
|
| Constructor Summary | |
|---|---|
DbNameIndex(ConnectionRecoveryManager conMgr,
java.lang.String schemaObjectPrefix)
Creates a new index that is stored in a db. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this index and releases it's resources. |
protected int |
getIndex(java.lang.String string)
Retrieves the index from the database for the given string. |
protected java.lang.String |
getString(int index)
Retrieves the string from the database for the given index. |
java.lang.String |
indexToString(int idx)
Returns the string for a given index. |
protected void |
init(java.lang.String schemaObjectPrefix)
Inits this index and prepares the statements. |
protected int |
insertString(java.lang.String string)
Inserts a string into the database and returns the new index. |
int |
stringToIndex(java.lang.String string)
Returns the index for a given string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ConnectionRecoveryManager connectionManager
protected java.lang.String nameSelectSQL
protected java.lang.String indexSelectSQL
protected java.lang.String nameInsertSQL
| Constructor Detail |
|---|
public DbNameIndex(ConnectionRecoveryManager conMgr,
java.lang.String schemaObjectPrefix)
throws java.sql.SQLException
con - the jdbc connectionschemaObjectPrefix - the prefix for table names
java.sql.SQLException - if the statements cannot be prepared.| Method Detail |
|---|
protected void init(java.lang.String schemaObjectPrefix)
throws java.sql.SQLException
con - the jdbc connectionschemaObjectPrefix - the prefix for table names
java.sql.SQLException - if the statements cannot be prepared.public void close()
public int stringToIndex(java.lang.String string)
stringToIndex in interface StringIndexstring - the indexed (or to be indexed) string
public java.lang.String indexToString(int idx)
throws java.lang.IllegalArgumentException
indexToString in interface StringIndexidx - index of a string
java.lang.IllegalArgumentException - if the indexed string does not existprotected int insertString(java.lang.String string)
string - the string to insert
protected int getIndex(java.lang.String string)
string - the string to retrieve the index for
protected java.lang.String getString(int index)
throws java.lang.IllegalArgumentException,
java.lang.IllegalStateException
index - the index to retrieve the string for.
java.lang.IllegalArgumentException - if the string is not found
java.lang.IllegalStateException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||