public class MicroDB
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
MicroDB.Constructor<T extends DBObject> |
static class |
MicroDB.OperationType |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(ChangeListener listener) |
<T extends java.lang.Comparable<T>> |
addIndex(java.lang.String indexName,
MapFunction<T> mapFunction) |
void |
close() |
com.devsmart.microdb.MicroDB.Operation |
commit() |
void |
compact() |
<T extends DBObject> |
create(java.lang.Class<T> classType)
Constructs a new proxy instance of
classType |
com.devsmart.microdb.MicroDB.Operation |
delete(DBObject obj) |
protected void |
finalize() |
protected void |
finalizing(DBObject obj)
called when a dbobject is being finalized by the GC
|
void |
flush()
Saves all DBObjects that are marked dirty
|
com.devsmart.ubjson.UBValue |
get(java.lang.String key) |
<T extends DBObject> |
get(java.util.UUID id) |
<T extends DBObject> |
get(java.util.UUID id,
T shell)
fetch and load database object with primary key
id. |
<T extends DBObject> |
getAllOfType(java.lang.Class<T> classType) |
Driver |
getDriver() |
<T extends DBObject> |
insert(java.lang.Class<T> classType)
creates and inserts into the database a new object of type
classType. |
<T extends java.lang.Comparable<T>> |
queryIndex(java.lang.String indexName,
T min,
boolean minInclusive,
T max,
boolean maxInclusive) |
com.devsmart.microdb.MicroDB.Operation |
save(DBObject obj)
saves/updates
obj to the database. |
com.devsmart.microdb.MicroDB.Operation |
save(java.lang.String key,
com.devsmart.ubjson.UBValue data) |
void |
shutdown() |
void |
sync()
This method blocks until all queued write operation are completed.
|
void |
waitForCompletion(com.devsmart.microdb.MicroDB.Operation op) |
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic void shutdown()
public Driver getDriver()
protected void finalizing(DBObject obj)
obj - public void close()
throws java.io.IOException
java.io.IOExceptionpublic void flush()
public <T extends DBObject> T insert(java.lang.Class<T> classType)
classType.T - classType - public <T extends DBObject> T create(java.lang.Class<T> classType)
classTypeT - classType - public <T extends DBObject> T get(java.util.UUID id)
public <T extends DBObject> T get(java.util.UUID id, T shell)
id.T - id - shell - new object of typepublic com.devsmart.ubjson.UBValue get(java.lang.String key)
throws java.io.IOException
java.io.IOExceptionpublic com.devsmart.microdb.MicroDB.Operation save(DBObject obj)
obj to the database. This method is not normally necessary for users to call
because database objects will automatically be saved when the garbage collector collects them if
they are marked dirty.obj - the data to be savedpublic com.devsmart.microdb.MicroDB.Operation save(java.lang.String key,
com.devsmart.ubjson.UBValue data)
public com.devsmart.microdb.MicroDB.Operation delete(DBObject obj)
public com.devsmart.microdb.MicroDB.Operation commit()
public void waitForCompletion(com.devsmart.microdb.MicroDB.Operation op)
public void sync()
public void compact()
public <T extends java.lang.Comparable<T>> void addIndex(java.lang.String indexName,
MapFunction<T> mapFunction)
throws java.io.IOException
java.io.IOExceptionpublic void addChangeListener(ChangeListener listener)
public <T extends java.lang.Comparable<T>> Cursor queryIndex(java.lang.String indexName, T min, boolean minInclusive, T max, boolean maxInclusive) throws java.io.IOException
java.io.IOExceptionpublic <T extends DBObject> java.lang.Iterable<T> getAllOfType(java.lang.Class<T> classType) throws java.io.IOException
java.io.IOException