Ejemplo n.º 1
0
  protected boolean handleSpecialObjects(String name, BSONObject o) {

    if (o == null) return false;

    if (o instanceof DBCollection) {
      DBCollection c = (DBCollection) o;
      putDBPointer(name, c.getName(), Bytes.COLLECTION_REF_ID);
      return true;
    }

    if (name != null && o instanceof DBPointer) {
      DBPointer r = (DBPointer) o;
      putDBPointer(name, r._ns, (ObjectId) r._id);
      return true;
    }

    return false;
  }
Ejemplo n.º 2
0
  protected boolean putSpecial(String name, Object val) {
    if (val instanceof DBPointer) {
      DBPointer r = (DBPointer) val;
      putDBPointer(name, r._ns, (ObjectId) r._id);
      return true;
    }

    if (val instanceof DBRefBase) {
      putDBRef(name, (DBRefBase) val);
      return true;
    }

    return false;
  }