Z - the source typeX - the destination typepublic class SingularAssociationMapping<Z,X> extends AssociationMapping<Z,X,X>
JoinedMapping.MappingType| Constructor and Description |
|---|
SingularAssociationMapping(ParentMapping<?,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.
|
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()
Returns the foreign key of the mapping.
|
AssociationMapping<?,?,?> |
getInverse()
Returns the inverse attribute.
|
JoinedMapping.MappingType |
getMappingType()
Returns the type of the mapping.
|
JoinTable |
getTable()
Returns the join table of the mapping.
|
EntityTypeImpl<X> |
getType()
Returns the bindable entity type.
|
void |
initialize(ManagedInstance<?> managedInstance)
Initializes the mapping.
|
boolean |
isAssociation()
Returns if the mapping is an association.
|
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)
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(AssociationMapping<?,?,?> inverse)
Sets the inverse attribute.
|
cascadesDetach, cascadesMerge, cascadesPersist, cascadesRefresh, cascadesRemove, getAssociationMetadata, getMappedBy, getMaxFetchJoinDepth, getSelectCriteria, isEager, isOwner, join, removesOrphansequals, get, getJavaType, getName, getParent, getPath, getRoot, hashCode, set, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPathpublic SingularAssociationMapping(ParentMapping<?,Z> parent, AssociatedSingularAttribute<? super Z,X> attribute)
parent - the parent mappingattribute - the attributepublic void checkTransient(ManagedInstance<?> managedInstance)
checkTransient in class AssociationMapping<Z,X,X>managedInstance - the managed instancepublic Object extractKey(Object value)
value - the valuepublic void flush(Connection connection, ManagedInstance<?> managedInstance, boolean removals, boolean force) throws SQLException
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 class Mapping<Z,X,X>public ForeignKey getForeignKey()
getForeignKey in class AssociationMapping<Z,X,X>public AssociationMapping<?,?,?> getInverse()
getInverse in class AssociationMapping<Z,X,X>public JoinedMapping.MappingType getMappingType()
public JoinTable getTable()
getTable in interface JoinedMapping<Z,X,X>getTable in class AssociationMapping<Z,X,X>public EntityTypeImpl<X> getType()
getType in interface JoinedMapping<Z,X,X>getType in class AssociationMapping<Z,X,X>public void initialize(ManagedInstance<?> managedInstance)
managedInstance - the instancepublic boolean isAssociation()
public boolean isJoined()
public boolean isMap()
public void link()
throws MappingException
link in class AssociationMapping<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)
mergeWith in class AssociationMapping<Z,X,X>entityManager - the entity managerinstance - the instanceentity - the entityrequiresFlush - if an implicit flush is requiredprocessed - registry of processed entitiespublic boolean references(Object instance, Object reference)
references in class AssociationMapping<Z,X,X>instance - the source instancereference - the associate instancepublic void refresh(ManagedInstance<?> instance, Set<Object> processed)
refresh in class AssociationMapping<Z,X,X>instance - the instance that is the owner of the associationprocessed - the set of processed instancespublic void setInverse(AssociationMapping<?,?,?> inverse)
setInverse in class AssociationMapping<Z,X,X>inverse - the inverse associationCopyright © 2012 Batoo Software & Consultancy. All Rights Reserved.