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


C# SimpleValue.SetTypeUsingReflection方法代码示例

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


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

示例1: CreateIdentifierProperty

		private void CreateIdentifierProperty(HbmId idSchema, PersistentClass rootClass, SimpleValue id)
		{
			if (idSchema.name != null)
			{
				string access = idSchema.access ?? mappings.DefaultAccess;
				id.SetTypeUsingReflection(rootClass.MappedClass.AssemblyQualifiedName, idSchema.name, access);

				Mapping.Property property = new Mapping.Property(id);
				property.Name = idSchema.name;

				if (property.Value.Type == null)
					throw new MappingException("could not determine a property type for: " + property.Name);

				property.PropertyAccessorName = idSchema.access ?? mappings.DefaultAccess;
				property.Cascade = mappings.DefaultCascade;
				property.IsUpdateable = true;
				property.IsInsertable = true;
				property.IsOptimisticLocked = true;
				property.Generation = PropertyGeneration.Never;
				property.MetaAttributes = GetMetas(idSchema);

				rootClass.IdentifierProperty = property;

				LogMappedProperty(property);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:26,代码来源:ClassIdBinder.cs

示例2: FillSimpleValue

		public SimpleValue FillSimpleValue(SimpleValue simpleValue)
		{
			string type = BinderHelper.IsDefault(explicitType) ? returnedClassName : explicitType;
			TypeDef typeDef = mappings.GetTypeDef(type);
			if (typeDef != null)
			{
				type = typeDef.TypeClass;
				simpleValue.TypeParameters = typeDef.Parameters;
			}
			if (typeParameters != null && typeParameters.Count != 0)
			{
				//explicit type params takes precedence over type def params
				simpleValue.TypeParameters = typeParameters;
			}
			simpleValue.TypeName = type;
			if (persistentClassName != null)
			{
				simpleValue.SetTypeUsingReflection(persistentClassName, propertyName,"");
			}
			foreach (Ejb3Column column in columns)
			{
				column.linkWithValue(simpleValue);
			}
			return simpleValue;
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:25,代码来源:SimpleValueBinder.cs

示例3: CreateProperty

		private Property CreateProperty(SimpleValue value, string propertyName, System.Type parentClass,
			HbmKeyProperty keyPropertySchema)
		{
			if (parentClass != null && value.IsSimpleValue)
				value.SetTypeUsingReflection(parentClass.AssemblyQualifiedName, propertyName,
				                             keyPropertySchema.access ?? mappings.DefaultAccess);

			// This is done here 'cos we might only know the type here (ugly!)
			var toOne = value as ToOne;
			if (toOne != null)
			{
				string propertyRef = toOne.ReferencedPropertyName;
				if (propertyRef != null)
					mappings.AddUniquePropertyReference(toOne.ReferencedEntityName, propertyRef);
			}

			value.CreateForeignKey();
			var prop = new Property {Value = value};
			BindProperty(keyPropertySchema, prop);

			return prop;
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:22,代码来源:ClassCompositeIdBinder.cs


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