}
}
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");