当前位置: 首页>>代码示例>>C#>>正文


C# NeoDatis.IsNative方法代码示例

本文整理汇总了C#中NeoDatis.IsNative方法的典型用法代码示例。如果您正苦于以下问题:C# NeoDatis.IsNative方法的具体用法?C# NeoDatis.IsNative怎么用?C# NeoDatis.IsNative使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NeoDatis的用法示例。


在下文中一共展示了NeoDatis.IsNative方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InternalStoreObjectWrapper

		/// <summary>
		/// This method is used to store the object : natibe or non native and return
		/// a number : - The position of the object if it is a native object - The
		/// oid (as a negative number) if it is a non native object
		/// </summary>
		/// <param name="aoi"></param>
		/// <returns></returns>
		/// <exception cref="System.Exception">System.Exception</exception>
		private long InternalStoreObjectWrapper(NeoDatis.Odb.Core.Layers.Layer2.Meta.AbstractObjectInfo
			 aoi)
		{
			if (aoi.IsNative())
			{
				return InternalStoreObject((NeoDatis.Odb.Core.Layers.Layer2.Meta.NativeObjectInfo
					)aoi);
			}
			if (aoi.IsNonNativeObject())
			{
				NeoDatis.Odb.OID oid = StoreObject(null, (NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
					)aoi);
				return -oid.GetObjectId();
			}
			// Object references are references to object already stored.
			// But in the case of map, the reference can appear before the real
			// object (as order may change)
			// If objectReference.getOid() is null, it is the case. In this case,
			// We take the object being referenced and stores it directly.
			NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectReference objectReference = (NeoDatis.Odb.Core.Layers.Layer2.Meta.ObjectReference
				)aoi;
			if (objectReference.GetOid() == null)
			{
				NeoDatis.Odb.OID oid = StoreObject(null, objectReference.GetNnoi());
				return -oid.GetObjectId();
			}
			return -objectReference.GetOid().GetObjectId();
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:36,代码来源:AbstractObjectWriter.cs

示例2: WriteClassAttributeInfo

		/// <summary>Writes a class attribute info, an attribute of a class</summary>
		/// <param name="cai"></param>
		/// <param name="writeInTransaction"></param>
		/// <></>
		private void WriteClassAttributeInfo(NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassAttributeInfo
			 cai, bool writeInTransaction)
		{
			fsi.WriteInt(cai.GetId(), writeInTransaction, "attribute id");
			fsi.WriteBoolean(cai.IsNative(), writeInTransaction);
			if (cai.IsNative())
			{
				fsi.WriteInt(cai.GetAttributeType().GetId(), writeInTransaction, "att odb type id"
					);
				if (cai.GetAttributeType().IsArray())
				{
					fsi.WriteInt(cai.GetAttributeType().GetSubType().GetId(), writeInTransaction, "att array sub type"
						);
					// when the attribute is not native, then write its class info
					// position
					if (cai.GetAttributeType().GetSubType().IsNonNative())
					{
						fsi.WriteLong(storageEngine.GetSession(true).GetMetaModel().GetClassInfo(cai.GetAttributeType
							().GetSubType().GetName(), true).GetId().GetObjectId(), writeInTransaction, "class info id of array subtype"
							, NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction.DataWriteAction);
					}
				}
				// For enum, we write the class info id of the enum class
				if (cai.GetAttributeType().IsEnum())
				{
					fsi.WriteLong(storageEngine.GetSession(true).GetMetaModel().GetClassInfo(cai.GetFullClassname
						(), true).GetId().GetObjectId(), writeInTransaction, "class info id", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
						.DataWriteAction);
				}
			}
			else
			{
				fsi.WriteLong(storageEngine.GetSession(true).GetMetaModel().GetClassInfo(cai.GetFullClassname
					(), true).GetId().GetObjectId(), writeInTransaction, "class info id", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
					.DataWriteAction);
			}
			fsi.WriteString(cai.GetName(), false, writeInTransaction);
			fsi.WriteBoolean(cai.IsIndex(), writeInTransaction);
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:43,代码来源:AbstractObjectWriter.cs

示例3: UpdateObject

		public virtual NeoDatis.Odb.OID UpdateObject(NeoDatis.Odb.Core.Layers.Layer2.Meta.AbstractObjectInfo
			 aoi, bool forceUpdate)
		{
			if (aoi.IsNonNativeObject())
			{
				return UpdateNonNativeObjectInfo((NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
					)aoi, forceUpdate);
			}
			if (aoi.IsNative())
			{
				return UpdateObject(aoi, forceUpdate);
			}
			// TODO : here should use if then else
			throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.AbstractObjectInfoTypeNotSupported
				.AddParameter(aoi.GetType().FullName));
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:16,代码来源:AbstractObjectWriter.cs


注:本文中的NeoDatis.IsNative方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。