public class Converter extends Mutation
package my.package;
// The old class. Version 0 is implied.
//
@Entity
class Person {
// ...
}
// The new class. A new version number must be assigned.
//
@Entity(version=1)
class Person {
// Incompatible changes were made here...
}
// Add a converter mutation.
//
Mutations mutations = new Mutations();
mutations.addConverter(new Converter(Person.class.getName(), 0,
new MyConversion()));
// Configure the mutations as described here
.
See Conversion
for more information.
Class Evolution
,
Serialized FormConstructor and Description |
---|
Converter(java.lang.String className,
int classVersion,
Conversion conversion)
Creates a mutation for converting all instances of the given class
version to the current version of the class.
|
Converter(java.lang.String declaringClassName,
int declaringClassVersion,
java.lang.String fieldName,
Conversion conversion)
Creates a mutation for converting all values of the given field in the
given class version to a type compatible with the current declared type
of the field.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Returns true if the conversion objects are equal in this object and
given object, and if the
Mutation.equals(java.lang.Object) superclass method
returns true. |
Conversion |
getConversion()
Returns the converter instance specified to the constructor.
|
int |
hashCode() |
java.lang.String |
toString() |
getClassName, getClassVersion, getFieldName
public Converter(java.lang.String className, int classVersion, Conversion conversion)
public Converter(java.lang.String declaringClassName, int declaringClassVersion, java.lang.String fieldName, Conversion conversion)
public Conversion getConversion()
public boolean equals(java.lang.Object other)
Mutation.equals(java.lang.Object)
superclass method
returns true.Copyright (c) 2004,2014 Oracle. All rights reserved.