|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ikokoon.serenity.persistence.DataBase
com.ikokoon.serenity.persistence.DataBaseRam
public final class DataBaseRam
This is the in memory database. Several options were explored including DB4O, Neodatis, JPA, SQL, and finally none were performant enough. As well as that several hybrids were investigated like including a l1 cache and a l2 cache, but the actual persistence in the case of JPA and SQL was just too slow. This class does everything in memory and commits the data finally to the under lying database once the processing is finished.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.ikokoon.serenity.persistence.IDataBase |
|---|
IDataBase.DataBaseManager |
| Method Summary | ||
|---|---|---|
void |
close()
Closes the database. |
|
|
find(java.lang.Class<E> klass)
Selects all the classes of a particular type. |
|
|
find(java.lang.Class<E> klass,
int start,
int end)
Selects all the classes of a particular type starting from an index and going to an index. |
|
|
find(java.lang.Class<E> klass,
java.util.List<java.lang.Object> parameters)
Selects a class based on the combination of field values in the parameter list. |
|
|
find(java.lang.Class<E> klass,
java.lang.Long id)
Selects a composite based on the class type and the id of the class. |
|
|
find(java.lang.Class<E> klass,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Selects a list of objects based on the values in the objects and the class of the object. |
|
boolean |
isClosed()
Checks the open status of the database. |
|
|
persist(E composite)
Persists an object to a persistent store. |
|
|
remove(java.lang.Class<E> klass,
java.lang.Long id)
Removes an object from the database and returns the removed object as a convenience. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public final <E extends Composite<?,?>> E persist(E composite)
composite - the composite to persist
public final <E extends Composite<?,?>> E find(java.lang.Class<E> klass,
java.lang.Long id)
E - the return type of the classklass - the type of class to selectid - the unique id of the class
public final <E extends Composite<?,?>> E find(java.lang.Class<E> klass,
java.util.List<java.lang.Object> parameters)
E - the return type of the classklass - the type of class to selectparameters - the unique combination of field values to select the class with
public final <E extends Composite<?,?>> java.util.List<E> find(java.lang.Class<E> klass)
E - the return type of the classklass - the type of class to select
public <E extends Composite<?,?>> java.util.List<E> find(java.lang.Class<E> klass,
int start,
int end)
E - the return type of the classklass - the type of class to selectstart - the beginning index to retrieve objects fromend - the end index for the list of objects
public final <E extends Composite<?,?>> E remove(java.lang.Class<E> klass,
java.lang.Long id)
E - the return type of the classklass - the type of class to selectid - the unique id of the class
public final boolean isClosed()
public final void close()
public <E extends Composite<?,?>> java.util.List<E> find(java.lang.Class<E> klass,
java.util.Map<java.lang.String,java.lang.Object> parameters)
IDataBase
E - the return type of the classklass - the type of class to selectparameters - the parameters to do the selection with. These are the fields in the objects and the values
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||