Interface IClassMapping
- All Known Subinterfaces:
IClassMappingUnitSupport
public interface IClassMapping
Basic interface for class mappings.
- Since:
- 2.0
- Author:
- Eike Stepper, Stefan Winkler
-
Method Summary
Modifier and TypeMethodDescriptioncreateObjectIDStatement
(IDBStoreAccessor accessor) Create a prepared statement which returns all IDs of instances of the corresponding class.createResourceQueryStatement
(IDBStoreAccessor accessor, CDOID folderId, String name, boolean exactMatch, CDOBranchPoint branchPoint) Create a prepared statement which returns all IDs of instances of the corresponding class.void
detachObject
(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, long timeStamp, org.eclipse.net4j.util.om.monitor.OMMonitor monitor) Detaches (deletes) a CDO object leaving a "ghost" revision behind.List<org.eclipse.net4j.db.ddl.IDBTable>
Returns all DB tables which are used by this class and all its contained features.getListMapping
(EStructuralFeature feature) Get the mapping of the many-valued feature.void
handleRevisions
(IDBStoreAccessor accessor, CDOBranch branch, long timeStamp, boolean exactTime, CDORevisionHandler handler) Passes all revisions of the store to thehandler
if all of the following conditions are met: Thebranch
parameter isnull
or equal torevision.getBranch()
.boolean
queryXRefs
(IDBStoreAccessor accessor, IStoreAccessor.QueryXRefsContext context, String idString) Retrieve cross-references from DBreadChangeSet
(IDBStoreAccessor accessor, CDOChangeSetSegment[] segments) Returns a set of CDOIDs that have at least one revision in any of the passed branches and time ranges.boolean
readRevision
(IDBStoreAccessor accessor, InternalCDORevision revision, int listChunk) Read a revision.void
writeRevision
(IDBStoreAccessor accessor, InternalCDORevision revision, boolean firstRevision, boolean revise, org.eclipse.net4j.util.om.monitor.OMMonitor monitor) Write the revision data to the database.
-
Method Details
-
getEClass
EClass getEClass()- Since:
- 3.0
-
getDBTables
List<org.eclipse.net4j.db.ddl.IDBTable> getDBTables()Returns all DB tables which are used by this class and all its contained features.- Returns:
- a collection of all tables of this class and all its contained features.
- Since:
- 3.0
-
getListMapping
Get the mapping of the many-valued feature.- Parameters:
feature
- the feature for which the mapping should be returned.feature.isMany()
has to betrue
.- Returns:
- the list mapping corresponding to the feature.
-
getListMappings
List<IListMapping> getListMappings()- Since:
- 3.0
-
getValueMappings
List<ITypeMapping> getValueMappings()- Since:
- 4.0
-
readRevision
Read a revision. The branch and timestamp to be read are derived from the branchPoint which is set to the Revision. Note that non-audit stores only supportCDOBranchPoint.UNSPECIFIED_DATE
and non-branching stores only support the main branch.- Parameters:
accessor
- the accessor to use.revision
- the revision object into which the data should be read. The revision has to be have its ID set to the requested object's ID. The version is ignored, as the version parameter is used to determine the version to be read.listChunk
- the chunk size to read attribute lists.- Returns:
true
, if the revision has been found and read correctly.false
if the revision could not be found. In this case, the content ofrevision
is undefined.
-
writeRevision
void writeRevision(IDBStoreAccessor accessor, InternalCDORevision revision, boolean firstRevision, boolean revise, org.eclipse.net4j.util.om.monitor.OMMonitor monitor) Write the revision data to the database.- Parameters:
accessor
- the accessor to use.revision
- the revision to write.firstRevision
-true
if the type of the object is supposed to be mapped,false
otherwise.revise
-true
if the previous revision is supposed to be revised,false
otherwise.monitor
- the monitor to indicate progress.- Since:
- 4.0
-
detachObject
void detachObject(IDBStoreAccessor accessor, CDOID id, int version, CDOBranch branch, long timeStamp, org.eclipse.net4j.util.om.monitor.OMMonitor monitor) Detaches (deletes) a CDO object leaving a "ghost" revision behind.- Parameters:
accessor
- the accessor to use.id
- the id to revise.version
- the last valid version.timeStamp
- the timestamp of detach.monitor
- the monitor to indicate progress.- Since:
- 3.0
-
createObjectIDStatement
Create a prepared statement which returns all IDs of instances of the corresponding class.- Parameters:
accessor
- the accessor to use to create the statement- Returns:
- the prepared statement ready to be executed using
result.executeQuery()
. - Since:
- 3.0
-
createResourceQueryStatement
PreparedStatement createResourceQueryStatement(IDBStoreAccessor accessor, CDOID folderId, String name, boolean exactMatch, CDOBranchPoint branchPoint) Create a prepared statement which returns all IDs of instances of the corresponding class.- Parameters:
accessor
- the accessor to use to create the statementfolderId
- the ID of the containing folder.0
means none.name
- the name of the resource node to look upexactMatch
- iftrue
,name
must match exactly, otherwise all resource nodes starting withname
are returned.branchPoint
- a branchPoint (branch and timestamp). A timestamp in the past if past versions should be looked up. In case of no audit support, this must beCDOBranchPoint.UNSPECIFIED_DATE
. In case of non branching support the branch id must be equal toCDOBranch.MAIN_BRANCH_ID
.- Returns:
- the prepared statement ready to be executed using
result.executeQuery()
. - Throws:
org.eclipse.net4j.util.ImplementationError
- if called on a mapping which does not map anEClass instanceof CDOResourceNode
.- Since:
- 3.0
-
handleRevisions
void handleRevisions(IDBStoreAccessor accessor, CDOBranch branch, long timeStamp, boolean exactTime, CDORevisionHandler handler) Passes all revisions of the store to thehandler
if all of the following conditions are met:- The
branch
parameter isnull
or equal torevision.getBranch()
. - The
timeStamp
parameter isCDOBranchPoint.UNSPECIFIED_DATE
or equal torevision.getTimeStamp()
.
- The
-
readChangeSet
Returns a set of CDOIDs that have at least one revision in any of the passed branches and time ranges. DetachedCDORevisions must also be considered!- Since:
- 3.0
- See Also:
-
queryXRefs
boolean queryXRefs(IDBStoreAccessor accessor, IStoreAccessor.QueryXRefsContext context, String idString) Retrieve cross-references from DB- Parameters:
idString
- a string of the form "(id1, id2, id3, ...)" which can be used directly in SQL to form the where-part "SELECT * FROM foobar WHERE foobar.target IN [idString]".- Since:
- 4.0
- See Also:
-