Interface IClassMapping
- 
- All Known Subinterfaces:
- IClassMappingUnitSupport
 
 public interface IClassMappingBasic interface for class mappings.- Since:
- 2.0
- Author:
- Eike Stepper, Stefan Winkler
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description java.sql.PreparedStatementcreateObjectIDStatement(IDBStoreAccessor accessor)Create a prepared statement which returns all IDs of instances of the corresponding class.java.sql.PreparedStatementcreateResourceQueryStatement(IDBStoreAccessor accessor, CDOID folderId, java.lang.String name, boolean exactMatch, CDOBranchPoint branchPoint)Create a prepared statement which returns all IDs of instances of the corresponding class.voiddetachObject(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.java.util.List<org.eclipse.net4j.db.ddl.IDBTable>getDBTables()Returns all DB tables which are used by this class and all its contained features.org.eclipse.emf.ecore.EClassgetEClass()IListMappinggetListMapping(org.eclipse.emf.ecore.EStructuralFeature feature)Get the mapping of the many-valued feature.java.util.List<IListMapping>getListMappings()java.util.List<ITypeMapping>getValueMappings()voidhandleRevisions(IDBStoreAccessor accessor, CDOBranch branch, long timeStamp, boolean exactTime, CDORevisionHandler handler)Passes all revisions of the store to thehandlerif all of the following conditions are met: Thebranchparameter isnullor equal torevision.getBranch().booleanqueryXRefs(IDBStoreAccessor accessor, IStoreAccessor.QueryXRefsContext context, java.lang.String idString)Retrieve cross-references from DBjava.util.Set<CDOID>readChangeSet(IDBStoreAccessor accessor, CDOChangeSetSegment[] segments)Returns a set of CDOIDs that have at least one revision in any of the passed branches and time ranges.booleanreadRevision(IDBStoreAccessor accessor, InternalCDORevision revision, int listChunk)Read a revision.voidwriteRevision(IDBStoreAccessor accessor, InternalCDORevision revision, boolean firstRevision, boolean revise, org.eclipse.net4j.util.om.monitor.OMMonitor monitor)Write the revision data to the database.
 
- 
- 
- 
Method Detail- 
getEClassorg.eclipse.emf.ecore.EClass getEClass() - Since:
- 3.0
 
 - 
getDBTablesjava.util.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
 
 - 
getListMappingIListMapping getListMapping(org.eclipse.emf.ecore.EStructuralFeature feature) Get the mapping of the many-valued feature.- Parameters:
- feature- the feature for which the mapping should be returned.- feature.isMany()has to be- true.
- Returns:
- the list mapping corresponding to the feature.
 
 - 
getListMappingsjava.util.List<IListMapping> getListMappings() - Since:
- 3.0
 
 - 
getValueMappingsjava.util.List<ITypeMapping> getValueMappings() - Since:
- 4.0
 
 - 
readRevisionboolean readRevision(IDBStoreAccessor accessor, InternalCDORevision revision, int listChunk) 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_DATEand 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.- falseif the revision could not be found. In this case, the content of- revisionis undefined.
 
 - 
writeRevisionvoid 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-- trueif the type of the object is supposed to be mapped,- falseotherwise.
- revise-- trueif the previous revision is supposed to be revised,- falseotherwise.
- monitor- the monitor to indicate progress.
- Since:
- 4.0
 
 - 
detachObjectvoid 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
 
 - 
createObjectIDStatementjava.sql.PreparedStatement createObjectIDStatement(IDBStoreAccessor accessor) 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
 
 - 
createResourceQueryStatementjava.sql.PreparedStatement createResourceQueryStatement(IDBStoreAccessor accessor, CDOID folderId, java.lang.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 statement
- folderId- the ID of the containing folder.- 0means none.
- name- the name of the resource node to look up
- exactMatch- if- true,- namemust match exactly, otherwise all resource nodes starting with- nameare 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 be- CDOBranchPoint.UNSPECIFIED_DATE. In case of non branching support the branch id must be equal to- CDOBranch.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 an- EClass instanceof CDOResourceNode.
- Since:
- 3.0
 
 - 
handleRevisionsvoid handleRevisions(IDBStoreAccessor accessor, CDOBranch branch, long timeStamp, boolean exactTime, CDORevisionHandler handler) Passes all revisions of the store to thehandlerif all of the following conditions are met:- The branchparameter isnullor equal torevision.getBranch().
- The timeStampparameter isCDOBranchPoint.UNSPECIFIED_DATEor equal torevision.getTimeStamp().
 
- The 
 - 
readChangeSetjava.util.Set<CDOID> readChangeSet(IDBStoreAccessor accessor, CDOChangeSetSegment[] segments) 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:
- IStoreAccessor.readChangeSet(OMMonitor, CDOChangeSetSegment...)
 
 - 
queryXRefsboolean queryXRefs(IDBStoreAccessor accessor, IStoreAccessor.QueryXRefsContext context, java.lang.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:
- IStoreAccessor.queryXRefs(QueryXRefsContext)
 
 
- 
 
-