|
Berkeley DB Java Edition version 3.0.12 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.persist.evolve.Mutation
com.sleepycat.persist.evolve.Renamer
public class Renamer
A mutation for renaming a class or field without changing the instance or field value. For example:
package my.package;
// The old class. Version 0 is implied.
//
@Entity
class Person {
String name;
}
// The new class. A new version number must be assigned.
//
@Entity(version=1)
class Human {
String fullName;
}
// Add the mutations.
//
Mutations mutations = new Mutations();
mutations.addRenamer(new Renamer("my.package.Person", 0,
Human.class.getName()));
mutations.addRenamer(new Renamer("my.package.Person", 0,
"name", "fullName"));
// Configure the mutations as described here
.
Constructor Summary | |
---|---|
Renamer(String fromClass,
int fromVersion,
String toClass)
Creates a mutation for renaming the class of all instances of the given class version. |
|
Renamer(String declaringClass,
int declaringClassVersion,
String fromField,
String toField)
Creates a mutation for renaming the given field for all instances of the given class version. |
Method Summary | |
---|---|
String |
getNewName()
Returns the new class or field name specified in the constructor. |
Methods inherited from class com.sleepycat.persist.evolve.Mutation |
---|
getClassName, getClassVersion, getFieldName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Renamer(String fromClass, int fromVersion, String toClass)
public Renamer(String declaringClass, int declaringClassVersion, String fromField, String toField)
Method Detail |
---|
public String getNewName()
|
Berkeley DB Java Edition version 3.0.12 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |