Package org.persvr.datasource.JavaScriptDB

Examples of org.persvr.datasource.JavaScriptDB.IndexTraverser


    }
  }
 
  public void mapObject(PersistableInitializer initializer, String objectId) throws Exception{
    boolean subObject = objectId.indexOf('-') > -1 && ("Array".equals(getId()) || "Object".equals(getId()));
    IndexTraverser traverser = getDatabase().getTraverserForTable(
        subObject ? getDatabase().internedStrings.get(getDatabase().convertIdToInternalObject(ObjectId.idForObject(this, objectId)).tableId) :
          getId(), "id");
    if(subObject){
      objectId = objectId.substring(objectId.indexOf('-') + 1);
    }
    int version = -1;
    Object noVersionObjectId = objectId;

    if(objectId.indexOf("-v") > 0){
      version = Integer.parseInt(objectId.substring(objectId.indexOf("-v") + 2));
      noVersionObjectId = objectId.substring(0, objectId.indexOf("-v"));
    }
    try{
      noVersionObjectId = Long.parseLong((String) noVersionObjectId);
    }catch(NumberFormatException e){
    }
    traverser.minKey = noVersionObjectId;
    traverser.maxKey = noVersionObjectId;
    Persistable object;
    // this should trigger the loading of the object
    if((object = (Persistable) traverser.nextObject()) == null){
      throw new ObjectNotFoundException(this, objectId);
    }
    //FIXME: remove this
/*    if((Persistable) traverser.nextObject() != null){
      throw new IllegalStateException("shouldn't be duplicate ids");
View Full Code Here


                  throw new QueryCantBeHandled("unknown value type");
              }
            } catch (RuntimeException e) {
              throw new QueryCantBeHandled("not valid structure");
            }
            IndexTraverser traverser = getDatabase().getTraverserForTable(table, property);
            switch(expression.getType()){   
              case Token.SHNE:
              case Token.NE:
              case Token.SHEQ:
              case Token.EQ:
View Full Code Here

TOP

Related Classes of org.persvr.datasource.JavaScriptDB.IndexTraverser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.