org.spicefactory.pimento.io
Class EmbeddableHandler

java.lang.Object
  extended by org.spicefactory.pimento.io.TypeHandler<TypeSnapshot,Embeddable>
      extended by org.spicefactory.pimento.io.EmbeddableHandler

public class EmbeddableHandler
extends TypeHandler<TypeSnapshot,Embeddable>

Responsible for managing a particular embeddable type.

Author:
Jens Halm

Constructor Summary
EmbeddableHandler(Object instance, Embeddable embeddable)
          Creates a new instance.
EmbeddableHandler(Object instance, Embeddable embeddable, TypeSnapshot snapshot, EntityState state)
          Creates a new instance.
 
Method Summary
 void applyUpdates(PropertyChangeSet changeSet)
          Applies the specified change set to the entity managed by this instance.
 PropertyChangeSet prepareChangeSet(SnapshotDecoder decoder)
          Prepares a change set that may later be applied to the snapshot and entity.
 
Methods inherited from class org.spicefactory.pimento.io.TypeHandler
assertUpdatePermitted, getInstance, getSnapshot, getState, getType, getValueForSnapshot, populateSnapshot, populateSnapshot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddableHandler

public EmbeddableHandler(Object instance,
                         Embeddable embeddable)
Creates a new instance.

Parameters:
instance - the embeddable instance
embeddable - the metamodel of the embeddable

EmbeddableHandler

public EmbeddableHandler(Object instance,
                         Embeddable embeddable,
                         TypeSnapshot snapshot,
                         EntityState state)
Creates a new instance.

Parameters:
instance - the embeddable instance
embeddable - the metamodel of the embeddable
snapshot - the snapshot representation of the embeddable
state - the state of the owning entity of this embeddable
Method Detail

prepareChangeSet

public PropertyChangeSet prepareChangeSet(SnapshotDecoder decoder)
Description copied from class: TypeHandler
Prepares a change set that may later be applied to the snapshot and entity.

Overrides:
prepareChangeSet in class TypeHandler<TypeSnapshot,Embeddable>
Parameters:
decoder - the decoder to use for decoding associations
Returns:
a change set that may later be applied to the entity

applyUpdates

public void applyUpdates(PropertyChangeSet changeSet)
Description copied from class: TypeHandler
Applies the specified change set to the entity managed by this instance.

Overrides:
applyUpdates in class TypeHandler<TypeSnapshot,Embeddable>
Parameters:
changeSet - the change set to apply