Z - the source typeX - the destination typeY - the attribute typepublic abstract class AssociationMappingImpl<Z,X,Y> extends AbstractMapping<Z,X,Y> implements JoinedMapping<Z,X,Y>, AssociationMapping<Z,X,Y>
| Constructor and Description |
|---|
AssociationMappingImpl(AbstractParentMapping<?,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
|
abstract void |
flush(Connection connection,
ManagedInstance<?> managedInstance,
boolean removals,
boolean force)
Flushes the associates.
|
protected AssociationMetadata |
getAssociationMetadata()
Returns the effective association metadata for the attribute checking with the parent mappings and entities.
|
FetchStrategyType |
getFetchStrategy()
Returns the Fetching strategy of the association
|
abstract AssociationMappingImpl<?,?,?> |
getInverse()
Returns the inverse attribute.
|
abstract JoinTable |
getJoinTable()
Returns the join table of the mapping.
|
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 EntityTypeImpl<Y> |
getType()
Returns the associate type of the mapping.
|
abstract void |
initialize(ManagedInstance<?> instance)
Initializes the mapping.
|
boolean |
isEager()
Returns if the association should be eagerly fetched.
|
boolean |
isOwner()
Returns if the association is the owner side.
|
protected boolean |
isOwnerSelect()
Returns if the selection is owned.
|
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,
LinkedList<ManagedInstance<?>> instances)
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(AssociationMappingImpl<?,?,?> inverse)
Sets the inverse attribute.
|
equals, get, getAttribute, getJavaMember, getJavaType, getLocator, getName, getParent, getPath, getRoot, hashCode, isCollection, set, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitextractKey, getAttribute, getMappingType, isAssociation, isJoined, isMapgetForeignKeyget, getJavaMember, getJavaType, getLocator, getName, getParent, getPath, getRoot, isCollection, setpublic AssociationMappingImpl(AbstractParentMapping<?,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 instancepublic abstract void flush(Connection connection, ManagedInstance<?> managedInstance, boolean removals, boolean force) throws SQLException
flush in interface JoinedMapping<Z,X,Y>connection - the connection to usemanagedInstance - the managed instanceremovals - true if the removals should be flushed and false for the additionsforce - true to force, effective only for insertions and for new entities.SQLException - thrown if there is an underlying SQL Exceptionprotected AssociationMetadata getAssociationMetadata()
public FetchStrategyType getFetchStrategy()
public abstract AssociationMappingImpl<?,?,?> getInverse()
public abstract JoinTable getJoinTable()
getJoinTable in interface JoinedMapping<Z,X,Y>getJoinTable in interface AssociationMapping<Z,X,Y>public String getMappedBy()
public int getMaxFetchJoinDepth()
protected CriteriaQueryImpl<Y> getSelectCriteria()
public abstract EntityTypeImpl<Y> getType()
getType in interface JoinedMapping<Z,X,Y>public abstract void initialize(ManagedInstance<?> instance)
initialize in interface JoinedMapping<Z,X,Y>instance - the instancepublic final boolean isEager()
isEager in interface JoinedMapping<Z,X,Y>public final boolean isOwner()
protected boolean isOwnerSelect()
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, LinkedList<ManagedInstance<?>> instances)
entityManager - the entity managerinstance - the instanceentity - the entityrequiresFlush - if an implicit flush is requiredprocessed - registry of processed entitiesinstances - the persisted instancespublic 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(AssociationMappingImpl<?,?,?> inverse)
inverse - the inverse associationCopyright © 2012-2013 Batoo. All Rights Reserved.