Exemple #1
0
  /** @since 4.0 */
  protected void readSystemValues(CDODataInput in) throws IOException {
    EClassifier classifier = in.readCDOClassifierRefAndResolve();
    initClassInfo((EClass) classifier);

    id = in.readCDOID();
    branchPoint = in.readCDOBranchPoint();
    version = in.readInt();
    if (!id.isTemporary()) {
      revised = in.readLong();
    }

    resourceID = in.readCDOID();
    containerID = in.readCDOID();
    containingFeatureID = in.readInt();

    if (TRACER.isEnabled()) {
      TRACER.format(
          "Reading revision: ID={0}, className={1}, version={2}, branchPoint={3}, revised={4}, resource={5}, container={6}, featureID={7}", //$NON-NLS-1$
          id,
          getEClass().getName(),
          version,
          branchPoint,
          revised,
          resourceID,
          containerID,
          containingFeatureID);
    }
  }
Exemple #2
0
  /** @since 4.0 */
  protected void writeSystemValues(CDODataOutput out) throws IOException {
    EClass eClass = getEClass();
    CDOClassifierRef classRef = new CDOClassifierRef(eClass);

    if (TRACER.isEnabled()) {
      TRACER.format(
          "Writing revision: ID={0}, className={1}, version={2}, branchPoint={3}, revised={4}, resource={5}, container={6}, featureID={7}", //$NON-NLS-1$
          id,
          eClass.getName(),
          getVersion(),
          branchPoint,
          revised,
          resourceID,
          containerID,
          containingFeatureID);
    }

    out.writeCDOClassifierRef(classRef);
    out.writeCDOID(id);
    out.writeCDOBranchPoint(branchPoint);
    out.writeInt(getVersion());
    if (!id.isTemporary()) {
      out.writeLong(revised);
    }

    out.writeCDOID(resourceID);
    out.writeCDOID(out.getIDProvider().provideCDOID(containerID));
    out.writeInt(containingFeatureID);
  }
  protected ooId getOidFromCDOID(CDOID id) {
    ooId oid = null;

    // if (OBJYCDOIDUtil.isValidObjyId(id))
    // oid = OBJYCDOIDUtil.getooId(id);

    if (id.isTemporary()) {
      // see if we've seen it before
      CDOID nearId = idMapper.get(id);
      if (nearId != null) {
        oid = OBJYCDOIDUtil.getooId(nearId);
      } else {
        // create that object since it wasn't created and mapped yet.
        InternalCDORevision containerRevision = newObjectsMap.get(id);
        if (containerRevision != null) {
          oid = createObjectAndAddToMapping(containerRevision).ooId();
        }
      }
    } else {
      oid = OBJYCDOIDUtil.getooId(id);
    }

    return oid;
  }