public virtual NeoDatis.Btree.IBTree LoadBTree(object id)
 {
     nbLoadTree++;
     NeoDatis.Odb.OID oid = (NeoDatis.Odb.OID)id;
     try
     {
         if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
         {
             NeoDatis.Tool.DLogger.Debug("Loading btree with id " + oid);
         }
         if (oid == NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant.NullObjectId)
         {
             throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Btree.BTreeError.InvalidIdForBtree
                                                        .AddParameter(NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant.
                                                                      NullObjectId));
         }
         tree = (NeoDatis.Btree.IBTree)engine.GetObjectFromOid(oid);
         tree.SetId(oid);
         tree.SetPersister(this);
         NeoDatis.Btree.IBTreeNode root = tree.GetRoot();
         root.SetBTree(tree);
         return(tree);
     }
     catch (System.Exception e)
     {
         throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Btree.BTreeError.InternalError
                                                    , e);
     }
 }
 public virtual NeoDatis.Odb.OID SaveBTree(NeoDatis.Btree.IBTree treeToSave)
 {
     nbSaveTree++;
     try
     {
         NeoDatis.Odb.OID oid = (NeoDatis.Odb.OID)treeToSave.GetId();
         if (oid == null)
         {
             // first get the oid. -2 : it could be any value
             oid = engine.GetObjectWriter().GetIdManager().GetNextObjectId(-2);
             treeToSave.SetId(oid);
             oid = engine.Store(oid, treeToSave);
             if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
             {
                 NeoDatis.Tool.DLogger.Debug("Saved btree " + treeToSave.GetId() + " with id " + oid
                                             + " and  root " + treeToSave.GetRoot());
             }
             if (this.tree == null)
             {
                 this.tree = treeToSave;
             }
             oids.Add(oid, treeToSave);
         }
         else
         {
             oids.Add(oid, treeToSave);
             AddModifiedOid(oid);
         }
         return(oid);
     }
     catch (System.Exception e)
     {
         throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Btree.BTreeError.InternalError
                                                    , e);
     }
 }
		public virtual NeoDatis.Btree.IBTree LoadBTree(object id)
		{
			nbLoadTree++;
			NeoDatis.Odb.OID oid = (NeoDatis.Odb.OID)id;
			try
			{
				if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
				{
					NeoDatis.Tool.DLogger.Debug("Loading btree with id " + oid);
				}
				if (oid == NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant.NullObjectId)
				{
					throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Btree.BTreeError.InvalidIdForBtree
						.AddParameter(NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant.
						NullObjectId));
				}
				tree = (NeoDatis.Btree.IBTree)engine.GetObjectFromOid(oid);
				tree.SetId(oid);
				tree.SetPersister(this);
				NeoDatis.Btree.IBTreeNode root = tree.GetRoot();
				root.SetBTree(tree);
				return tree;
			}
			catch (System.Exception e)
			{
				throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Btree.BTreeError.InternalError
					, e);
			}
		}