public class SyntheticStorableReferenceBuilder<S extends Storable> extends java.lang.Object implements SyntheticBuilder
All primary key properties of the master storable will also be provided by the derived storable. Three special methods will be provided:
SyntheticBuilder.ClassNameProvider
Constructor and Description |
---|
SyntheticStorableReferenceBuilder(java.lang.Class<S> storableClass,
boolean isUnique) |
SyntheticStorableReferenceBuilder(java.lang.Class<S> storableClass,
java.lang.String baseName,
boolean isUnique) |
Modifier and Type | Method and Description |
---|---|
SyntheticKey |
addAlternateKey()
Add an alternate key to be built.
|
SyntheticIndex |
addIndex()
Add an index to the set managed by this builder.
|
SyntheticProperty |
addKeyProperty(java.lang.String name,
Direction direction)
Add a property to the primary key which is a member of the Storable type
being referenced by this one.
|
SyntheticKey |
addPrimaryKey()
Add a primary key to be built.
|
SyntheticProperty |
addProperty(java.lang.String name,
java.lang.Class type)
Add a property to the set managed by this builder.
|
SyntheticProperty |
addProperty(SyntheticProperty prop)
Add an externally defined synthetic property to the list
|
java.lang.Class<? extends Storable> |
build()
Convenience method to generate the class.
|
void |
copyFromMaster(Storable indexEntry,
S master)
Deprecated.
call getReferenceAccess
|
void |
copyToMasterPrimaryKey(Storable indexEntry,
S master)
Deprecated.
call getReferenceAccess
|
java.util.Comparator<? extends Storable> |
getComparator()
Deprecated.
call getReferenceAccess
|
java.lang.Object |
getName() |
SyntheticStorableReferenceAccess<S> |
getReferenceAccess()
Build and return access to the generated storable reference class.
|
java.lang.Class<? extends Storable> |
getStorableClass() |
java.util.List<SyntheticProperty> |
getUserProps() |
boolean |
hasProperty(java.lang.String name)
Check to see if a particular property has already been added to the list of
properties to generate
|
boolean |
isConsistent(Storable indexEntry,
S master)
Deprecated.
call getReferenceAccess
|
boolean |
isUnique()
True if the generated derived class should be considered unique.
|
boolean |
isVersioned()
Returns true if a property with the version attribute has been addded
|
ClassFileBuilder |
prepare() |
public SyntheticStorableReferenceBuilder(java.lang.Class<S> storableClass, boolean isUnique)
storableClass
- class of the storable that will be referenced by this
synthetic. The name for the synthetic storable will be based
on this class's name, decorated with the properties which
participate in the primary key for the synthetic storable.public SyntheticStorableReferenceBuilder(java.lang.Class<S> storableClass, java.lang.String baseName, boolean isUnique)
storableClass
- class of the storable that will be referenced by this
syntheticbaseName
- of the generated synthetic. Note that for some repositories
this name will be visible across the entire repository, so it
is good practice to include namespace information to guarantee
uniqueness.isUnique
- true if the properties that are explicitly identified as primary
key properites are sufficient to uniquely identify the index object.public ClassFileBuilder prepare() throws SupportException
prepare
in interface SyntheticBuilder
ClassFileBuilder
ready for further decoration or buildingSupportException
public SyntheticStorableReferenceAccess<S> getReferenceAccess()
public java.lang.Class<? extends Storable> getStorableClass() throws java.lang.IllegalStateException
getStorableClass
in interface SyntheticBuilder
SyntheticBuilder.prepare()
already have been called
prior to calling this method.java.lang.IllegalStateException
- if build has not yet been called.public java.lang.Class<? extends Storable> build() throws SupportException
SyntheticBuilder
SyntheticBuilder.prepare()
and return the result of
generating the class from that classfile. If the caller does not
wish to regenerate the class from scratch, use SyntheticBuilder.getStorableClass()
instead.build
in interface SyntheticBuilder
SupportException
public SyntheticProperty addKeyProperty(java.lang.String name, Direction direction)
name
- public SyntheticProperty addProperty(java.lang.String name, java.lang.Class type)
SyntheticBuilder
addProperty
in interface SyntheticBuilder
name
- of the propertytype
- of the propertySyntheticStorableBuilder.addProperty(java.lang.String,
java.lang.Class)
public SyntheticProperty addProperty(SyntheticProperty prop)
SyntheticBuilder
addProperty
in interface SyntheticBuilder
prop
- to addSyntheticStorableBuilder.addProperty(com.amazon.carbonado.synthetic.SyntheticProperty)
public boolean hasProperty(java.lang.String name)
SyntheticBuilder
hasProperty
in interface SyntheticBuilder
public java.util.List<SyntheticProperty> getUserProps()
public SyntheticKey addPrimaryKey()
SyntheticBuilder
addPrimaryKey
in interface SyntheticBuilder
public SyntheticKey addAlternateKey()
SyntheticBuilder
addAlternateKey
in interface SyntheticBuilder
public SyntheticIndex addIndex()
SyntheticBuilder
addIndex
in interface SyntheticBuilder
public java.lang.Object getName()
public boolean isUnique()
public boolean isVersioned()
SyntheticBuilder
isVersioned
in interface SyntheticBuilder
@Deprecated public void copyToMasterPrimaryKey(Storable indexEntry, S master) throws FetchException
indexEntry
- source of property valuesmaster
- master whose primary key properties will be setFetchException
@Deprecated public void copyFromMaster(Storable indexEntry, S master) throws FetchException
indexEntry
- index entry whose properties will be setmaster
- source of property valuesFetchException
@Deprecated public boolean isConsistent(Storable indexEntry, S master) throws FetchException
indexEntry
- index entry whose properties will be testedmaster
- source of property valuesFetchException
@Deprecated public java.util.Comparator<? extends Storable> getComparator()
Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.