org.spicefactory.pimento.io
Class FetchMode

java.lang.Object
  extended by org.spicefactory.pimento.io.FetchMode
All Implemented Interfaces:
Externalizable

public class FetchMode
extends Object
implements Externalizable

Represents the fetch mode for a single property.

Author:
Jens Halm

Field Summary
static FetchMode EAGER
          Constant for propeties that should be eagerly fetched.
static FetchMode LAZY
          Constant for properties that should be lazily fetched.
 
Constructor Summary
FetchMode()
          Creates a new instance.
FetchMode(boolean lazy, FetchPlan fetchPlan)
          Creates a new instance.
 
Method Summary
 FetchPlan getFetchPlan()
          Returns the fetch plan for the associated entity if this property is an association type or null.
 boolean isLazy()
          Whether this property should be lazily fetched.
 void readExternal(DataInput input)
          Restores the content of this object from the DataInput instance.
 void writeExternal(DataOutput output)
          Saves the content of this object to the DataOutput instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EAGER

public static final FetchMode EAGER
Constant for propeties that should be eagerly fetched.


LAZY

public static final FetchMode LAZY
Constant for properties that should be lazily fetched.

Constructor Detail

FetchMode

public FetchMode()
Creates a new instance. The default constructor will only be used by the AMF decoder.


FetchMode

public FetchMode(boolean lazy,
                 FetchPlan fetchPlan)
Creates a new instance.

Parameters:
lazy - whether this property should be lazily fetched
fetchPlan - the optional fetch plan for the associated entity if this property is an association type
Method Detail

isLazy

public boolean isLazy()
Whether this property should be lazily fetched.

Returns:
true if this property should be lazily fetched

getFetchPlan

public FetchPlan getFetchPlan()
Returns the fetch plan for the associated entity if this property is an association type or null.

Returns:
the fetch plan for the associated entity or null

readExternal

public void readExternal(DataInput input)
Description copied from interface: Externalizable
Restores the content of this object from the DataInput instance. Values must be read in the same sequence as they were written on the client side.

Specified by:
readExternal in interface Externalizable
Parameters:
input - the AMF3 data to read from

writeExternal

public void writeExternal(DataOutput output)
Description copied from interface: Externalizable
Saves the content of this object to the DataOutput instance.

Specified by:
writeExternal in interface Externalizable
Parameters:
output - the output to write to