Z - the source typeE - the element typeC - the collection typepublic class ElementCollectionMappingImpl<Z,C,E> extends AbstractMapping<Z,C,E> implements PluralMappingEx<Z,C,E>, ElementCollectionMapping<Z,C,E>
| Constructor and Description |
|---|
ElementCollectionMappingImpl(AbstractParentMapping<?,Z> parent,
PluralAttributeImpl<? super Z,C,E> attribute) |
| Modifier and Type | Method and Description |
|---|---|
void |
attach(Connection connection,
ManagedInstance<?> instance,
Joinable[] batch,
int size)
Attaches the child.
|
boolean |
cascadesMerge()
Returns if merges are cascaded.
|
void |
detach(Connection connection,
ManagedInstance<?> instance,
Object key,
Object child)
detaches the child.
|
void |
detachAll(Connection connection,
ManagedInstance<?> instance)
Details all the children.
|
void |
enhance(ManagedInstance<?> instance)
Enhances the collection to the managed collection
|
Object |
extractKey(Object value)
Extracts key from the value.
|
void |
flush(Connection connection,
ManagedInstance<?> managedInstance,
boolean removals,
boolean force)
Flushes the associates.
|
PluralAttributeImpl<? super Z,C,E> |
getAttribute()
Returns the attribute of the mapping.
|
CollectionTable |
getCollectionTable()
Returns the collection table.
|
JoinableTable |
getJoinTable()
Returns the join table for the relation.
|
SingularMappingEx<? super E,?> |
getKeyMapping()
Returns the key mapping of the element collection mapping.
|
String |
getMapKey()
Returns the map key of the element collection mapping.
|
AbstractMapping<?,?,?> |
getMapping(String path)
Returns child mapping of the
type. |
MappingType |
getMappingType()
Returns the type of the mapping.
|
String |
getOrderBy()
Returns the order by of the association.
|
OrderColumn |
getOrderColumn()
Returns the order column.
|
TypeImpl<E> |
getType()
Returns the bindable entity type.
|
void |
initialize(ManagedInstance<?> instance)
Initializes the mapping.
|
boolean |
isAssociation()
Returns if the mapping is an association.
|
boolean |
isEager()
Returns if the association should be eagerly fetched.
|
boolean |
isJoined()
Returns if the mapping is a joined mapping.
|
boolean |
isMap()
Returns if the mapping is a map collection.
|
String |
join(String parentAlias,
String alias,
javax.persistence.criteria.JoinType joinType)
Returns the join SQL for the mapping.
|
void |
link()
Links the attribute to its collection table
|
void |
load(ManagedInstance<?> instance)
Loads the collection eagerly.
|
Collection<? extends E> |
loadCollection(ManagedInstance<?> instance)
Loads and returns the collection.
|
<K> Map<? extends K,? extends E> |
loadMap(ManagedInstance<?> instance)
Loads and returns the map
|
void |
setLazy(ManagedInstance<?> instance)
Sets the lazy instance for the collection
|
void |
sortList(Object instance)
Sorts the managed list of the instance
|
equals, 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 ElementCollectionMappingImpl(AbstractParentMapping<?,Z> parent, PluralAttributeImpl<? super Z,C,E> attribute)
parent - the parent mappingattribute - the attributepublic void attach(Connection connection, ManagedInstance<?> instance, Joinable[] batch, int size) throws SQLException
attach in interface PluralMappingEx<Z,C,E>connection - the connectioninstance - the instancebatch - the batch of childrensize - the size of the batchSQLException - thrown in case of an SQL errorpublic boolean cascadesMerge()
cascadesMerge in interface PluralMappingEx<Z,C,E>public void detach(Connection connection, ManagedInstance<?> instance, Object key, Object child) throws SQLException
detach in interface PluralMappingEx<Z,C,E>connection - the connectioninstance - the instancekey - the key, may be nullchild - the childSQLException - thrown in case of an SQL errorpublic void detachAll(Connection connection, ManagedInstance<?> instance) throws SQLException
detachAll in interface PluralMappingEx<Z,C,E>connection - the connectioninstance - the instanceSQLException - thrown in case of an SQL errorpublic void enhance(ManagedInstance<?> instance)
enhance in interface PluralMappingEx<Z,C,E>instance - the managed instancepublic Object extractKey(Object value)
extractKey in interface JoinedMapping<Z,C,E>value - the valuepublic void flush(Connection connection, ManagedInstance<?> managedInstance, boolean removals, boolean force) throws SQLException
flush in interface JoinedMapping<Z,C,E>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 PluralAttributeImpl<? super Z,C,E> getAttribute()
getAttribute in interface JoinedMapping<Z,C,E>getAttribute in class AbstractMapping<Z,C,E>public CollectionTable getCollectionTable()
public JoinableTable getJoinTable()
This is, for associations the JoinTable, for element collections the CollectionTable.
getJoinTable in interface JoinedMapping<Z,C,E>public SingularMappingEx<? super E,?> getKeyMapping()
public String getMapKey()
public AbstractMapping<?,?,?> getMapping(String path)
type.getMapping in interface PluralMappingEx<Z,C,E>path - the pathpublic MappingType getMappingType()
getMappingType in interface JoinedMapping<Z,C,E>public String getOrderBy()
getOrderBy in interface PluralMappingEx<Z,C,E>public OrderColumn getOrderColumn()
getOrderColumn in interface PluralMappingEx<Z,C,E>public TypeImpl<E> getType()
getType in interface JoinedMapping<Z,C,E>public void initialize(ManagedInstance<?> instance)
initialize in interface JoinedMapping<Z,C,E>instance - the instancepublic boolean isAssociation()
isAssociation in interface JoinedMapping<Z,C,E>public boolean isEager()
isEager in interface JoinedMapping<Z,C,E>public boolean isJoined()
isJoined in interface JoinedMapping<Z,C,E>public boolean isMap()
isMap in interface JoinedMapping<Z,C,E>public String join(String parentAlias, String alias, javax.persistence.criteria.JoinType joinType)
join in interface JoinedMapping<Z,C,E>parentAlias - the parent table aliasalias - the primary table aliasjoinType - the join typepublic void link()
MappingException - thrown in case of a linkage errorpublic void load(ManagedInstance<?> instance)
load in interface PluralMappingEx<Z,C,E>instance - the managed instancepublic Collection<? extends E> loadCollection(ManagedInstance<?> instance)
loadCollection in interface PluralMappingEx<Z,C,E>instance - the managed instance owning the collectionpublic <K> Map<? extends K,? extends E> loadMap(ManagedInstance<?> instance)
loadMap in interface PluralMappingEx<Z,C,E>K - the key type of the mappublic void setLazy(ManagedInstance<?> instance)
setLazy in interface PluralMappingEx<Z,C,E>instance - the managed instanceCopyright © 2012-2013 Batoo. All Rights Reserved.