⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 entitymetamodel.cs

📁 NHibernate NET开发者所需的
💻 CS
📖 第 1 页 / 共 2 页
字号:
					{
						return true;
					}
				}
			}
			return false;
		}

		private void MapPropertyToIndex(Mapping.Property prop, int i)
		{
			propertyIndexes[prop.Name] = i;
			Mapping.Component comp = prop.Value as Mapping.Component;
			if (comp != null)
			{
				foreach (Mapping.Property subprop in comp.PropertyIterator)
				{
					propertyIndexes[prop.Name + '.' + subprop.Name] = i;
				}
			}
		}

		public ISet<string> SubclassEntityNames
		{
			get { return subclassEntityNames; }
		}

		private bool IndicatesCollection(IType type)
		{
			if (type.IsCollectionType)
			{
				return true;
			}
			else if (type.IsComponentType)
			{
				IType[] subtypes = ((IAbstractComponentType) type).Subtypes;
				for (int i = 0; i < subtypes.Length; i++)
				{
					if (IndicatesCollection(subtypes[i]))
					{
						return true;
					}
				}
			}
			return false;
		}

		public ISessionFactoryImplementor SessionFactory
		{
			get { return sessionFactory; }
		}

		public System.Type Type
		{
			get { return type; }
		}

		public System.Type RootType
		{
			get { return rootType; }
		}

		public string RootTypeAssemblyQualifiedName
		{
			get { return rootTypeAssemblyQualifiedName; }
		}

		public string Name
		{
			get { return name; }
		}

		public string RootName
		{
			get { return rootName; }
		}

		public EntityType EntityType
		{
			get { return entityType; }
		}

		public IdentifierProperty IdentifierProperty
		{
			get { return identifierProperty; }
		}

		public int PropertySpan
		{
			get { return propertySpan; }
		}

		public int VersionPropertyIndex
		{
			get { return versionPropertyIndex; }
		}

		public VersionProperty VersionProperty
		{
			get
			{
				if (NoVersionIndex == versionPropertyIndex)
				{
					return null;
				}
				else
				{
					return (VersionProperty) properties[versionPropertyIndex];
				}
			}
		}

		public StandardProperty[] Properties
		{
			get { return properties; }
		}

		public int GetPropertyIndex(string propertyName)
		{
			int? index = GetPropertyIndexOrNull(propertyName);
			if (!index.HasValue)
			{
				throw new HibernateException("Unable to resolve property: " + propertyName);
			}
			return index.Value;
		}

		public int? GetPropertyIndexOrNull(string propertyName)
		{
			int? result;
			if (propertyIndexes.TryGetValue(propertyName, out result))
				return result;
			else
				return null;
		}

		public bool HasCollections
		{
			get { return hasCollections; }
		}

		public bool HasMutableProperties
		{
			get { return hasMutableProperties; }
		}

		public bool HasLazyProperties
		{
			get { return hasLazyProperties; }
		}

		public bool HasCascades
		{
			get { return hasCascades; }
		}

		public bool IsMutable
		{
			get { return mutable; }
		}

		public bool IsSelectBeforeUpdate
		{
			get { return selectBeforeUpdate; }
		}

		public bool IsDynamicUpdate
		{
			get { return dynamicUpdate; }
		}

		public bool IsDynamicInsert
		{
			get { return dynamicInsert; }
		}

		public Versioning.OptimisticLock OptimisticLockMode
		{
			get { return optimisticLockMode; }
		}

		public bool IsPolymorphic
		{
			get { return polymorphic; }
		}

		public string Superclass
		{
			get { return superclass; }
		}

		public System.Type SuperclassType
		{
			get { return superclassType; }
		}

		public bool IsExplicitPolymorphism
		{
			get { return explicitPolymorphism; }
		}

		public bool IsInherited
		{
			get { return inherited; }
		}

		public bool HasSubclasses
		{
			get { return hasSubclasses; }
		}

		public bool IsLazy
		{
			get { return lazy; }
			set { lazy = value; }
		}

		public bool IsVersioned
		{
			get { return versioned; }
		}

		public bool IsAbstract
		{
			get { return isAbstract; }
		}

		public override string ToString()
		{
			return "EntityMetamodel(" + type.FullName + ':' + ArrayHelper.ToString(properties) + ')';
		}

		#region temporary
		public string[] PropertyNames
		{
			get { return propertyNames; }
		}

		public IType[] PropertyTypes
		{
			get { return propertyTypes; }
		}

		public bool[] PropertyLaziness
		{
			get { return propertyLaziness; }
		}

		public bool[] PropertyUpdateability
		{
			get { return propertyUpdateability; }
		}

		public bool[] PropertyCheckability
		{
			get { return propertyCheckability; }
		}

		public bool[] NonlazyPropertyUpdateability
		{
			get { return nonlazyPropertyUpdateability; }
		}

		public bool[] PropertyInsertability
		{
			get { return propertyInsertability; }
		}

		public bool[] PropertyNullability
		{
			get { return propertyNullability; }
		}

		public bool[] PropertyVersionability
		{
			get { return propertyVersionability; }
		}

		public CascadeStyle[] CascadeStyles
		{
			get { return cascadeStyles; }
		}

		public ValueInclusion[] PropertyInsertGenerationInclusions
		{
			get { return insertInclusions; }
		}

		public ValueInclusion[] PropertyUpdateGenerationInclusions
		{
			get { return updateInclusions; }
		}

		public bool HasInsertGeneratedValues
		{
			get { return hasInsertGeneratedValues; }
		}

		public bool HasUpdateGeneratedValues
		{
			get { return hasUpdateGeneratedValues; }
		}

		#endregion

		#region Tuplizer
		private readonly EntityEntityModeToTuplizerMapping tuplizerMapping;

		public IEntityTuplizer GetTuplizer(EntityMode entityMode)
		{
			return (IEntityTuplizer)tuplizerMapping.GetTuplizer(entityMode);
		}

		public IEntityTuplizer GetTuplizerOrNull(EntityMode entityMode)
		{
			return (IEntityTuplizer)tuplizerMapping.GetTuplizerOrNull(entityMode);
		}

		public EntityMode? GuessEntityMode(object obj)
		{
			return tuplizerMapping.GuessEntityMode(obj);
		}
		#endregion

		public bool HasNaturalIdentifier
		{
			get { return naturalIdPropertyNumbers != null; }
		}

		public bool HasNonIdentifierPropertyNamedId
		{
			get { return hasNonIdentifierPropertyNamedId; }
		}

		public int[] NaturalIdentifierProperties
		{
			get { return naturalIdPropertyNumbers; }
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -