public enum SessionMode extends Enum<SessionMode>
Session modes.
The three SessionMode values correspond to the three layers of abstraction in JSimpleDB.
In order from bottom to top these are:
KVDatabase
and KVTransaction and represented by KEY_VALUEDatabase
and Transaction and represented by CORE_APIJSimpleDB
and JTransaction and represented by JSIMPLEDB| Enum Constant and Description |
|---|
CORE_API
Core API mode.
|
JSIMPLEDB
JSimpleDB (or "Java") mode.
|
KEY_VALUE
Key/value database mode.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasCoreAPI()
Determine whether the core API (e.g.,
Transaction) is available in this mode. |
boolean |
hasJSimpleDB()
Determine whether the JSimpleDB (or "Java") API (e.g.,
JTransaction) is available in this mode. |
static SessionMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SessionMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SessionMode KEY_VALUE
This is the lowest level CLI mode, where only the raw byte[] key/value store is available.
This mode provides a KVTransaction, but no Transaction
or JTransaction.
org.jsimpledb.kvpublic static final SessionMode CORE_API
Supports access to low level schema information, core API "objects" and fields, but no Java-specific operations.
This mode provides a KVTransaction and Transaction,
but no JTransaction.
Schema information may be provided either by a schema XML file or by
@JSimpleClass-annotated Java model classes; however, in the latter
case these classes will be otherwise ignored.
In this mode, database objects are represented by ObjId's and enum values by
EnumValue's.
public static final SessionMode JSIMPLEDB
Provides
i.e., when the there are no @JSimpleClass-annotated Java model
classes defined and the core Database API is used.
In this mode, database objects are represented by Java model class instances and enum values by corresponding
Java model Enum class instances.
public static SessionMode[] values()
for (SessionMode c : SessionMode.values()) System.out.println(c);
public static SessionMode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic boolean hasJSimpleDB()
JTransaction) is available in this mode.public boolean hasCoreAPI()
Transaction) is available in this mode.Copyright © 2017. All rights reserved.