本文整理汇总了C#中NeoDatis.GetNumberOfObjects方法的典型用法代码示例。如果您正苦于以下问题:C# NeoDatis.GetNumberOfObjects方法的具体用法?C# NeoDatis.GetNumberOfObjects怎么用?C# NeoDatis.GetNumberOfObjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NeoDatis
的用法示例。
在下文中一共展示了NeoDatis.GetNumberOfObjects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
/// <summary>Shift all unconnected infos to connected (committed) infos</summary>
/// <param name="classInfo"></param>
/// <returns>The updated class info</returns>
public virtual NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo BuildClassInfoForCommit
(NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo classInfo)
{
long nbObjects = classInfo.GetNumberOfObjects();
classInfo.GetCommitedZoneInfo().SetNbObjects(nbObjects);
if (classInfo.GetCommitedZoneInfo().first != null)
{
}
else
{
// nothing to change
classInfo.GetCommitedZoneInfo().first = classInfo.GetUncommittedZoneInfo().first;
}
if (classInfo.GetUncommittedZoneInfo().last != null)
{
classInfo.GetCommitedZoneInfo().last = classInfo.GetUncommittedZoneInfo().last;
}
// Resets the unconnected zone info
classInfo.GetUncommittedZoneInfo().Set(new NeoDatis.Odb.Core.Layers.Layer2.Meta.CIZoneInfo
(classInfo, null, null, 0));
return classInfo;
}
示例2: UpdateInstanceFieldsOfClassInfo
/// <summary>
/// Updates the instance related field of the class info into the database
/// file Updates the number of objects, the first object oid and the next
/// class oid
/// </summary>
/// <param name="classInfo">The class info to be updated</param>
/// <param name="writeInTransaction">To specify if it must be part of a transaction @
/// </param>
public virtual void UpdateInstanceFieldsOfClassInfo(NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo
classInfo, bool writeInTransaction)
{
long currentPosition = fsi.GetPosition();
if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogIdDebug))
{
NeoDatis.Tool.DLogger.Debug(DepthToSpaces() + "Start of updateInstanceFieldsOfClassInfo for "
+ classInfo.GetFullClassName());
}
long position = classInfo.GetPosition() + NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant
.ClassOffsetClassNbObjects;
fsi.SetWritePosition(position, writeInTransaction);
long nbObjects = classInfo.GetNumberOfObjects();
fsi.WriteLong(nbObjects, writeInTransaction, "class info update nb objects", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
.PointerWriteAction);
WriteOid(classInfo.GetCommitedZoneInfo().first, writeInTransaction, "class info update first obj oid"
, NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction.PointerWriteAction);
WriteOid(classInfo.GetCommitedZoneInfo().last, writeInTransaction, "class info update last obj oid"
, NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction.PointerWriteAction);
if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogIdDebug))
{
NeoDatis.Tool.DLogger.Debug(DepthToSpaces() + "End of updateInstanceFieldsOfClassInfo for "
+ classInfo.GetFullClassName());
}
fsi.SetWritePosition(currentPosition, writeInTransaction);
}