|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openbandy.io.storage.Storage
org.openbandy.io.storage.DatabaseStorage
public class DatabaseStorage
The DatabaseStorage is an extension to the Storage.
Thereby, it particularly implements the logic for the methods
existsInStorage, deleteShallow and reset.
All these methods are realized using a temporary DatabaseConnection
to execute the necessary SQL statements.
(c) Copyright Philipp Bolliger 2007, ALL RIGHTS RESERVED.
Method Summary | |
---|---|
static java.lang.String |
apostrophe(java.lang.String value)
|
static java.lang.String |
bracket(java.lang.String value)
|
void |
closeConnection(DatabaseConnection connection)
|
boolean |
deleteShallow(Serializable serializable)
Deletes the serializable object, but not the reference objects. |
int |
existsInStorage(Serializable serializable)
Return 0 if databaseSerializable does not already
exist in database. |
DatabaseConnection |
getDatabaseConnection(java.lang.String owner)
|
static DatabaseStorage |
getInstance()
|
static java.lang.String |
getTableName(Serializable serializable)
|
static java.lang.String |
identifierApostroph(java.lang.String value)
|
boolean |
isEmpty()
Returns true if no object is contained within the storage. |
void |
reset()
Reset the storage with all it's meta structures and caches. |
Methods inherited from class org.openbandy.io.storage.Storage |
---|
closeAllConnections, delete, removeConnection, size |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DatabaseStorage getInstance()
public DatabaseConnection getDatabaseConnection(java.lang.String owner)
owner
- A string describing the user of the connection.
null
if not
able to connect.public int existsInStorage(Serializable serializable)
databaseSerializable
does not already
exist in database. If databaseSerializable
exist,
this method returns the id according to databaseSerializable.getKeyName()
.
existsInStorage
in class Storage
databaseSerializable
-
public void closeConnection(DatabaseConnection connection)
public boolean deleteShallow(Serializable serializable)
Storage
deleteShallow
in class Storage
public void reset()
Storage
reset
in class Storage
public boolean isEmpty()
Storage
isEmpty
in class Storage
public static java.lang.String identifierApostroph(java.lang.String value)
public static java.lang.String apostrophe(java.lang.String value)
public static java.lang.String bracket(java.lang.String value)
public static java.lang.String getTableName(Serializable serializable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |