Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIbrahim Sallam2011-06-07 10:22:39 +0000
committerIbrahim Sallam2011-06-07 10:22:39 +0000
commit3e8228bb3b4fe5b49b4141459cba619a3462dbef (patch)
tree2b53ec262b95afe101f1165955036e67f6484cb8
parentcedc2beed699f131d3557c2ac3bdf7c5fe5f33e0 (diff)
downloadcdo-3e8228bb3b4fe5b49b4141459cba619a3462dbef.tar.gz
cdo-3e8228bb3b4fe5b49b4141459cba619a3462dbef.tar.xz
cdo-3e8228bb3b4fe5b49b4141459cba619a3462dbef.zip
implement StoreAccessor handleRevisions() and various code cleanup plus removing warnings.
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/.settings/.api_filters12
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStore.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStoreAccessor.java285
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStoreConfig.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/FdManager.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyClass.java97
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyConnection.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyObject.java110
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyObjectManager.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjySession.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/BasicTypeMapper.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/BigIntegerTypeMapper.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/ByteArrayTypeMapper.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/FeatureMapTypeMapper.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/ManyReferenceMapper.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/StringManyTypeMapper.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/StringTypeMapper.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyArrayListId.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyBranchManager.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyResourceList.java9
20 files changed, 339 insertions, 272 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/.settings/.api_filters b/plugins/org.eclipse.emf.cdo.server.objectivity/.settings/.api_filters
new file mode 100644
index 0000000000..e4bad13131
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/.settings/.api_filters
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.emf.cdo.server.objectivity" version="2">
+ <resource path="src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStoreAccessor.java" type="org.eclipse.emf.cdo.server.internal.objectivity.ObjectivityStoreAccessor">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="DurableLocking"/>
+ <message_argument value="IDurableLockingManager"/>
+ <message_argument value="ObjectivityStoreAccessor"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStore.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStore.java
index b9dbd79fbb..9f60047287 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStore.java
@@ -27,9 +27,6 @@ import org.eclipse.emf.cdo.server.internal.objectivity.db.ObjyPropertyMapHandler
import org.eclipse.emf.cdo.server.internal.objectivity.db.ObjySchema;
import org.eclipse.emf.cdo.server.internal.objectivity.db.ObjyScope;
import org.eclipse.emf.cdo.server.internal.objectivity.db.ObjySession;
-import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyBranchManager;
-import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyLockAreaManager;
-import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyResourceList;
import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyStoreInfo;
import org.eclipse.emf.cdo.server.internal.objectivity.utils.ObjyDb;
import org.eclipse.emf.cdo.server.objectivity.IObjectivityStore;
@@ -169,12 +166,11 @@ public class ObjectivityStore extends Store implements IObjectivityStore
objyPropertyMapHandler = new ObjyPropertyMapHandler(repositoryName);
objyPackageHandler = new ObjyPackageHandler(repositoryName);
- // more initializations.
- ObjyLockAreaManager objyLockAreaManager = objySession.getLockAreaManager(repositoryName);
- ObjyBranchManager objyBranchManager = objySession.getBranchManager(repositoryName);
- ObjyResourceList objyResources = objySession.getResourceList(repositoryName);
+ // more initializations, this will ensure that we have Manager objects created.
+ objySession.getLockAreaManager(repositoryName);
+ objySession.getBranchManager(repositoryName);
+ objySession.getResourceList(repositoryName);
- long t3 = System.currentTimeMillis();
objySession.commit();
storeInitialized = true;
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStoreAccessor.java
index 1e73dcfc79..1016399512 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStoreAccessor.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.server.internal.objectivity;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchHandler;
+import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
@@ -28,7 +29,10 @@ import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionCacheAdder;
import org.eclipse.emf.cdo.common.revision.CDORevisionHandler;
+import org.eclipse.emf.cdo.common.revision.CDORevisionManager;
+import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
import org.eclipse.emf.cdo.server.IQueryHandler;
+import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.IStoreAccessor.DurableLocking;
import org.eclipse.emf.cdo.server.ITransaction;
@@ -40,6 +44,7 @@ import org.eclipse.emf.cdo.server.internal.objectivity.db.ObjyObjectManager;
import org.eclipse.emf.cdo.server.internal.objectivity.db.ObjyPackageHandler;
import org.eclipse.emf.cdo.server.internal.objectivity.db.ObjySchema;
import org.eclipse.emf.cdo.server.internal.objectivity.db.ObjySession;
+import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyBase;
import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyBranch;
import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyBranchManager;
import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyCommitInfo;
@@ -476,105 +481,105 @@ public class ObjectivityStoreAccessor extends StoreAccessor implements IObjectiv
* @param created
* @param branch
*/
- private void writeRevisionDelta2(InternalCDORevisionDelta delta, CDOBranch branch, long created)
- {
- // ensureSessionBegin();
-
- int deltaVersion = delta.getVersion();
- int newVersion = CDOBranchVersion.FIRST_VERSION;
-
- ObjyObject objyObject = getObject(delta.getID());
- if (TRACER_DEBUG.isEnabled())
- {
- TRACER_DEBUG.format("writingRevisionDelta getting Object: {0}, v:{1} - BranchId:{2}", objyObject.ooId()
- .getStoreString(), deltaVersion, delta.getBranch().getID());
- }
- ObjyObject objyOriginalRevision = objyObject.getRevisionByVersion(deltaVersion, delta.getBranch().getID(),
- objySession.getObjectManager());
-
- if (branch.getID() == delta.getBranch().getID())
- {
- // Same branch, increase version
- newVersion = deltaVersion + 1;
- }
-
- if (TRACER_DEBUG.isEnabled())
- {
- TRACER_DEBUG.format("Writing revision delta: {0}, v:{1} - OID:{2}, v:{3} - BranchId:{4}", delta, deltaVersion,
- objyObject.ooId().getStoreString(), objyOriginalRevision.getVersion(), objyOriginalRevision.getBranchId());
- TRACER_DEBUG.format("... delta branch ID: {0} - revision branch ID: {1}", branch.getID(),
- objyOriginalRevision.getBranchId());
- }
- // System.out.println(">>>IS: Delta Writing: " + delta.getID() + " - oid: " + objyObject.ooId().getStoreString());
- // System.out.println("\t - old version : " + delta.getVersion());
- // System.out.println("\t - created : " + created);
- // System.out.println("\t - delta.branch: " + delta.getBranch().toString());
- // System.out.println("\t - branch : " + branch.toString());
- // System.out.println("\t - branch TS : " + branch.getPoint(created).getTimeStamp());
- // System.out.println("\t - delta : " + delta.toString());
- // for debugging...
-
- if (objyOriginalRevision.getVersion() != deltaVersion)
- {
- throw new RuntimeException("ObjecitivityStoreAccessor : Dirty write");
- }
-
- ObjyObject objyNewRevision = null;
-
- if (getStore().isRequiredToSupportAudits())
- {
- // newObjyRevision = objySession.getObjectManager().copyRevision(this, objyRevision);
- // objyRevision.setRevisedBranchId(branch.getID();
- // InternalCDORevision originalRevision = getStore().getRepository().getRevisionManager()
- // .getRevisionByVersion(delta.getID(), delta, 0, true);
- InternalCDORevision originalRevision = getStore().getRepository().getRevisionManager()
- .getRevisionByVersion(delta.getID(), delta.getBranch().getVersion(deltaVersion), 0, true);
-
- // 100917-IS: KISS - InternalCDORevision newRevision = originalRevision.copy();
-
- // 100917-IS: KISS - newRevision.setVersion(deltaVersion + 1);
- // 100917-IS: KISS - newRevision.setBranchPoint(delta.getBranch().getPoint(created));
- // 100917-IS: KISS - newObjyRevision = objySession.getObjectManager().newObject(newRevision.getEClass(),
- // objyRevision.ooId());
- // 100917-IS: KISS - objyNewRevision.update(this, newRevision);
-
- // create a new object, fill it with the original revision data, then
- // modify the creation and the branch ID accordingly.
- objyNewRevision = objySession.getObjectManager().newObject(originalRevision.getEClass(),
- objyOriginalRevision.ooId());
- objyNewRevision.update(this, originalRevision);
- objyNewRevision.setBranchId(delta.getBranch().getID());
- // the following are done at the end.
- // objyNewRevision.setVersion(deltaVersion + 1);
- // objyNewRevision.setCreationTime(created);
-
- objyObject.addToRevisions(objyNewRevision);
-
- if (getStore().isRequiredToSupportBranches() /* && branch.getID() != CDOBranch.MAIN_BRANCH_ID */)
- {
- // add the newObjyRevision to the proper branch.
- ObjyBranch objyBranch = objySession.getBranchManager(getRepositoryName()).getBranch(branch.getID());
- ooObj anObj = ooObj.create_ooObj(objyNewRevision.ooId());
- objyBranch.addRevision(anObj);
- }
- if (newVersion > CDORevision.FIRST_VERSION)
- {
- // revise the original revision last, otherwise we can end up with the revised date in the new revision.
- objyOriginalRevision.setRevisedTime(branch.getPoint(created).getTimeStamp() - 1);
- }
- }
- else
- {
- objyNewRevision = objyOriginalRevision;
- }
-
- ObjectivityFeatureDeltaWriter visitor = new ObjectivityFeatureDeltaWriter(objyNewRevision);
-
- delta.accept(visitor);
-
- objyNewRevision.setCreationTime(branch.getPoint(created).getTimeStamp());
- objyNewRevision.setVersion(newVersion); // TODO - verify with Eike if this is true!!!
- }
+ // private void writeRevisionDelta2(InternalCDORevisionDelta delta, CDOBranch branch, long created)
+ // {
+ // // ensureSessionBegin();
+ //
+ // int deltaVersion = delta.getVersion();
+ // int newVersion = CDOBranchVersion.FIRST_VERSION;
+ //
+ // ObjyObject objyObject = getObject(delta.getID());
+ // if (TRACER_DEBUG.isEnabled())
+ // {
+ // TRACER_DEBUG.format("writingRevisionDelta getting Object: {0}, v:{1} - BranchId:{2}", objyObject.ooId()
+ // .getStoreString(), deltaVersion, delta.getBranch().getID());
+ // }
+ // ObjyObject objyOriginalRevision = objyObject.getRevisionByVersion(deltaVersion, delta.getBranch().getID(),
+ // objySession.getObjectManager());
+ //
+ // if (branch.getID() == delta.getBranch().getID())
+ // {
+ // // Same branch, increase version
+ // newVersion = deltaVersion + 1;
+ // }
+ //
+ // if (TRACER_DEBUG.isEnabled())
+ // {
+ // TRACER_DEBUG.format("Writing revision delta: {0}, v:{1} - OID:{2}, v:{3} - BranchId:{4}", delta, deltaVersion,
+ // objyObject.ooId().getStoreString(), objyOriginalRevision.getVersion(), objyOriginalRevision.getBranchId());
+ // TRACER_DEBUG.format("... delta branch ID: {0} - revision branch ID: {1}", branch.getID(),
+ // objyOriginalRevision.getBranchId());
+ // }
+ // // System.out.println(">>>IS: Delta Writing: " + delta.getID() + " - oid: " + objyObject.ooId().getStoreString());
+ // // System.out.println("\t - old version : " + delta.getVersion());
+ // // System.out.println("\t - created : " + created);
+ // // System.out.println("\t - delta.branch: " + delta.getBranch().toString());
+ // // System.out.println("\t - branch : " + branch.toString());
+ // // System.out.println("\t - branch TS : " + branch.getPoint(created).getTimeStamp());
+ // // System.out.println("\t - delta : " + delta.toString());
+ // // for debugging...
+ //
+ // if (objyOriginalRevision.getVersion() != deltaVersion)
+ // {
+ // throw new RuntimeException("ObjecitivityStoreAccessor : Dirty write");
+ // }
+ //
+ // ObjyObject objyNewRevision = null;
+ //
+ // if (getStore().isRequiredToSupportAudits())
+ // {
+ // // newObjyRevision = objySession.getObjectManager().copyRevision(this, objyRevision);
+ // // objyRevision.setRevisedBranchId(branch.getID();
+ // // InternalCDORevision originalRevision = getStore().getRepository().getRevisionManager()
+ // // .getRevisionByVersion(delta.getID(), delta, 0, true);
+ // InternalCDORevision originalRevision = getStore().getRepository().getRevisionManager()
+ // .getRevisionByVersion(delta.getID(), delta.getBranch().getVersion(deltaVersion), 0, true);
+ //
+ // // 100917-IS: KISS - InternalCDORevision newRevision = originalRevision.copy();
+ //
+ // // 100917-IS: KISS - newRevision.setVersion(deltaVersion + 1);
+ // // 100917-IS: KISS - newRevision.setBranchPoint(delta.getBranch().getPoint(created));
+ // // 100917-IS: KISS - newObjyRevision = objySession.getObjectManager().newObject(newRevision.getEClass(),
+ // // objyRevision.ooId());
+ // // 100917-IS: KISS - objyNewRevision.update(this, newRevision);
+ //
+ // // create a new object, fill it with the original revision data, then
+ // // modify the creation and the branch ID accordingly.
+ // objyNewRevision = objySession.getObjectManager().newObject(originalRevision.getEClass(),
+ // objyOriginalRevision.ooId());
+ // objyNewRevision.update(this, originalRevision);
+ // objyNewRevision.setBranchId(delta.getBranch().getID());
+ // // the following are done at the end.
+ // // objyNewRevision.setVersion(deltaVersion + 1);
+ // // objyNewRevision.setCreationTime(created);
+ //
+ // objyObject.addToRevisions(objyNewRevision);
+ //
+ // if (getStore().isRequiredToSupportBranches() /* && branch.getID() != CDOBranch.MAIN_BRANCH_ID */)
+ // {
+ // // add the newObjyRevision to the proper branch.
+ // ObjyBranch objyBranch = objySession.getBranchManager(getRepositoryName()).getBranch(branch.getID());
+ // ooObj anObj = ooObj.create_ooObj(objyNewRevision.ooId());
+ // objyBranch.addRevision(anObj);
+ // }
+ // if (newVersion > CDORevision.FIRST_VERSION)
+ // {
+ // // revise the original revision last, otherwise we can end up with the revised date in the new revision.
+ // objyOriginalRevision.setRevisedTime(branch.getPoint(created).getTimeStamp() - 1);
+ // }
+ // }
+ // else
+ // {
+ // objyNewRevision = objyOriginalRevision;
+ // }
+ //
+ // ObjectivityFeatureDeltaWriter visitor = new ObjectivityFeatureDeltaWriter(objyNewRevision);
+ //
+ // delta.accept(visitor);
+ //
+ // objyNewRevision.setCreationTime(branch.getPoint(created).getTimeStamp());
+ // objyNewRevision.setVersion(newVersion); // TODO - verify with Eike if this is true!!!
+ // }
/**
* Called for each revision delta.
@@ -749,11 +754,13 @@ public class ObjectivityStoreAccessor extends StoreAccessor implements IObjectiv
}
/**
- * return an ObjyObject that represent the CDOID.
+ * return an ObjyObject that represent the CDOID base.
*/
public ObjyObject getObject(CDOID id)
{
- return objySession.getObjectManager().getObject(id);
+ ObjyObject objyObject = objySession.getObjectManager().getObject(id);
+ // make sure we get the base one and not any cached version.
+ return objyObject.getBaseObject();
}
/*****
@@ -1136,7 +1143,6 @@ public class ObjectivityStoreAccessor extends StoreAccessor implements IObjectiv
{
if (eReference.isMany())
{
- @SuppressWarnings("unchecked")
List<Object> results = objyObject.fetchList(this, eReference, 0, CDORevision.UNCHUNKED);
if (results != null)
{
@@ -1645,6 +1651,7 @@ public class ObjectivityStoreAccessor extends StoreAccessor implements IObjectiv
public Pair<Integer, Long> createBranch(int branchID, BranchInfo branchInfo)
{
ensureSessionBegin();
+ boolean convertToUpdate = false;
// IS: this is a hack to overcome the issue in cdo core where the Accessor is requested for
// read but it's trying to create stuff.
if (isRead)
@@ -1653,13 +1660,17 @@ public class ObjectivityStoreAccessor extends StoreAccessor implements IObjectiv
// upgrade the session to update.
objySession.commit();
objySession.setOpenMode(oo.openReadWrite);
+ convertToUpdate = true;
objySession.begin();
}
Pair<Integer, Long> retValue = objySession.getBranchManager(getRepositoryName()).createBranch(branchID, branchInfo);
- // return the session to read.
- objySession.commit();
- objySession.setOpenMode(oo.openReadOnly);
- objySession.begin();
+ if (convertToUpdate)
+ {
+ // return the session to read.
+ objySession.commit();
+ objySession.setOpenMode(oo.openReadOnly);
+ objySession.begin();
+ }
return retValue;
}
@@ -1706,10 +1717,72 @@ public class ObjectivityStoreAccessor extends StoreAccessor implements IObjectiv
public void handleRevisions(EClass eClass, CDOBranch branch, long timeStamp, boolean exactTime,
CDORevisionHandler handler)
{
+ ensureSessionBegin();
+ IRepository repository = getStore().getRepository();
+ CDORevisionManager revisionManager = repository.getRevisionManager();
+ CDOBranchManager branchManager = repository.getBranchManager();
+
+ // scan FD for ObjyBase which is the base class for all revisions
+ Iterator<?> itr = objySession.getFD().scan(ObjyBase.CLASS_NAME);
+ ObjyObject objyObject = null;
+ while (itr.hasNext())
+ {
+ objyObject = objySession.getObjectManager().getObject(((ooObj)itr).getOid());
+ if (!handleRevision(objyObject, eClass, branch, timeStamp, exactTime, handler, revisionManager, branchManager))
+ {
+ return;
+ }
+ }
// TODO: implement ObjectivityStoreAccessor.handleRevisions(eClass, branch, timeStamp, exactTime, handler)
throw new UnsupportedOperationException();
}
+ private boolean handleRevision(ObjyObject objyObject, EClass eClass, CDOBranch branch, long timeStamp,
+ boolean exactTime, CDORevisionHandler handler, CDORevisionManager revisionManager, CDOBranchManager branchManager)
+ {
+ if (objyObject.getVersion() < 0) // DetachedCDORevision
+ {
+ return true;
+ }
+
+ if (eClass != null && ObjySchema.getEClass(getStore(), objyObject.objyClass()) != eClass)
+ {
+ return true;
+ }
+
+ if (branch != null && objyObject.getBranchId() != branch.getID())
+ {
+ return true;
+ }
+
+ if (timeStamp != CDOBranchPoint.INVALID_DATE)
+ {
+ if (exactTime)
+ {
+ if (timeStamp != CDOBranchPoint.UNSPECIFIED_DATE && objyObject.getCreationTime() != timeStamp)
+ {
+ return true;
+ }
+ }
+ else
+ {
+ long startTime = objyObject.getCreationTime();
+ long endTime = objyObject.getRevisedTime();
+ if (!CDOCommonUtil.isValidTimeStamp(timeStamp, startTime, endTime))
+ {
+ return true;
+ }
+ }
+ }
+
+ CDOBranchVersion branchVersion = branchManager.getBranch((int)objyObject.getBranchId()).getVersion(
+ Math.abs(objyObject.getVersion()));
+ InternalCDORevision revision = (InternalCDORevision)revisionManager.getRevisionByVersion(
+ OBJYCDOIDUtil.getCDOID(objyObject.ooId()), branchVersion, CDORevision.UNCHUNKED, true);
+
+ return handler.handleRevision(revision);
+ }
+
public Set<CDOID> readChangeSet(OMMonitor monitor, CDOChangeSetSegment... segments)
{
monitor.begin(segments.length);
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStoreConfig.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStoreConfig.java
index d781a073a6..3377fb090d 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStoreConfig.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/ObjectivityStoreConfig.java
@@ -94,7 +94,8 @@ public class ObjectivityStoreConfig extends Lifecycle implements IObjectivitySto
String fdName = fdConfig.getAttribute("name"); //$NON-NLS-1$
String lockServerHost = fdConfig.getAttribute("lockServerHost"); //$NON-NLS-1$
String fdDirPath = fdConfig.getAttribute("fdDirPath"); //$NON-NLS-1$
- String dbDirPath = fdConfig.getAttribute("dbDirPath"); //$NON-NLS-1$
+ // for future use once we allow databases to be created somewhere else.
+ // String dbDirPath = fdConfig.getAttribute("dbDirPath"); //$NON-NLS-1$
String logDirPath = fdConfig.getAttribute("logDirPath");//$NON-NLS-1$
String fdFileHost = fdConfig.getAttribute("fdFileHost"); //$NON-NLS-1$
String fdNumber = fdConfig.getAttribute("fdNumber"); //$NON-NLS-1$
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/FdManager.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/FdManager.java
index 03cd46bf74..d9d64b689f 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/FdManager.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/FdManager.java
@@ -42,8 +42,6 @@ public class FdManager
private static final String DEFAULT_VALUE = "_DEFAULT_";
- // private static FdManager fdManagerSingleton = null;
-
private String fdName = "test";
private String fdFileHost = DEFAULT_VALUE;
@@ -62,8 +60,6 @@ public class FdManager
private boolean initialized = false;
- private String configPath = "configuration";
-
private String logDirPath = null;
protected void initialize(boolean reset)
@@ -557,7 +553,7 @@ public class FdManager
boolean noDefaultValueSet(String value)
{
- return value == null || value.isEmpty() || value.equals(DEFAULT_VALUE);
+ return value == null || value.length() == 0 || value.equals(DEFAULT_VALUE);
}
public void setlogDirPath(String logDirPath)
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyClass.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyClass.java
index 5a7456f44a..f9295f1882 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyClass.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyClass.java
@@ -10,20 +10,11 @@
*/
package org.eclipse.emf.cdo.server.internal.objectivity.db;
-import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyArrayListId;
-import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyArrayListString;
-import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyFeatureMapArrayList;
-import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyProxy;
-
import com.objy.as.app.Class_Position;
import com.objy.as.app.d_Attribute;
import com.objy.as.app.d_Class;
-import com.objy.as.app.d_Ref_Type;
-import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
/**
* Wrapper around the AS class to be able to cache attributes.
@@ -96,49 +87,49 @@ public class ObjyClass
return asClassName;
}
- public List<Class_Position> getListOfRefAttributes()
- {
- List<Class_Position> positions = new ArrayList<Class_Position>();
-
- System.out.println(">>> Class: " + asClassName);
-
- //
- @SuppressWarnings("rawtypes")
- Iterator itr = asClass.attributes_plus_inherited();
- while (itr.hasNext())
- {
- d_Attribute attribute = (d_Attribute)itr.next();
- if (attribute.is_type() && attribute.type_of() instanceof d_Ref_Type)
- {
- d_Class dClass = attribute.class_type_of();
- if (dClass.name().equals(ObjyFeatureMapArrayList.ClassName))
- {
- // we'll need to copy this one.
- positions.add(resolve_position(attribute.name()));
- System.out.println("\t attr: " + attribute.name());
- }
- else if (dClass.name().equals(ObjyArrayListString.ClassName))
- {
- // we'll need to copy this one.
- positions.add(resolve_position(attribute.name()));
- System.out.println("\t attr: " + attribute.name());
- }
- else if (dClass.name().equals(ObjyArrayListId.className))
- {
- // we'll need to copy this one.
- positions.add(resolve_position(attribute.name()));
- System.out.println("\t attr: " + attribute.name());
- }
- else if (dClass.name().equals(ObjyProxy.className))
- {
- // we'll need to copy this one.
- positions.add(resolve_position(attribute.name()));
- System.out.println("\t attr: " + attribute.name());
- }
- }
- }
-
- return positions;
- }
+ // public List<Class_Position> getListOfRefAttributes()
+ // {
+ // List<Class_Position> positions = new ArrayList<Class_Position>();
+ //
+ // System.out.println(">>> Class: " + asClassName);
+ //
+ // //
+ // @SuppressWarnings("rawtypes")
+ // Iterator itr = asClass.attributes_plus_inherited();
+ // while (itr.hasNext())
+ // {
+ // d_Attribute attribute = (d_Attribute)itr.next();
+ // if (attribute.is_type() && attribute.type_of() instanceof d_Ref_Type)
+ // {
+ // d_Class dClass = attribute.class_type_of();
+ // if (dClass.name().equals(ObjyFeatureMapArrayList.ClassName))
+ // {
+ // // we'll need to copy this one.
+ // positions.add(resolve_position(attribute.name()));
+ // System.out.println("\t attr: " + attribute.name());
+ // }
+ // else if (dClass.name().equals(ObjyArrayListString.ClassName))
+ // {
+ // // we'll need to copy this one.
+ // positions.add(resolve_position(attribute.name()));
+ // System.out.println("\t attr: " + attribute.name());
+ // }
+ // else if (dClass.name().equals(ObjyArrayListId.className))
+ // {
+ // // we'll need to copy this one.
+ // positions.add(resolve_position(attribute.name()));
+ // System.out.println("\t attr: " + attribute.name());
+ // }
+ // else if (dClass.name().equals(ObjyProxy.className))
+ // {
+ // // we'll need to copy this one.
+ // positions.add(resolve_position(attribute.name()));
+ // System.out.println("\t attr: " + attribute.name());
+ // }
+ // }
+ // }
+ //
+ // return positions;
+ // }
}
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyConnection.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyConnection.java
index d2928eb237..8ee32fce7a 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyConnection.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyConnection.java
@@ -82,8 +82,6 @@ public class ObjyConnection
/***
* Connect to a store and an FD. TODO - We might need to allow switching of FD in the future.
- *
- * @param fdName
*/
synchronized public void connect(IObjectivityStoreConfig storeConfig)
{
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyObject.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyObject.java
index 77d8857684..8d835ec092 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyObject.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyObject.java
@@ -11,13 +11,13 @@
package org.eclipse.emf.cdo.server.internal.objectivity.db;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDExternal;
import org.eclipse.emf.cdo.common.model.EMFUtil;
import org.eclipse.emf.cdo.common.revision.CDOList;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
+import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
import org.eclipse.emf.cdo.server.internal.objectivity.ObjectivityStoreAccessor;
import org.eclipse.emf.cdo.server.internal.objectivity.bundle.OM;
import org.eclipse.emf.cdo.server.internal.objectivity.mapper.IManyTypeMapper;
@@ -152,7 +152,7 @@ public class ObjyObject
// }
// }
setObjectId(classObject.objectID());
- version = classObject.get_numeric(objyClass.resolve_position(ObjyBase.ATT_VERSION)).intValue();
+ // version = classObject.get_numeric(objyClass.resolve_position(ObjyBase.ATT_VERSION)).intValue();
}
catch (RuntimeException ex)
{
@@ -167,7 +167,7 @@ public class ObjyObject
{
if (lastRevisionRel == null)
{
- lastRevisionRel = classObject.get_relationship(objyClass.resolve_position(ObjyBase.ATT_LAST_REVISION));
+ lastRevisionRel = classObject.nget_relationship(ObjyBase.ATT_LAST_REVISION);
}
return lastRevisionRel;
}
@@ -176,7 +176,8 @@ public class ObjyObject
{
if (revisionsRel == null)
{
- revisionsRel = classObject.get_relationship(objyClass.resolve_position(ObjyBase.ATT_REVISIONS));
+ // revisionsRel = classObject.get_relationship(objyClass.resolve_position(ObjyBase.ATT_REVISIONS));
+ revisionsRel = classObject.nget_relationship(ObjyBase.ATT_REVISIONS);
}
return revisionsRel;
}
@@ -185,7 +186,8 @@ public class ObjyObject
{
if (baseRel == null)
{
- baseRel = classObject.get_relationship(objyClass.resolve_position(ObjyBase.ATT_BASE));
+ // baseRel = classObject.get_relationship(objyClass.resolve_position(ObjyBase.ATT_BASE));
+ baseRel = classObject.nget_relationship(ObjyBase.ATT_BASE);
}
return baseRel;
}
@@ -338,9 +340,9 @@ public class ObjyObject
{
checkSession();
}
- if (version == Integer.MAX_VALUE)
+ // if (version == Integer.MAX_VALUE)
{
- version = classObject.get_numeric(objyClass.resolve_position(ObjyBase.ATT_VERSION)).intValue();
+ version = classObject.nget_numeric(ObjyBase.ATT_VERSION).intValue();
}
return version;
}
@@ -351,7 +353,7 @@ public class ObjyObject
{
checkSession();
}
- classObject.set_numeric(objyClass.resolve_position(ObjyBase.ATT_VERSION), new Numeric_Value(version));
+ classObject.nset_numeric(ObjyBase.ATT_VERSION, new Numeric_Value(version));
// getVersion(); // TBD, verify the need for this call!!!!
this.version = version;
}
@@ -362,7 +364,7 @@ public class ObjyObject
{
checkSession();
}
- long creationTime = classObject.get_numeric(objyClass.resolve_position(ObjyBase.ATT_CREATION_TIME)).longValue();
+ long creationTime = classObject.nget_numeric(ObjyBase.ATT_CREATION_TIME).longValue();
return creationTime;
}
@@ -372,7 +374,7 @@ public class ObjyObject
{
checkSession();
}
- classObject.set_numeric(objyClass.resolve_position(ObjyBase.ATT_CREATION_TIME), new Numeric_Value(creationTime));
+ classObject.nset_numeric(ObjyBase.ATT_CREATION_TIME, new Numeric_Value(creationTime));
}
public long getRevisedTime()
@@ -385,7 +387,7 @@ public class ObjyObject
{
checkSession();
}
- revisedTime = classObject.get_numeric(objyClass.resolve_position(ObjyBase.ATT_REVISED_TIME)).longValue();
+ revisedTime = classObject.nget_numeric(ObjyBase.ATT_REVISED_TIME).longValue();
}
catch (RuntimeException ex)
{
@@ -403,7 +405,7 @@ public class ObjyObject
{
checkSession();
}
- classObject.set_numeric(objyClass.resolve_position(ObjyBase.ATT_REVISED_TIME), new Numeric_Value(revisedTime));
+ classObject.nset_numeric(ObjyBase.ATT_REVISED_TIME, new Numeric_Value(revisedTime));
}
catch (RuntimeException ex)
{
@@ -419,7 +421,7 @@ public class ObjyObject
{
checkSession();
}
- classObject.set_numeric(objyClass.resolve_position(ObjyBase.ATT_BRANCHID), new Numeric_Value(branchId));
+ classObject.nset_numeric(ObjyBase.ATT_BRANCHID, new Numeric_Value(branchId));
}
catch (RuntimeException ex)
{
@@ -437,7 +439,7 @@ public class ObjyObject
{
checkSession();
}
- branchId = classObject.get_numeric(objyClass.resolve_position(ObjyBase.ATT_BRANCHID)).intValue();
+ branchId = classObject.nget_numeric(ObjyBase.ATT_BRANCHID).intValue();
}
catch (RuntimeException ex)
{
@@ -625,7 +627,8 @@ public class ObjyObject
}
else if (value instanceof CDOIDExternal)
{
- TRACER_DEBUG.trace("... CDOIDExternal inserted, at:" + i + ", content:" + ((CDOIDExternal)value).getURI());
+ TRACER_DEBUG
+ .trace("... CDOIDExternal inserted, at:" + i + ", content:" + ((CDOIDExternal)value).getURI());
// System.out.println("value is a proxy object - it should be handled by the mapper.");
// create an ObjyProxy object to hold the the value.
ObjyProxy proxyObject = ObjyProxy.createObject(ooId());
@@ -1532,6 +1535,21 @@ public class ObjyObject
return OBJYCDOIDUtil.getCDOID(revisionId);
}
+ public ObjyObject getBaseObject()
+ {
+ ObjyObject objyObject = null;
+ if (hasBaseRelationship())
+ {
+ baseClassObject = getBaseRelationship().get_class_obj();
+ objyObject = new ObjyObject(baseClassObject);
+ }
+ else
+ {
+ objyObject = this;
+ }
+ return objyObject;
+ }
+
private boolean hasBaseRelationship()
{
if (!hasBaseRelationshipChecked)
@@ -1567,20 +1585,18 @@ public class ObjyObject
public ObjyObject getRevision(long timeStamp, int branchId, ObjyObjectManager objyObjectManager)
{
ObjyObject objyRevision = null;
- // Session.getCurrent().setReturn_Class_Object(true);
- // int numRevisions = (int) revisions.size();
- // evaluate current first.
- if (evaluateRevision(timeStamp, branchId, this))
- {
- return this;
- }
-
- // if we don't have other revisions.
- if (!getLastRevisionRelationship().exists())
- {
- return null;
- }
+ // // evaluate current first.
+ // if (evaluateRevision(timeStamp, branchId, this))
+ // {
+ // return this;
+ // }
+ //
+ // // if we don't have other revisions.
+ // if (!getLastRevisionRelationship().exists())
+ // {
+ // return null;
+ // }
// check last revision first.
objyRevision = getLastRevision(objyObjectManager);
@@ -1589,6 +1605,14 @@ public class ObjyObject
return objyRevision;
}
+ ObjyObject possibleRevision = null;
+
+ // check first revision.
+ if (evaluateRevision(timeStamp, branchId, this))
+ {
+ possibleRevision = this;
+ }
+
@SuppressWarnings("unchecked")
Iterator<ooObj> itr = getRevisionsRelationship().get_iterator();
while (itr.hasNext())
@@ -1597,11 +1621,11 @@ public class ObjyObject
objyRevision = objyObjectManager.getObject(itr.next().getOid());
if (evaluateRevision(timeStamp, branchId, objyRevision))
{
- return objyRevision;
+ possibleRevision = objyRevision;
}
}
- return null;
+ return possibleRevision;
}
/**
@@ -1613,16 +1637,24 @@ public class ObjyObject
// check the branchId first.
if (objyRevision.getBranchId() == branchId)
{
+ // long revisedTS = objyRevision.getRevisedTime();
+ // if (timeStamp != CDOBranchPoint.UNSPECIFIED_DATE)
+ // {
+ // long creationTS = objyRevision.getCreationTime();
+ // if (creationTS <= timeStamp && (revisedTS == CDOBranchPoint.UNSPECIFIED_DATE || revisedTS >= timeStamp))
+ // // if (creationTS >= timeStamp && (revisedTS == CDOBranchPoint.UNSPECIFIED_DATE || revisedTS <= timeStamp))
+ // {
+ // return true;
+ // }
+ // }
+ // else if (revisedTS == CDOBranchPoint.UNSPECIFIED_DATE) // return the latest version in that branch.
+ // {
+ // return true;
+ // }
+
+ long creationTS = objyRevision.getCreationTime();
long revisedTS = objyRevision.getRevisedTime();
- if (timeStamp != CDOBranchPoint.UNSPECIFIED_DATE)
- {
- long creationTS = objyRevision.getCreationTime();
- if (creationTS <= timeStamp && (revisedTS == CDOBranchPoint.UNSPECIFIED_DATE || revisedTS >= timeStamp))
- {
- return true;
- }
- }
- else if (revisedTS == CDOBranchPoint.UNSPECIFIED_DATE) // return the latest version in that branch.
+ if (CDOCommonUtil.isValidTimeStamp(timeStamp, creationTS, revisedTS))
{
return true;
}
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyObjectManager.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyObjectManager.java
index 3580b8d3c0..382fb44634 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyObjectManager.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjyObjectManager.java
@@ -82,7 +82,7 @@ public class ObjyObjectManager
Class_Object newClassObject = newClassObject(eClass, nearObject);
ObjyObject objyObject = new ObjyObject(newClassObject);
- idToObjyObjectMap.put(OBJYCDOIDUtil.getLong(objyObject.ooId()), objyObject);
+ // idToObjyObjectMap.put(OBJYCDOIDUtil.getLong(objyObject.ooId()), objyObject);
if (TRACER_DEBUG.isEnabled())
{
newObjCount++;
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjySession.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjySession.java
index 4d9fb61eb9..c51eebd2d6 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjySession.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/db/ObjySession.java
@@ -32,8 +32,6 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public class ObjySession extends Session
{
- private static final ContextTracer TRACER_DEBUG = new ContextTracer(OM.DEBUG, ObjySession.class);
-
private static final ContextTracer TRACER_INFO = new ContextTracer(OM.INFO, ObjySession.class);
private ObjyObjectManager objectManger = null;
@@ -44,8 +42,6 @@ public class ObjySession extends Session
private ObjyLockAreaManager lockAreaManager = null;
- // private ObjectivityStore store = null;
-
protected String sessionName;
protected ConcurrentHashMap<String, ObjySession> sessionPool;
@@ -60,7 +56,6 @@ public class ObjySession extends Session
setIndexMode(oo.EXPLICIT_UPDATE);
sessionName = name;
sessionPool = pool;
- // this.store = store;
objectManger = new ObjyObjectManager(objyConnection.getDefaultPlacementManager());
}
@@ -125,7 +120,6 @@ public class ObjySession extends Session
public synchronized void returnSessionToPool()
{
// System.out.println(">>> IS: returning session: " + session.getName());
- // TODO Auto-generated method stub
leave();
setAvailable(true);
}
@@ -174,7 +168,6 @@ public class ObjySession extends Session
if (!isOpen())
{
TRACER_INFO.trace("Objy session is not open");
- // System.exit(-1); // TODO - this is temporary for debugging...
}
try
{
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/BasicTypeMapper.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/BasicTypeMapper.java
index 7b2ed0f73d..2410537175 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/BasicTypeMapper.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/BasicTypeMapper.java
@@ -13,12 +13,8 @@ package org.eclipse.emf.cdo.server.internal.objectivity.mapper;
//import org.eclipse.emf.cdo.server.internal.objectivity.bundle.OM;
//import org.eclipse.net4j.util.om.trace.ContextTracer;
-import org.eclipse.emf.cdo.server.internal.objectivity.db.ObjyObject;
-
import org.eclipse.emf.ecore.EStructuralFeature;
-import com.objy.as.app.Class_Position;
-
/**
* mapping between Objy AS class/type and EMF types.
*
@@ -40,15 +36,15 @@ public abstract class BasicTypeMapper
return feature.getName() + "_isNull";
}
- protected Class_Position getAttributePosition(ObjyObject objyObject, EStructuralFeature feature)
- {
- return objyObject.objyClass().resolve_position(getAttributeName(feature));
- }
+ // protected Class_Position getAttributePosition(ObjyObject objyObject, EStructuralFeature feature)
+ // {
+ // return objyObject.objyClass().resolve_position(getAttributeName(feature));
+ // }
- protected Class_Position getNullAttributePosition(ObjyObject objyObject, EStructuralFeature feature)
- {
- return objyObject.objyClass().resolve_position(getNullAttributeName(feature));
- }
+ // protected Class_Position getNullAttributePosition(ObjyObject objyObject, EStructuralFeature feature)
+ // {
+ // return objyObject.objyClass().resolve_position(getNullAttributeName(feature));
+ // }
// ---------------------------------
// Object
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/BigIntegerTypeMapper.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/BigIntegerTypeMapper.java
index a2f91bce9b..ed38fd8fdf 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/BigIntegerTypeMapper.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/BigIntegerTypeMapper.java
@@ -16,7 +16,6 @@ import org.eclipse.emf.cdo.server.internal.objectivity.db.ObjyObject;
import org.eclipse.emf.ecore.EStructuralFeature;
-import com.objy.as.app.Class_Position;
import com.objy.as.app.Numeric_Value;
import com.objy.as.app.Proposed_Class;
import com.objy.as.app.String_Value;
@@ -59,7 +58,6 @@ public class BigIntegerTypeMapper extends StringTypeMapper
@Override
public void setValue(ObjyObject objyObject, EStructuralFeature feature, Object newValue)
{
- // Class_Position nullPosition = getNullAttributePosition(objyObject, feature);
String nullAttributeName = getNullAttributeName(feature);
boolean isNull = newValue == null || newValue == CDORevisionData.NIL;
@@ -67,7 +65,6 @@ public class BigIntegerTypeMapper extends StringTypeMapper
if (!isNull)
{
- Class_Position position = getAttributePosition(objyObject, feature);
String attributeName = getAttributeName(feature);
String_Value stringValue = objyObject.get_string(attributeName/* position */);
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/ByteArrayTypeMapper.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/ByteArrayTypeMapper.java
index fd8c9d9d42..88951fffb3 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/ByteArrayTypeMapper.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/ByteArrayTypeMapper.java
@@ -19,7 +19,6 @@ import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.emf.ecore.EStructuralFeature;
import com.objy.as.app.Class_Object;
-import com.objy.as.app.Class_Position;
import com.objy.as.app.Numeric_Value;
import com.objy.as.app.Proposed_Class;
import com.objy.as.app.VArray_Object;
@@ -169,8 +168,8 @@ public class ByteArrayTypeMapper extends BasicTypeMapper implements ISingleTypeM
// TODO Auto-generated method stub
// throw new UnsupportedOperationException("Implement me!!");
// at least rest the varray...
- Class_Position position = classObject.type_of().position_in_class(feature.getName());
- VArray_Object vArray = classObject.get_varray(position);
+ // Class_Position position = classObject.type_of().position_in_class(feature.getName());
+ VArray_Object vArray = classObject.nget_varray(feature.getName());
vArray.resize(0);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/FeatureMapTypeMapper.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/FeatureMapTypeMapper.java
index bf876a4588..07e093ad86 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/FeatureMapTypeMapper.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/FeatureMapTypeMapper.java
@@ -20,7 +20,6 @@ import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyFeatureMapEntr
import org.eclipse.emf.ecore.EStructuralFeature;
import com.objy.as.app.Class_Object;
-import com.objy.as.app.Class_Position;
import com.objy.as.app.Proposed_Class;
import com.objy.as.app.d_Access_Kind;
import com.objy.as.app.d_Attribute;
@@ -109,8 +108,8 @@ public class FeatureMapTypeMapper extends BasicTypeMapper implements IManyTypeMa
// {
// ObjyObjectManager.newInternalObjCount++;
// }
- Class_Position position = classObject.type_of().position_in_class(getAttributeName(feature));
- classObject.set_ooId(position, newClassObject.objectID());
+ // Class_Position position = classObject.type_of().position_in_class(getAttributeName(feature));
+ classObject.nset_ooId(getAttributeName(feature), newClassObject.objectID());
// initialize the list structure.
ObjyFeatureMapArrayList.initObject(newClassObject);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/ManyReferenceMapper.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/ManyReferenceMapper.java
index b13f6bae08..087da1bd66 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/ManyReferenceMapper.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/ManyReferenceMapper.java
@@ -20,7 +20,6 @@ import org.eclipse.emf.cdo.server.internal.objectivity.utils.TypeConvert;
import org.eclipse.emf.ecore.EStructuralFeature;
import com.objy.as.app.Class_Object;
-import com.objy.as.app.Class_Position;
import com.objy.as.app.Proposed_Class;
import com.objy.as.app.d_Access_Kind;
import com.objy.as.app.d_Attribute;
@@ -39,6 +38,7 @@ public class ManyReferenceMapper extends BasicTypeMapper implements IManyTypeMap
static ManyReferenceMapper INSTANCE = new ManyReferenceMapper();
+ @SuppressWarnings("unused")
private static d_Class getArrayListClass()
{
if (dClassObject == null)
@@ -200,14 +200,14 @@ public class ManyReferenceMapper extends BasicTypeMapper implements IManyTypeMap
public void initialize(Class_Object classObject, EStructuralFeature feature)
{
- Class_Position position = classObject.position_in_class(getAttributeName(feature));
+ // Class_Position position = classObject.position_in_class(getAttributeName(feature));
// Class_Object newClassObject = Class_Object
// .new_persistent_object(getArrayListClass(), classObject.objectID(), false);
ooTreeListX list = new ooTreeListX(2, false);
// ObjyObjectManager.newInternalObjCount++;
ooObj anObj = ooObj.create_ooObj(classObject.objectID());
anObj.cluster(list);
- classObject.set_ooId(position, list.getOid());
+ classObject.nset_ooId(getAttributeName(feature), list.getOid());
// classObject.set_ooId(position, newClassObject.objectID());
// ObjyArrayListId.initObject(newClassObject);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/StringManyTypeMapper.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/StringManyTypeMapper.java
index cfa7c7fb43..38ccfe092f 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/StringManyTypeMapper.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/StringManyTypeMapper.java
@@ -19,7 +19,6 @@ import org.eclipse.emf.cdo.server.internal.objectivity.schema.ObjyArrayListStrin
import org.eclipse.emf.ecore.EStructuralFeature;
import com.objy.as.app.Class_Object;
-import com.objy.as.app.Class_Position;
import com.objy.as.app.Proposed_Class;
import com.objy.as.app.d_Access_Kind;
import com.objy.as.app.d_Attribute;
@@ -171,11 +170,11 @@ public class StringManyTypeMapper extends BasicTypeMapper implements IManyTypeMa
public void initialize(Class_Object classObject, EStructuralFeature feature)
{
- Class_Position position = classObject.type_of().position_in_class(getAttributeName(feature));
+ // Class_Position position = classObject.type_of().position_in_class(getAttributeName(feature));
Class_Object newClassObject = Class_Object.new_persistent_object(
ObjySchema.getObjyClass(ObjyArrayListString.ClassName).getASClass(), classObject.objectID(), false);
// ObjyObjectManager.newInternalObjCount++;
- classObject.set_ooId(position, newClassObject.objectID());
+ classObject.nset_ooId(getAttributeName(feature), newClassObject.objectID());
ObjyArrayListString.initObject(newClassObject);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/StringTypeMapper.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/StringTypeMapper.java
index e78669f365..4a1dfb6c86 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/StringTypeMapper.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/mapper/StringTypeMapper.java
@@ -17,7 +17,6 @@ import org.eclipse.emf.cdo.server.internal.objectivity.db.ObjyObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import com.objy.as.app.Class_Object;
-import com.objy.as.app.Class_Position;
import com.objy.as.app.Numeric_Value;
import com.objy.as.app.Proposed_Class;
import com.objy.as.app.String_Value;
@@ -118,8 +117,8 @@ public class StringTypeMapper extends BasicTypeMapper implements ISingleTypeMapp
public void initialize(Class_Object classObject, EStructuralFeature feature)
{
- Class_Position position = classObject.type_of().position_in_class(getNullAttributeName(feature));
- classObject.set_numeric(position, numericTrue);
+ // Class_Position position = classObject.type_of().position_in_class(getNullAttributeName(feature));
+ classObject.nset_numeric(getNullAttributeName(feature), numericTrue);
}
public void modifySchema(Proposed_Class proposedooClass, EStructuralFeature feature)
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyArrayListId.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyArrayListId.java
index b6ffdef2b7..266c15bd28 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyArrayListId.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyArrayListId.java
@@ -12,13 +12,9 @@
package org.eclipse.emf.cdo.server.internal.objectivity.schema;
import org.eclipse.emf.cdo.common.revision.CDORevision;
-import org.eclipse.emf.cdo.server.internal.objectivity.bundle.OM;
-
-import org.eclipse.net4j.util.om.trace.ContextTracer;
import com.objy.as.app.Class_Object;
import com.objy.db.app.Session;
-import com.objy.db.app.ooFDObj;
import com.objy.db.app.ooId;
import com.objy.db.app.ooObj;
import com.objy.db.util.ooTreeListX;
@@ -34,12 +30,8 @@ import java.util.List;
public class ObjyArrayListId
{
- private static final ContextTracer TRACER_DEBUG = new ContextTracer(OM.DEBUG, ObjyArrayListId.class);
-
static public String className = "ooTreeListX";
- private Class_Object classObject = null;
-
private ooTreeListX list = null;
// private int size = 0;
@@ -105,12 +97,9 @@ public class ObjyArrayListId
public ObjyArrayListId(Class_Object classObject)
{
- this.classObject = classObject;
// get the ooTreeList object.
- // ooId listId = classObject.nget_ooId(ObjyArrayList.arrayName);
ooId listId = classObject.objectID();
list = (ooTreeListX)Session.getCurrent().getFD().objectFrom(listId);
- // size = (int)classObject.nget_numeric(ObjyArrayList.sizeName).longValue();
}
protected void setValue(long index, ooObj newValue)
@@ -189,7 +178,6 @@ public class ObjyArrayListId
public void addAll(int index, Object[] newValue)
{
List<Object> objList = new ArrayList<Object>();
- ooFDObj fdObj = Session.getCurrent().getFD();
for (int i = 0; i < newValue.length; i++)
{
objList.add(ooObj.create_ooObj((ooId)newValue[i]));
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyBranchManager.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyBranchManager.java
index 058b5d920f..c5ae86bec2 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyBranchManager.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyBranchManager.java
@@ -187,12 +187,11 @@ public class ObjyBranchManager extends ooObj
fetch();
List<ObjyBranch> objyBranchList = new ArrayList<ObjyBranch>();
- @SuppressWarnings("unchecked")
- Iterator<ObjyBranch> treeItr = branchSet.iterator();
+ Iterator<?> treeItr = branchSet.iterator();
ObjyBranch objyBranch = null;
while (treeItr.hasNext())
{
- objyBranch = treeItr.next();
+ objyBranch = (ObjyBranch)treeItr.next();
if (objyBranch.getBranchId() == objyBranch.getBaseBranchId())
{
continue;
diff --git a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyResourceList.java b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyResourceList.java
index d2ed2c4ef3..371cc7931c 100644
--- a/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyResourceList.java
+++ b/plugins/org.eclipse.emf.cdo.server.objectivity/src/org/eclipse/emf/cdo/server/internal/objectivity/schema/ObjyResourceList.java
@@ -26,7 +26,6 @@ import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.emf.ecore.EStructuralFeature;
import com.objy.as.app.Class_Object;
-import com.objy.as.app.Class_Position;
import com.objy.as.app.Proposed_Class;
import com.objy.as.app.d_Access_Kind;
import com.objy.as.app.d_Module;
@@ -124,8 +123,8 @@ public class ObjyResourceList
try
{
- Class_Position position = classObject.position_in_class(ObjyResourceList.Attribute_arrayName);
- ooId oid = classObject.get_ooId(position);
+ // Class_Position position = classObject.position_in_class(ObjyResourceList.Attribute_arrayName);
+ ooId oid = classObject.nget_ooId(ObjyResourceList.Attribute_arrayName);
if (!oid.isNull())
{
list = new ObjyArrayListId(Class_Object.class_object_from_oid(oid));
@@ -244,7 +243,7 @@ public class ObjyResourceList
Class_Object classObject = Class_Object.new_persistent_object(ObjySchema.getObjyClass(ObjyResourceList.className)
.getASClass(), nearOid, false);
// ObjyObjectManager.newInternalObjCount++;
- Class_Position position = classObject.position_in_class(ObjyResourceList.Attribute_arrayName);
+ // Class_Position position = classObject.position_in_class(ObjyResourceList.Attribute_arrayName);
// Class_Object arrayClassObject = Class_Object.new_persistent_object(
// ObjySchema.getTopModule().resolve_class(ObjyArrayListId.className), classObject.objectID(), false);
// // ooId arrayOid = arrayClassObject.objectID();
@@ -254,7 +253,7 @@ public class ObjyResourceList
anObj.cluster(list);
// System.out.println("initObject: " + anObj.getOid().getStoreString() + " treeListX: "
// // + list.getOid().getStoreString());
- classObject.set_ooId(position, list.getOid());
+ classObject.nset_ooId(ObjyResourceList.Attribute_arrayName, list.getOid());
// classObject.set_ooId(position, arrayClassObject.objectID());
// ObjyArrayListId.initObject(arrayClassObject);

Back to the top