Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB Java Edition version 3.0.12
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sleepycat.persist.evolve
Class Conversion

    java.lang.Object
      com.sleepycat.persist.evolve.Mutation
          com.sleepycat.persist.evolve.Conversion

All Implemented Interfaces:
  Serializable

    public class Conversion

extends Mutation

A mutation for converting an old version of an object value to conform to the current class definition. For example:

      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 conversion mutation.
      //
      Mutations mutations = new Mutations();

      mutations.addConversion(new Conversion(Person.class.getName(), 0,
                                             new MyConverter()));

      // Configure the mutations as described here.

See `Converter` for more information.

Author:
  Mark Hayes
See Also:
  Serialized Form

Constructor Summary
`Conversion(String className, int classVersion, Converter converter)` Creates a mutation for converting all instances of the given class version.
`Conversion(String declaringClassName, int declaringClassVersion, String fieldName, Converter converter)` Creates a mutation for converting all values of the given field in the given class version.

Method Summary
`Converter` | `getConverter()` Returns the converter instance 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

### Conversion

    public Conversion(String className,
                      int classVersion,
                      Converter converter)

  Creates a mutation for converting all instances of the given class version.

### Conversion

    public Conversion(String declaringClassName,
                      int declaringClassVersion,
                      String fieldName,
                      Converter converter)

  Creates a mutation for converting all values of the given field in the given class version.

Method Detail

### getConverter

    public Converter getConverter()

  Returns the converter instance specified in the constructor.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB Java Edition version 3.0.12
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 1996-2006 Sleepycat Software, Inc. - All rights reserved.