public virtual NeoDatis.Odb.Core.IError AddParameter(object o) { if (parameters == null) { parameters = new NeoDatis.Tool.Wrappers.List.OdbArrayList <object>(); } parameters.Add(o.ToString()); return(this); }
public DefaultWriteAction(long position, byte[] bytes, string label) { this.byteArrayConverter = NeoDatis.Odb.OdbConfiguration.GetCoreProvider().GetByteArrayConverter (); this.position = position; //TODO:perf should init with no default size? listOfBytes = new NeoDatis.Tool.Wrappers.List.OdbArrayList<byte[]>(20); if (bytes != null) { listOfBytes.Add(bytes); this.size = bytes.Length; } }
public DefaultWriteAction(long position, byte[] bytes, string label) { this.byteArrayConverter = NeoDatis.Odb.OdbConfiguration.GetCoreProvider().GetByteArrayConverter (); this.position = position; //TODO:perf should init with no default size? listOfBytes = new NeoDatis.Tool.Wrappers.List.OdbArrayList <byte[]>(20); if (bytes != null) { listOfBytes.Add(bytes); this.size = bytes.Length; } }
public virtual void AddClass(NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo classInfo ) { if (classInfo.IsSystemClass()) { rapidAccessForSystemClassesByName.Add(classInfo.GetFullClassName(), classInfo); } else { rapidAccessForUserClassesByName.Add(classInfo.GetFullClassName(), classInfo); } rapidAccessForClassesByOid.Add(classInfo.GetId(), classInfo); allClassInfos.Add(classInfo); }
protected virtual void AddModifiedOid(NeoDatis.Odb.OID oid) { object o = modifiedObjectOids[oid]; if (o != null) { // Object is already in the list return; } modifiedObjectOidList.Add(oid); // Keep the position of the oid in the list as the value of the map. // Used for the delete. modifiedObjectOids.Add(oid, modifiedObjectOidList.Count - 1); }
/// <summary>Adds a write action to the transaction</summary> /// <param name="writeAction">The write action to be added</param> /// <param name="persistWriteAcion">To indicate if write action must be persisted</param> public virtual void AddWriteAction(NeoDatis.Odb.Core.Transaction.IWriteAction writeAction , bool persistWriteAcion) { if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId)) { NeoDatis.Tool.DLogger.Info("Adding WA in Transaction of session " + session.GetId ()); } if (writeAction.IsEmpty()) { return; } CheckRollback(); if (!hasBeenPersisted && persistWriteAcion) { Persist(); } if (persistWriteAcion) { writeAction.Persist(fsi, numberOfWriteActions + 1); } // Only adds the writeaction to the list if the transaction keeps all in // memory if (hasAllWriteActionsInMemory) { writeActions.Add(writeAction); } numberOfWriteActions++; if (hasAllWriteActionsInMemory && numberOfWriteActions > NeoDatis.Odb.OdbConfiguration .GetMaxNumberOfWriteObjectPerTransaction()) { hasAllWriteActionsInMemory = false; System.Collections.IEnumerator iterator = writeActions.GetEnumerator(); NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction wa = null; while (iterator.MoveNext()) { wa = (NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction)iterator.Current; wa.Clear(); } writeActions.Clear(); if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId)) { NeoDatis.Tool.DLogger.Info("Number of objects has exceeded the max number " + numberOfWriteActions + "/" + NeoDatis.Odb.OdbConfiguration.GetMaxNumberOfWriteObjectPerTransaction() + ": switching to persistent transaction managment"); } } }
public override NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo BuildNnoi (object o, NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo info, NeoDatis.Odb.Core.Layers.Layer2.Meta.AbstractObjectInfo [] values, long[] attributesIdentification, int[] attributeIds, System.Collections.Generic.IDictionary <object, NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo> alreadyReadObjects ) { NeoDatis.Odb.Core.Server.Layers.Layer2.Meta.ClientNonNativeObjectInfo cnnoi = new NeoDatis.Odb.Core.Server.Layers.Layer2.Meta.ClientNonNativeObjectInfo(null, info , values, attributesIdentification, attributeIds); cnnoi.SetLocalOid(NeoDatis.Odb.Core.Oid.OIDFactory.BuildObjectOID(alreadyReadObjects .Count + 1)); NeoDatis.Odb.OID id = cnnoi.GetLocalOid(); NeoDatis.Odb.Core.Transaction.ICache cache = GetSession().GetCache(); // Check if object is in the cache, if so sets its id NeoDatis.Odb.OID oid = cache.GetOid(o, false); if (oid != null) { cnnoi.SetOid(oid); } clientOids.Add(id); aois.Add(id, cnnoi); objects.Add(id, o); return(cnnoi); }
public virtual void AddBytes(byte[] bytes) { listOfBytes.Add(bytes); size += bytes.Length; }
public virtual void AddIncompatibleChange(string o) { incompatibleChanges.Add(o); }
public virtual NeoDatis.Odb.Core.Query.IValuesQuery Count(string alias) { objectActions.Add(new NeoDatis.Odb.Impl.Core.Query.Values.CountAction(alias)); return(this); }
public virtual NeoDatis.Odb.Core.Query.Criteria.ComposedExpression Add(NeoDatis.Odb.Core.Query.Criteria.ICriterion criterion) { criteria.Add(criterion); return(this); }