com.amazon.carbonado.synthetic
Class SyntheticStorableReferenceAccess<S extends Storable>

java.lang.Object
  extended by com.amazon.carbonado.synthetic.SyntheticStorableReferenceAccess<S>

public class SyntheticStorableReferenceAccess<S extends Storable>
extends Object

Provides access to the generated storable reference class and utility methods.

Since:
1.2.1
Author:
Brian S O'Neill
See Also:
SyntheticStorableReferenceBuilder

Method Summary
 void copyFromMaster(Storable reference, S master)
          Sets all the properties of the given reference, using the applicable properties of the given master.
 void copyToMasterPrimaryKey(Storable reference, S master)
          Sets all the primary key properties of the given master, using the applicable properties of the given reference.
 Comparator<? extends Storable> getComparator()
          Returns a comparator for ordering storable reference instances.
 Class<S> getMasterClass()
          Returns the storable class which is referenced.
 Class<? extends Storable> getReferenceClass()
          Returns the generated storable reference class.
 boolean isConsistent(Storable reference, S master)
          Returns true if the properties of the given reference match those contained in the master, excluding any version property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMasterClass

public Class<S> getMasterClass()
Returns the storable class which is referenced.


getReferenceClass

public Class<? extends Storable> getReferenceClass()
Returns the generated storable reference class.


getComparator

public Comparator<? extends Storable> getComparator()
Returns a comparator for ordering storable reference instances. This order matches the primary key of the master storable.


copyToMasterPrimaryKey

public void copyToMasterPrimaryKey(Storable reference,
                                   S master)
                            throws FetchException
Sets all the primary key properties of the given master, using the applicable properties of the given reference.

Parameters:
reference - source of property values
master - master whose primary key properties will be set
Throws:
FetchException

copyFromMaster

public void copyFromMaster(Storable reference,
                           S master)
                    throws FetchException
Sets all the properties of the given reference, using the applicable properties of the given master.

Parameters:
reference - reference whose properties will be set
master - source of property values
Throws:
FetchException

isConsistent

public boolean isConsistent(Storable reference,
                            S master)
                     throws FetchException
Returns true if the properties of the given reference match those contained in the master, excluding any version property. This will always return true after a call to copyFromMaster.

Parameters:
reference - reference whose properties will be tested
master - source of property values
Throws:
FetchException


Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.