org.spicefactory.pimento.io
Interface ApplicableEntitySnapshot

All Superinterfaces:
EntitySnapshot
All Known Implementing Classes:
AbstractApplicableEntitySnapshot, FullEntitySnapshot, PartialEntitySnapshot

public interface ApplicableEntitySnapshot
extends EntitySnapshot

Represents an entity snapshot that can be applied to existing entities and other snapshots. This snapshot may be a partial or full representation of an entity.

Author:
Jens Halm

Method Summary
 Object getEntity()
          Returns the entity that this snapshot was applied to.
 boolean hasEntity()
          Indicates whether the entity that this snapshot was applied to has been set.
 boolean isTransient()
          Checks whether the entity represented by this snapshot is transient.
 EntityUpdate prepareUpdate(Object entity, EntityMetadata metadata, IoContext context)
          Creates and returns an EntityUpdate instance that reflects the state of this instance.
 void setEntity(Object entity)
          Sets the entity that this snapshot was applied to.
 
Methods inherited from interface org.spicefactory.pimento.io.EntitySnapshot
getEntityId, getLogString, getMetadataId
 

Method Detail

isTransient

boolean isTransient()
Checks whether the entity represented by this snapshot is transient.

Returns:
true if the entity represented by this snapshot is transient

prepareUpdate

EntityUpdate prepareUpdate(Object entity,
                           EntityMetadata metadata,
                           IoContext context)
Creates and returns an EntityUpdate instance that reflects the state of this instance. The returned instance must contain persistent entity references for all association properties that this instance contains snapshots for.

Parameters:
entity - the entity the update will later be applied to
metadata - the metadata for the specified entity
context - the active IoContext
Returns:
a new EntityUpdate instance that can later be applied to the entity

setEntity

void setEntity(Object entity)
Sets the entity that this snapshot was applied to.

Parameters:
entity - the entity that this snapshot was applied to

getEntity

Object getEntity()
Returns the entity that this snapshot was applied to.

Returns:
the entity that this snapshot was applied to

hasEntity

boolean hasEntity()
Indicates whether the entity that this snapshot was applied to has been set.

Returns:
true if the entity that this snapshot was applied to has been set