net.vz.mongodb.jackson
Enum JacksonDBCollection.Feature

java.lang.Object
  extended by java.lang.Enum<JacksonDBCollection.Feature>
      extended by net.vz.mongodb.jackson.JacksonDBCollection.Feature
All Implemented Interfaces:
Serializable, Comparable<JacksonDBCollection.Feature>
Enclosing class:
JacksonDBCollection<T,K>

public static enum JacksonDBCollection.Feature
extends Enum<JacksonDBCollection.Feature>


Enum Constant Summary
USE_STREAM_DESERIALIZATION
          Deserialise objects directly from the MongoDB stream.
USE_STREAM_SERIALIZATION
          Serialise objects directly to the MongoDB stream.
 
Method Summary
 boolean isEnabledByDefault()
           
static JacksonDBCollection.Feature valueOf(String name)
          Returns the enum constant of this type with the specified name.
static JacksonDBCollection.Feature[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

USE_STREAM_DESERIALIZATION

public static final JacksonDBCollection.Feature USE_STREAM_DESERIALIZATION
Deserialise objects directly from the MongoDB stream. This is the default, as it performs the best. If set to false, then it uses the MongoDB driver to deserialise objects to DBObjects, and then traverses those objects to do the Jackson parsing. This may be desirable, for example, when auto hydrating of objects is enabled, because in order to hydrate objects, a second connection needs to be made to MongoDB, which has the potential to deadlock when the connection pool gets exhausted when using stream deserialization. Using object deserialization, the hydration occurs after the connection to load the object has been returned to the pool.


USE_STREAM_SERIALIZATION

public static final JacksonDBCollection.Feature USE_STREAM_SERIALIZATION
Serialise objects directly to the MongoDB stream. While this performs better than serialising to MongoDB DBObjects first, it has the disadvantage of not being able to generate IDs before sending objects to the server, which means WriteResult.getSavedId() getSavedObject() will not work. Hence it is disabled by default.

Method Detail

values

public static JacksonDBCollection.Feature[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (JacksonDBCollection.Feature c : JacksonDBCollection.Feature.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static JacksonDBCollection.Feature valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

isEnabledByDefault

public boolean isEnabledByDefault()


Copyright © 2011-2012 VZ Netzwerke. All Rights Reserved.