Z - the source typeX - the destination typeY - the attribute typepublic abstract class AssociationMapping<Z,X,Y> extends Mapping<Z,X,Y> implements JoinedMapping<Z,X,Y>
JoinedMapping.MappingType| Constructor and Description |
|---|
AssociationMapping(ParentMapping<?,Z> parent,
AssociationAttributeMetadata metadata,
AttributeImpl<? super Z,X> attribute) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cascadesDetach()
Returns if the type cascades detach operations.
|
boolean |
cascadesMerge()
Returns if the type cascades merge operations.
|
boolean |
cascadesPersist()
Returns if the type cascades persist operations.
|
boolean |
cascadesRefresh()
Returns if the type cascades refresh operations.
|
boolean |
cascadesRemove()
Returns if the type cascades remove operations.
|
abstract void |
checkTransient(ManagedInstance<?> managedInstance)
Checks that the association references not a transient instance
|
protected AssociationMetadata |
getAssociationMetadata()
Returns the effective association metadata for the attribute checking with the parent mappings and entities.
|
abstract ForeignKey |
getForeignKey()
Returns the foreign key of the mapping.
|
abstract AssociationMapping<?,?,?> |
getInverse()
Returns the inverse attribute.
|
String |
getMappedBy()
Returns the mappedBy of the mapping.
|
int |
getMaxFetchJoinDepth()
Returns the max allowed depth for the fetch join.
|
protected CriteriaQueryImpl<Y> |
getSelectCriteria()
Returns the select criteria.
|
abstract JoinTable |
getTable()
Returns the join table of the mapping.
|
abstract EntityTypeImpl<Y> |
getType()
Returns the bindable entity type.
|
boolean |
isEager()
Returns if the association should be eagerly fetched.
|
boolean |
isOwner()
Returns if the association is the owner side.
|
String |
join(String parentAlias,
String alias,
javax.persistence.criteria.JoinType joinType)
Returns the join SQL for the mapping.
|
abstract void |
link()
Links the attribute to its associate entity type and inverse attribute if bidirectional.
|
abstract void |
mergeWith(EntityManagerImpl entityManager,
ManagedInstance<?> instance,
Object entity,
org.apache.commons.lang.mutable.MutableBoolean requiresFlush,
IdentityHashMap<Object,Object> processed)
Merges the association of the instance with the entity.
|
abstract boolean |
references(Object instance,
Object reference) |
abstract void |
refresh(ManagedInstance<?> instance,
Set<Object> processed)
Refreshes the association
|
boolean |
removesOrphans()
Returns the if the mapping removes orphans.
|
abstract void |
setInverse(AssociationMapping<?,?,?> inverse)
Sets the inverse attribute.
|
equals, get, getAttribute, getJavaType, getName, getParent, getPath, getRoot, hashCode, set, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitextractKey, flush, getAttribute, getMappingType, getPath, initialize, isAssociation, isJoined, isMappublic AssociationMapping(ParentMapping<?,Z> parent, AssociationAttributeMetadata metadata, AttributeImpl<? super Z,X> attribute)
parent - the parent mappingmetadata - the metadataattribute - the attributepublic final boolean cascadesDetach()
public final boolean cascadesMerge()
public final boolean cascadesPersist()
public final boolean cascadesRefresh()
public final boolean cascadesRemove()
public abstract void checkTransient(ManagedInstance<?> managedInstance)
managedInstance - the managed instanceprotected AssociationMetadata getAssociationMetadata()
public abstract ForeignKey getForeignKey()
public abstract AssociationMapping<?,?,?> getInverse()
public String getMappedBy()
public int getMaxFetchJoinDepth()
protected CriteriaQueryImpl<Y> getSelectCriteria()
public abstract JoinTable getTable()
getTable in interface JoinedMapping<Z,X,Y>public abstract EntityTypeImpl<Y> getType()
getType in interface JoinedMapping<Z,X,Y>public final boolean isEager()
isEager in interface JoinedMapping<Z,X,Y>public final boolean isOwner()
public String join(String parentAlias, String alias, javax.persistence.criteria.JoinType joinType)
join in interface JoinedMapping<Z,X,Y>parentAlias - the parent table aliasalias - the primary table aliasjoinType - the join typepublic abstract void link()
throws MappingException
MappingException - thrown in case of a linkage errorpublic abstract void mergeWith(EntityManagerImpl entityManager, ManagedInstance<?> instance, Object entity, org.apache.commons.lang.mutable.MutableBoolean requiresFlush, IdentityHashMap<Object,Object> processed)
entityManager - the entity managerinstance - the instanceentity - the entityrequiresFlush - if an implicit flush is requiredprocessed - registry of processed entitiespublic abstract boolean references(Object instance, Object reference)
instance - the source instancereference - the associate instancepublic abstract void refresh(ManagedInstance<?> instance, Set<Object> processed)
instance - the instance that is the owner of the associationprocessed - the set of processed instancespublic boolean removesOrphans()
public abstract void setInverse(AssociationMapping<?,?,?> inverse)
inverse - the inverse associationCopyright © 2012 Batoo Software & Consultancy. All Rights Reserved.