org.springframework.datastore.mapping.types
Class Association<T>

java.lang.Object
  extended by org.springframework.datastore.mapping.AbstractPersistentProperty
      extended by org.springframework.datastore.mapping.types.Association<T>
All Implemented Interfaces:
PersistentProperty
Direct Known Subclasses:
Embedded, ManyToMany, OneToMany, ToOne

public abstract class Association<T>
extends AbstractPersistentProperty

Models an association between one class and another

Since:
1.0

Field Summary
static List<javax.persistence.CascadeType> DEFAULT_CHILD_CASCADE
           
static List<javax.persistence.CascadeType> DEFAULT_OWNER_CASCADE
           
 
Fields inherited from class org.springframework.datastore.mapping.AbstractPersistentProperty
context, name, owner, type
 
Constructor Summary
Association(PersistentEntity owner, MappingContext context, PropertyDescriptor descriptor)
           
Association(PersistentEntity owner, MappingContext context, String name, Class type)
           
 
Method Summary
 boolean doesCascade(javax.persistence.CascadeType cascadeOperation)
          Returns true if the this association cascade for the given cascade operation
 PersistentEntity getAssociatedEntity()
           
protected  List<javax.persistence.CascadeType> getCascadeOperations()
           
 javax.persistence.FetchType getFetchStrategy()
           
 Association getInverseSide()
           
 String getReferencedPropertyName()
           
 boolean isBidirectional()
           
 boolean isList()
           
 boolean isOwningSide()
          Returns whether this side owns the relationship.
 void setAssociatedEntity(PersistentEntity associatedEntity)
           
 void setFetchStrategy(javax.persistence.FetchType fetchStrategy)
           
 void setOwningSide(boolean owningSide)
           
 void setReferencedPropertyName(String referencedPropertyName)
           
 String toString()
           
 
Methods inherited from class org.springframework.datastore.mapping.AbstractPersistentProperty
getCapitilizedName, getName, getOwner, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.datastore.mapping.PersistentProperty
getMapping
 

Field Detail

DEFAULT_OWNER_CASCADE

public static final List<javax.persistence.CascadeType> DEFAULT_OWNER_CASCADE

DEFAULT_CHILD_CASCADE

public static final List<javax.persistence.CascadeType> DEFAULT_CHILD_CASCADE
Constructor Detail

Association

public Association(PersistentEntity owner,
                   MappingContext context,
                   PropertyDescriptor descriptor)

Association

public Association(PersistentEntity owner,
                   MappingContext context,
                   String name,
                   Class type)
Method Detail

getFetchStrategy

public javax.persistence.FetchType getFetchStrategy()

setFetchStrategy

public void setFetchStrategy(javax.persistence.FetchType fetchStrategy)

isBidirectional

public boolean isBidirectional()

getInverseSide

public Association getInverseSide()

doesCascade

public boolean doesCascade(javax.persistence.CascadeType cascadeOperation)
Returns true if the this association cascade for the given cascade operation

Parameters:
cascadeOperation - The cascadeOperation
Returns:
True if it does

getCascadeOperations

protected List<javax.persistence.CascadeType> getCascadeOperations()

isOwningSide

public boolean isOwningSide()
Returns whether this side owns the relationship. This controls the default cascading behavior if none is specified

Returns:
True if this property is the owning side

setOwningSide

public void setOwningSide(boolean owningSide)

setAssociatedEntity

public void setAssociatedEntity(PersistentEntity associatedEntity)

getAssociatedEntity

public PersistentEntity getAssociatedEntity()

setReferencedPropertyName

public void setReferencedPropertyName(String referencedPropertyName)

getReferencedPropertyName

public String getReferencedPropertyName()

toString

public String toString()
Overrides:
toString in class AbstractPersistentProperty

isList

public boolean isList()