Package com.sleepycat.persist.evolve
Class Mutations
java.lang.Object
com.sleepycat.persist.evolve.Mutations
- All Implemented Interfaces:
Serializable
A collection of mutations for configuring class evolution.
Mutations are configured when a store is opened via StoreConfig.setMutations. For example:
Mutations mutations = new Mutations(); // Add mutations... StoreConfig config = new StoreConfig(); config.setMutations(mutations); EntityStore store = new EntityStore(env, "myStore", config);
Mutations cause data conversion to occur lazily as instances are read
from the store. The EntityStore.evolve method
may also be used to perform eager conversion.
Not all incompatible class changes can be handled via mutations. For example, complex refactoring may require a transformation that manipulates multiple entity instances at once. Such changes are not possible with mutations but can made by performing a store conversion.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConverter(Converter converter) Adds a converter mutation.voidaddDeleter(Deleter deleter) Adds a deleter mutation.voidaddRenamer(Renamer renamer) Adds a renamer mutation.booleanReturns true if this collection has the same set of mutations as the given collection and all mutations are equal.getConverter(String className, int classVersion, String fieldName) Returns the converter mutation for the given class, version and field, or null if none exists.Returns an unmodifiable collection of all converter mutations.getDeleter(String className, int classVersion, String fieldName) Returns the deleter mutation for the given class, version and field, or null if none exists.Returns an unmodifiable collection of all deleter mutations.getRenamer(String className, int classVersion, String fieldName) Returns the renamer mutation for the given class, version and field, or null if none exists.Returns an unmodifiable collection of all renamer mutations.inthashCode()booleanisEmpty()Returns true if no mutations are present.toString()
-
Constructor Details
-
Mutations
public Mutations()Creates an empty set of mutations.
-
-
Method Details
-
isEmpty
public boolean isEmpty()Returns true if no mutations are present. -
addRenamer
Adds a renamer mutation. -
getRenamer
Returns the renamer mutation for the given class, version and field, or null if none exists. A null field name should be specified to get a class renamer. -
getRenamers
Returns an unmodifiable collection of all renamer mutations. -
addDeleter
Adds a deleter mutation. -
getDeleter
Returns the deleter mutation for the given class, version and field, or null if none exists. A null field name should be specified to get a class deleter. -
getDeleters
Returns an unmodifiable collection of all deleter mutations. -
addConverter
Adds a converter mutation. -
getConverter
Returns the converter mutation for the given class, version and field, or null if none exists. A null field name should be specified to get a class converter. -
getConverters
Returns an unmodifiable collection of all converter mutations. -
equals
Returns true if this collection has the same set of mutations as the given collection and all mutations are equal. -
hashCode
public int hashCode() -
toString
-