public interface Options
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
OPTION_BATCH_SIZE
This option may be used when you wish to set a non standard batch size for writing data or reading data from a MongoDB
resourceSet.getLoadOptions().put(Options.OPTION_BATCH_SIZE, 400);
Value type: Integer |
static java.lang.String |
OPTION_CLEAR_RESOURCE_AFTER_BATCH_INSERT
If set to true the resource containing the batch will be cleared after saving and will not be populated with proxies
resourceSet.getLoadOptions().put(Options.OPTION_CLEAR_RESOURCE_AFTER_BATCH_INSERT, Boolean.TRUE);
Value type: Boolean |
static java.lang.String |
OPTION_FORCE_INSERT
This option may be used when you wish to force an insert even if there is an ID set.
|
static java.lang.String |
OPTION_LAZY_RESULT_LOADING
When you load a resource with a query, only information that are necessary to build a proxy
will be loaded from the db.
|
static java.lang.String |
OPTION_PROXY_ATTRIBUTES
When you load an object with cross-document references, they will be proxies.
|
static java.lang.String |
OPTION_QUERY_CURSOR
If set to Boolean.TRUE, a query will return a EMongoCursor instead of a result
Value type: Boolean
|
static java.lang.String |
OPTION_READ_DETACHED
If set to true the resource wil be detached from the read
EObject
resourceSet.getLoadOptions().put(Options.OPTION_READ_DETACHED, Boolean.TRUE);
Value type: Boolean |
static java.lang.String |
OPTION_READ_PREFERENCE
This option may be used when you wish to read from a particular server in a MongoDB
replica set that has been tagged.
|
static java.lang.String |
OPTION_SERIALIZE_ALL_ECLASS_URIS
To avoid writing unnecessary URIs in the DB, mongo emf writes eClassUris only for the root class and for
EReferences, where the actual value does not equal but inherit from the stated reference type.
|
static java.lang.String |
OPTION_SERIALIZE_DEFAULT_ATTRIBUTE_VALUES
EMF's default serialization is designed to conserve space by not serializing attributes that
are set to their default value.
|
static java.lang.String |
OPTION_USE_EXTENDED_METADATA
This option may be used when you wish to customizer serialization and/or de-serialization, using an
alternative
EStructuralFeature name. |
static java.lang.String |
OPTION_USE_ID_ATTRIBUTE_AS_PRIMARY_KEY
If it is set to Boolean.TRUE and the ID was not specified in the URI, the value of the ID
attribute will be used as the MongoDB _id if it exists.
|
static java.lang.String |
OPTION_WRITE_CONCERN
If set, the value must be an instance of WriteConcern and will be passed to MongoDB when the
object is inserted into the database, or updated.
|
static java.lang.String |
OPTIONS_COLLECTION_PARTITION_EXTENSION
This option can be set to append the given value from the map to the default collection name.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isUseExtendedMetadata(java.util.Map<?,?> options)
|
static final java.lang.String OPTIONS_COLLECTION_PARTITION_EXTENSION
static final java.lang.String OPTION_LAZY_RESULT_LOADING
ECollections.
This only works with query without projection.
value type: Booleanstatic final java.lang.String OPTION_PROXY_ATTRIBUTES
static final java.lang.String OPTION_SERIALIZE_DEFAULT_ATTRIBUTE_VALUES
static final java.lang.String OPTION_SERIALIZE_ALL_ECLASS_URIS
static final java.lang.String OPTION_USE_ID_ATTRIBUTE_AS_PRIMARY_KEY
static final java.lang.String OPTION_WRITE_CONCERN
static final java.lang.String OPTION_QUERY_CURSOR
static final java.lang.String OPTION_READ_PREFERENCE
ReadPreference readPreference = ReadPreference.primaryPreferred(new BasicDbObject("datacenter", "Austin"));
resourceSet.getLoadOptions().put(Options.OPTION_READ_PREFERENCE, readPreference);
Value type: ReadPreferencestatic final java.lang.String OPTION_BATCH_SIZE
resourceSet.getLoadOptions().put(Options.OPTION_BATCH_SIZE, 400);
Value type: Integerstatic final java.lang.String OPTION_FORCE_INSERT
resourceSet.getLoadOptions().put(Options.OPTION_FORCE_INSERT, Boolean.TRUE);
Value type: Booleanstatic final java.lang.String OPTION_USE_EXTENDED_METADATA
EStructuralFeature name. This can be achieved by annotating the metamodel
using the ExtendedMetadate with detail entry "name"
resourceSet.getLoadOptions().put(Options.OPTION_USE_EXTENDED_METADATA, Boolean.TRUE);
Value type: Booleanstatic final java.lang.String OPTION_CLEAR_RESOURCE_AFTER_BATCH_INSERT
resourceSet.getLoadOptions().put(Options.OPTION_CLEAR_RESOURCE_AFTER_BATCH_INSERT, Boolean.TRUE);
Value type: Booleanstatic final java.lang.String OPTION_READ_DETACHED
EObject
resourceSet.getLoadOptions().put(Options.OPTION_READ_DETACHED, Boolean.TRUE);
Value type: BooleanBryan Hunt, Data In Motion Consulting