public interface PersistentStorage
Modifier and Type | Field and Description |
---|---|
static int |
INDEX_DIFFERENT
value if index is different
|
static int |
INDEX_NOT_PRESENT
value if indes is not present at all
|
static int |
INDEX_OK
value if index is OK in persistence layer
|
Modifier and Type | Method and Description |
---|---|
void |
closeConnections()
close all connections of the persistence layer
|
void |
commitTransaction()
in case of manual commit, finishes a transaction
|
void |
createField(StoredTableSchema object,
int fieldindex)
creates the n-th field of the specified object
|
void |
createObject(StoredTableSchema object)
creates a new table in the persistence layer
|
void |
createSearchIndex(java.lang.String name,
StoredTableSchema object,
StoredFieldSchema[] fields,
boolean unique) |
void |
createSequence(java.lang.String sequencename,
int firstvalue)
creates a unique sequence in the database
|
void |
DeleteOnDB(DeleteQuery dq)
deletes a single line in the database
|
boolean |
DoesFieldExist(StoredTableSchema object,
int fieldindex) |
int |
DoesIndexExist(StoredTableSchema object,
StoredFieldSchema[] fields,
java.lang.String name)
checks if the index exists and indexes the specified fields
|
boolean |
DoesObjectExist(StoredTableSchema object)
Introspection of the datamodel: checks if the table exists
|
void |
dropIndex(java.lang.String name)
drops the index as specified by name
|
int |
getNextValue(java.lang.String sequencename)
gets the next value from the sequence
|
void |
insertOnDB(StoredTableRow row)
Insert a single row in the persistent storage
|
boolean |
isSequenceExisting(java.lang.String sequencename)
Checks if a sequence already exists
|
void |
MassiveDeleteOnDB(MultipleTableRow rowstodelete)
deletes multiple rows in the persistent storage
|
void |
MassiveInsertOnDB(MultipleTableRow row)
Insert multiple rows in the persistent storage
|
void |
MassiveUpdateOnDB(MultipleTableRow row)
updates multiple rows in the persistent storage
|
void |
rollbackTransaction()
in case of manual commit, rollbacks a transaction
|
Row |
selectOnDB(SelectQuery sq)
selects data in the persistent storage
|
void |
setAutoCommit(boolean autocommit)
sets the persistence layer as either autocommit (each action is persisted) or
manual commit (several actions can be packaged in )
|
void |
startTransaction()
in case of manual commit, starts a transaction
|
void |
technicalInit()
This method will be played once at the launch of the server.
|
void |
UpdateOnDB(UpdateQuery uq)
updates a single line in the database
|
static final int INDEX_OK
static final int INDEX_DIFFERENT
static final int INDEX_NOT_PRESENT
void technicalInit()
Row selectOnDB(SelectQuery sq)
sq
- select queryvoid insertOnDB(StoredTableRow row)
row
- the row to insertvoid MassiveInsertOnDB(MultipleTableRow row)
row
- multiple rows to insertvoid MassiveUpdateOnDB(MultipleTableRow row)
row
- multiple rows to updatevoid MassiveDeleteOnDB(MultipleTableRow rowstodelete)
row
- multiple rows to updatevoid UpdateOnDB(UpdateQuery uq)
uq
- query to update a single rowvoid DeleteOnDB(DeleteQuery dq)
dq
- query to delete a single rowboolean DoesObjectExist(StoredTableSchema object)
object
- the table schema to checkboolean DoesFieldExist(StoredTableSchema object, int fieldindex)
object
- the table schema to checkfieldindex
- field to check (by index)void dropIndex(java.lang.String name)
name
- name of the indexint DoesIndexExist(StoredTableSchema object, StoredFieldSchema[] fields, java.lang.String name)
object
- object to create the index onfields
- ordered list of fieldsname
- name of the indexvoid createObject(StoredTableSchema object)
object
- definition (schema) of the stored tablevoid createField(StoredTableSchema object, int fieldindex)
object
- object definition (schema) of the stored tablefieldindex
- index of the field to createvoid createSearchIndex(java.lang.String name, StoredTableSchema object, StoredFieldSchema[] fields, boolean unique)
name
- object
- fields
- unique
- void setAutoCommit(boolean autocommit)
autocommit
- true for autocommit, false for manual commitvoid startTransaction()
void commitTransaction()
void rollbackTransaction()
boolean isSequenceExisting(java.lang.String sequencename)
sequencename
- name of the sequencevoid createSequence(java.lang.String sequencename, int firstvalue)
sequencename
- name of the sequencefirstvalue
- first integer value of the sequenceint getNextValue(java.lang.String sequencename)
sequencename
- name of the sequencevoid closeConnections()