org.datanucleus.store.rdbms.scostore
Class AbstractCollectionStore
java.lang.Object
org.datanucleus.store.rdbms.scostore.BaseContainerStore
org.datanucleus.store.rdbms.scostore.ElementContainerStore
org.datanucleus.store.rdbms.scostore.AbstractCollectionStore
- All Implemented Interfaces:
- org.datanucleus.store.scostore.CollectionStore, org.datanucleus.store.scostore.Store
- Direct Known Subclasses:
- AbstractListStore, AbstractSetStore
public abstract class AbstractCollectionStore
- extends ElementContainerStore
- implements org.datanucleus.store.scostore.CollectionStore
Abstract representation of a store of a Collection.
Contains all common parts of storing Sets and Lists.
| Fields inherited from class org.datanucleus.store.rdbms.scostore.ElementContainerStore |
addStmt, clearStmt, clr, containerTable, elementInfo, elementIsPersistentInterface, elementMapping, elementsAreEmbedded, elementsAreSerialised, elementType, emd, iterateUsingDiscriminator, orderMapping, relationDiscriminatorMapping, relationDiscriminatorValue, removeStmt, sizeStmt, usingDiscriminatorInSizeStmt |
|
Method Summary |
boolean |
contains(org.datanucleus.store.ObjectProvider op,
Object element)
Method to verify if the association owner vs elements contains
a specific element in the association |
protected boolean |
containsInternal(org.datanucleus.store.ObjectProvider op,
Object element)
|
protected String |
getRemoveStmt(Object element)
Generate statement for removing an element from the Collection. |
protected String |
getUpdateEmbeddedElementStmt(org.datanucleus.store.mapped.mapping.JavaTypeMapping fieldMapping)
Generate statement for update the field of an embedded element. |
int[] |
internalRemove(org.datanucleus.store.ObjectProvider op,
org.datanucleus.store.connection.ManagedConnection conn,
boolean batched,
Object element,
boolean executeNow)
|
void |
update(org.datanucleus.store.ObjectProvider op,
Collection coll)
Method to update the collection to be the supplied collection of elements. |
boolean |
updateEmbeddedElement(org.datanucleus.store.ObjectProvider op,
Object element,
int fieldNumber,
Object value)
Method to update a field of an embedded element. |
boolean |
updateEmbeddedElement(org.datanucleus.store.ObjectProvider op,
Object element,
int fieldNumber,
Object value,
org.datanucleus.store.mapped.mapping.JavaTypeMapping fieldMapping)
|
| Methods inherited from class org.datanucleus.store.rdbms.scostore.ElementContainerStore |
clear, executeClear, getAddStmt, getClearStmt, getContainerTable, getElementInfo, getElementInformationForClass, getElementMapping, getEmd, getOrderMapping, getRelationDiscriminatorMapping, getRelationDiscriminatorValue, getSize, getSizeStmt, hasOrderMapping, invalidateAddStmt, isElementsAreEmbedded, isElementsAreSerialised, iterator, size, validateElementForReading, validateElementForWriting, validateElementType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.datanucleus.store.scostore.CollectionStore |
add, addAll, clear, hasOrderMapping, iterator, remove, removeAll, size |
| Methods inherited from interface org.datanucleus.store.scostore.Store |
getStoreManager |
containsStmt
protected String containsStmt
AbstractCollectionStore
protected AbstractCollectionStore(RDBMSStoreManager storeMgr,
org.datanucleus.ClassLoaderResolver clr)
- Constructor.
- Parameters:
storeMgr - Manager for the storeclr - ClassLoader resolver
updateEmbeddedElement
public boolean updateEmbeddedElement(org.datanucleus.store.ObjectProvider op,
Object element,
int fieldNumber,
Object value)
- Method to update a field of an embedded element.
- Specified by:
updateEmbeddedElement in interface org.datanucleus.store.scostore.CollectionStore
- Parameters:
op - ObjectProvider of the ownerelement - The element to updatefieldNumber - The number of the field to updatevalue - The value
- Returns:
- true if the datastore was updated
update
public void update(org.datanucleus.store.ObjectProvider op,
Collection coll)
- Method to update the collection to be the supplied collection of elements.
- Specified by:
update in interface org.datanucleus.store.scostore.CollectionStore
- Parameters:
op - ObjectProvider of the objectcoll - The collection to use
contains
public boolean contains(org.datanucleus.store.ObjectProvider op,
Object element)
- Method to verify if the association owner vs elements contains
a specific element in the association
- Specified by:
contains in interface org.datanucleus.store.scostore.CollectionStore
- Parameters:
op - ObjectProviderelement - The element
- Returns:
- Whether it contains the element
getUpdateEmbeddedElementStmt
protected String getUpdateEmbeddedElementStmt(org.datanucleus.store.mapped.mapping.JavaTypeMapping fieldMapping)
- Generate statement for update the field of an embedded element.
UPDATE SETTABLE
SET EMBEDDEDFIELD1 = ?
WHERE OWNERCOL=?
AND ELEMENTCOL = ?
- Parameters:
fieldMapping - The mapping for the field within the embedded object to be updated
- Returns:
- Statement for updating an embedded element in the Set
updateEmbeddedElement
public boolean updateEmbeddedElement(org.datanucleus.store.ObjectProvider op,
Object element,
int fieldNumber,
Object value,
org.datanucleus.store.mapped.mapping.JavaTypeMapping fieldMapping)
containsInternal
protected boolean containsInternal(org.datanucleus.store.ObjectProvider op,
Object element)
internalRemove
public int[] internalRemove(org.datanucleus.store.ObjectProvider op,
org.datanucleus.store.connection.ManagedConnection conn,
boolean batched,
Object element,
boolean executeNow)
throws org.datanucleus.store.mapped.exceptions.MappedDatastoreException
- Throws:
org.datanucleus.store.mapped.exceptions.MappedDatastoreException
getRemoveStmt
protected String getRemoveStmt(Object element)
- Generate statement for removing an element from the Collection.
DELETE FROM COLLTABLE WHERE OWNERCOL=? AND ELEMENTCOL = ?
- Returns:
- Statement for deleting an item from the Collection.
Copyright © 2012. All Rights Reserved.