|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.aspects.persistence.SQLStorage | +--org.objectweb.jac.aspects.persistence.PostgresStorage
Implements the storage to store within a PostgreSQL database.
Nested Class Summary |
Nested classes inherited from class org.objectweb.jac.aspects.persistence.SQLStorage |
SQLStorage.InvalidStorageException |
Field Summary |
Fields inherited from class org.objectweb.jac.aspects.persistence.SQLStorage |
db, id |
Constructor Summary | |
PostgresStorage(PersistenceAC ac,
String database,
String user,
String password)
Creates a new storage for a PostgreSQL database. |
Method Summary | |
protected void |
doUpdates()
|
protected boolean |
ensureSequenceExists(String sequence)
|
protected String[] |
getClassNames()
|
protected String |
getClassSeqName(String className)
|
long |
getCurrVal(String sequence)
|
Map |
getNameCounters()
Gets the name counters used to generate new names. |
long |
getNextVal(String sequence)
Returns the next value of a sequence |
protected boolean |
hasSequence(String name)
|
protected boolean |
hasTable(String name)
Tells wether a table with a given name exists |
String |
newName(String className)
Generate a new name for an instance. |
void |
updateNameCounters(Map counters)
Sets the name counters used to generate new names. |
Methods inherited from class org.objectweb.jac.aspects.persistence.SQLStorage |
addSlashes, addToList, addToList, addToSet, bindOIDToName, checkStorage, clearList, clearMap, clearSet, close, collectionContains, commit, createObject, deleteName, deleteObject, execute, executeQuery, executeSilent, executeUpdate, getClassID, getCollectionID, getCollectionValues, getField, getFields, getFromMap, getId, getIndexInList, getInt, getInternalIndexInList, getLastIndexInList, getList, getList, getListItem, getListSize, getLong, getMap, getMap, getMapSize, getNameFromOID, getObjects, getObjects, getOID, getOIDFromName, getRootObjects, getSet, getSet, getSetSize, listContains, mapContainsKey, mapContainsValue, putInMap, removeField, removeFromList, removeFromList, removeFromMap, removeFromSet, rollback, setConnection, setContains, setField, setId, setListItem, startTransaction, updateField, updateJacNames |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PostgresStorage(PersistenceAC ac, String database, String user, String password) throws SQLException, Exception
database
- the database. It may take on eof the following form:
user
- the user namepassword
- the password for this userMethod Detail |
protected String[] getClassNames() throws Exception
Exception
protected void doUpdates() throws Exception, SQLException
Exception
SQLException
public long getNextVal(String sequence) throws Exception
SQLStorage
getNextVal
in class SQLStorage
Exception
public long getCurrVal(String sequence) throws Exception
Exception
protected boolean ensureSequenceExists(String sequence) throws Exception
Exception
public String newName(String className) throws Exception
Storage
newName
in interface Storage
newName
in class SQLStorage
className
- the className of the instance for which to generate a name
Exception
public Map getNameCounters() throws Exception
Storage
getNameCounters
in interface Storage
getNameCounters
in class SQLStorage
Exception
Storage.updateNameCounters(Map)
protected String getClassSeqName(String className)
protected boolean hasTable(String name) throws SQLException
SQLStorage
hasTable
in class SQLStorage
SQLException
protected boolean hasSequence(String name) throws Exception
Exception
public void updateNameCounters(Map counters) throws Exception
Storage
updateNameCounters
in interface Storage
updateNameCounters
in class SQLStorage
counters
- a Map associating counter names to a Long
value. The value is the next value to be used. A counter is
updated only if the suplied value is greater than the current
value.
Exception
Storage.getNameCounters()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |