Z - the source typeX - the destination typepublic class SingularAssociationMappingImpl<Z,X> extends AssociationMappingImpl<Z,X,X> implements SingularAssociationMapping<Z,X>, SingularMappingEx<Z,X>
| Constructor and Description |
|---|
SingularAssociationMappingImpl(AbstractParentMapping<?,Z> parent,
AssociatedSingularAttribute<? super Z,X> attribute) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkTransient(ManagedInstance<?> managedInstance)
Checks that the association references not a transient instance
|
Object |
extractKey(Object value)
Extracts key from the value.
|
boolean |
fillValue(EntityTypeImpl<?> type,
ManagedInstance<?> managedInstance,
Object instance)
Fills the sequence / table generated value.
|
void |
flush(Connection connection,
ManagedInstance<?> managedInstance,
boolean removals,
boolean force)
Flushes the associates.
|
AssociatedSingularAttribute<? super Z,X> |
getAttribute()
Returns the attribute of the mapping.
|
ForeignKey |
getForeignKey() |
IdType |
getIdType() |
AssociationMappingImpl<?,?,?> |
getInverse()
Returns the inverse attribute.
|
JoinTable |
getJoinTable()
Returns the join table of the mapping.
|
MappingType |
getMappingType()
Returns the type of the mapping.
|
String |
getMapsId() |
EntityTypeImpl<X> |
getType()
Returns the associate type of the mapping.
|
void |
initialize(ManagedInstance<?> managedInstance)
Initializes the mapping.
|
boolean |
isAssociation()
Returns if the mapping is an association.
|
boolean |
isId() |
boolean |
isJoined()
Returns if the mapping is a joined mapping.
|
boolean |
isMap()
Returns if the mapping is a map collection.
|
void |
link()
Links the attribute to its associate entity type and inverse attribute if bidirectional.
|
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.
|
boolean |
references(Object instance,
Object reference) |
void |
refresh(ManagedInstance<?> instance,
Set<Object> processed)
Refreshes the association
|
void |
setInverse(AssociationMappingImpl<?,?,?> inverse)
Sets the inverse attribute.
|
cascadesDetach, cascadesMerge, cascadesPersist, cascadesRefresh, cascadesRemove, getAssociationMetadata, getFetchStrategy, getMappedBy, getMaxFetchJoinDepth, getSelectCriteria, isEager, isOwner, isOwnerSelect, join, removesOrphansequals, get, getJavaMember, getJavaType, getLocator, getName, getParent, getPath, getRoot, hashCode, isCollection, set, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitget, getJavaMember, getJavaType, getLocator, getName, getParent, getPath, getRoot, isCollection, setpublic SingularAssociationMappingImpl(AbstractParentMapping<?,Z> parent, AssociatedSingularAttribute<? super Z,X> attribute)
parent - the parent mappingattribute - the attributepublic void checkTransient(ManagedInstance<?> managedInstance)
checkTransient in class AssociationMappingImpl<Z,X,X>managedInstance - the managed instancepublic Object extractKey(Object value)
extractKey in interface JoinedMapping<Z,X,X>value - the valuepublic boolean fillValue(EntityTypeImpl<?> type, ManagedInstance<?> managedInstance, Object instance)
The operation returns false if at least one entity needs to obtain identity from the database.
fillValue in interface SingularMappingEx<Z,X>type - the entity typemanagedInstance - the managed instanceinstance - the instance to fill ids.public void flush(Connection connection, ManagedInstance<?> managedInstance, boolean removals, boolean force) throws SQLException
flush in interface JoinedMapping<Z,X,X>flush in class AssociationMappingImpl<Z,X,X>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 Exceptionpublic AssociatedSingularAttribute<? super Z,X> getAttribute()
getAttribute in interface JoinedMapping<Z,X,X>getAttribute in interface SingularMappingEx<Z,X>getAttribute in class AbstractMapping<Z,X,X>public ForeignKey getForeignKey()
getForeignKey in interface AssociationMapping<Z,X,X>public IdType getIdType()
getIdType in interface SingularMapping<Z,X>public AssociationMappingImpl<?,?,?> getInverse()
getInverse in class AssociationMappingImpl<Z,X,X>public JoinTable getJoinTable()
getJoinTable in interface JoinedMapping<Z,X,X>getJoinTable in interface AssociationMapping<Z,X,X>getJoinTable in class AssociationMappingImpl<Z,X,X>public MappingType getMappingType()
getMappingType in interface JoinedMapping<Z,X,X>public String getMapsId()
getMapsId in interface SingularAssociationMapping<Z,X>public EntityTypeImpl<X> getType()
getType in interface JoinedMapping<Z,X,X>getType in class AssociationMappingImpl<Z,X,X>public void initialize(ManagedInstance<?> managedInstance)
initialize in interface JoinedMapping<Z,X,X>initialize in class AssociationMappingImpl<Z,X,X>managedInstance - the instancepublic boolean isAssociation()
isAssociation in interface JoinedMapping<Z,X,X>public boolean isId()
isId in interface SingularMapping<Z,X>public boolean isJoined()
isJoined in interface JoinedMapping<Z,X,X>public boolean isMap()
isMap in interface JoinedMapping<Z,X,X>public void link()
throws MappingException
link in class AssociationMappingImpl<Z,X,X>MappingException - thrown in case of a linkage errorpublic void mergeWith(EntityManagerImpl entityManager, ManagedInstance<?> instance, Object entity, org.apache.commons.lang.mutable.MutableBoolean requiresFlush, IdentityHashMap<Object,Object> processed, LinkedList<ManagedInstance<?>> instances)
mergeWith in class AssociationMappingImpl<Z,X,X>entityManager - the entity managerinstance - the instanceentity - the entityrequiresFlush - if an implicit flush is requiredprocessed - registry of processed entitiesinstances - the persisted instancespublic boolean references(Object instance, Object reference)
references in class AssociationMappingImpl<Z,X,X>instance - the source instancereference - the associate instancepublic void refresh(ManagedInstance<?> instance, Set<Object> processed)
refresh in class AssociationMappingImpl<Z,X,X>instance - the instance that is the owner of the associationprocessed - the set of processed instancespublic void setInverse(AssociationMappingImpl<?,?,?> inverse)
setInverse in class AssociationMappingImpl<Z,X,X>inverse - the inverse associationCopyright © 2012 Batoo Software & Consultancy. All Rights Reserved.