• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IAbstractComponentType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IAbstractComponentType的典型用法代码示例。如果您正苦于以下问题:C# IAbstractComponentType类的具体用法?C# IAbstractComponentType怎么用?C# IAbstractComponentType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IAbstractComponentType类属于命名空间,在下文中一共展示了IAbstractComponentType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: LazyInitializer

 ///<summary>
 ///</summary>
 ///<param name="entityName"></param>
 ///<param name="persistentClass"></param>
 ///<param name="id"></param>
 ///<param name="getIdentifierMethod"></param>
 ///<param name="setIdentifierMethod"></param>
 ///<param name="componentIdType"></param>
 ///<param name="session"></param>
 public LazyInitializer(string entityName, Type persistentClass, object id, MethodInfo getIdentifierMethod,
     MethodInfo setIdentifierMethod, IAbstractComponentType componentIdType,
     ISessionImplementor session)
     : base(entityName, persistentClass, id, getIdentifierMethod,
         setIdentifierMethod, componentIdType, session)
 {
 }
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:16,代码来源:LazyInitializer.cs


示例2: CompositeElementPropertyMapping

		public CompositeElementPropertyMapping(string[] elementColumns, string[] elementFormulaTemplates,
																					 IAbstractComponentType compositeType, IMapping factory)
		{
			this.compositeType = compositeType;

			InitComponentPropertyPaths(null, compositeType, elementColumns, elementFormulaTemplates, factory);
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:7,代码来源:CompositeElementPropertyMapping.cs


示例3: PostInstantiate

    public void PostInstantiate(string entityName, Type persistentClass, ISet<Type> interfaces, MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, IAbstractComponentType componentIdType)
    {
        _entityName = entityName;
        _persistentClass = persistentClass;
        _interfaces = new Type[interfaces.Count];
        interfaces.CopyTo(_interfaces, 0);
        _getIdentifierMethod = getIdentifierMethod;
        _setIdentifierMethod = setIdentifierMethod;
        _componentIdType = componentIdType;
        _isClassProxy = _interfaces.Length == 1;

        _proxyKey = entityName;

        if( _proxies.Contains(_proxyKey) )
        {
            _proxyType = _proxies[_proxyKey] as Type;
            _log.DebugFormat("Using proxy type '{0}' for persistent class '{1}'", _proxyType.Name, _persistentClass.FullName);
        }
        else
        {
            string message = string.Format("No proxy type found for persistent class '{0}' using proxy key '{1}'", _persistentClass.FullName, _proxyKey);
            _log.Error(message);
            throw new HibernateException(message);
        }
    }
开发者ID:spib,项目名称:nhcontrib,代码行数:25,代码来源:CastleStaticProxyFactory.cs


示例4: ProcessComponent

		/// <summary>
		/// Visit a component. Dispatch each property to <see cref="ProcessValues"/>
		/// </summary>
		/// <param name="component"></param>
		/// <param name="componentType"></param>
		/// <returns></returns>
		internal virtual object ProcessComponent(object component, IAbstractComponentType componentType)
		{
			if (component != null)
			{
				ProcessValues(componentType.GetPropertyValues(component, session), componentType.Subtypes);
			}
			return null;
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:14,代码来源:AbstractVisitor.cs


示例5: AbstractEntityTuplizer

		/// <summary> Constructs a new AbstractEntityTuplizer instance. </summary>
		/// <param name="entityMetamodel">The "interpreted" information relating to the mapped entity. </param>
		/// <param name="mappingInfo">The parsed "raw" mapping data relating to the given entity. </param>
		protected AbstractEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappingInfo)
		{
			this.entityMetamodel = entityMetamodel;

			if (!entityMetamodel.IdentifierProperty.IsVirtual)
			{
				idGetter = BuildPropertyGetter(mappingInfo.IdentifierProperty, mappingInfo);
				idSetter = BuildPropertySetter(mappingInfo.IdentifierProperty, mappingInfo);
			}
			else
			{
				idGetter = null;
				idSetter = null;
			}

			propertySpan = entityMetamodel.PropertySpan;

			getters = new IGetter[propertySpan];
			setters = new ISetter[propertySpan];

			bool foundCustomAccessor = false;
			int i = 0;
			foreach (Mapping.Property property in mappingInfo.PropertyClosureIterator)
			{
				getters[i] = BuildPropertyGetter(property, mappingInfo);
				setters[i] = BuildPropertySetter(property, mappingInfo);
				if (!property.IsBasicPropertyAccessor)
					foundCustomAccessor = true;
				i++;				
			}
			if (log.IsDebugEnabled)
			{
				log.DebugFormat("{0} accessors found for entity: {1}", foundCustomAccessor ? "Custom" : "No custom",
				                mappingInfo.EntityName);
			}
			hasCustomAccessors = foundCustomAccessor;

			//NH-1587
			//instantiator = BuildInstantiator(mappingInfo);

			if (entityMetamodel.IsLazy)
			{
				proxyFactory = BuildProxyFactory(mappingInfo, idGetter, idSetter);
				if (proxyFactory == null)
				{
					entityMetamodel.IsLazy = false;
				}
			}
			else
			{
				proxyFactory = null;
			}

			Mapping.Component mapper = mappingInfo.IdentifierMapper;
			identifierMapperType = mapper == null ? null : (IAbstractComponentType)mapper.Type;
		}
开发者ID:renefc3,项目名称:nhibernate,代码行数:59,代码来源:AbstractEntityTuplizer.cs


示例6: BasicLazyInitializer

		protected internal BasicLazyInitializer(string entityName, System.Type persistentClass, object id, 
			MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, 
			IAbstractComponentType componentIdType, ISessionImplementor session)
			: base(entityName, id, session)
		{
			this.persistentClass = persistentClass;
			this.getIdentifierMethod = getIdentifierMethod;
			this.setIdentifierMethod = setIdentifierMethod;
			this.componentIdType = componentIdType;
			overridesEquals = ReflectHelper.OverridesEquals(persistentClass);
		}
开发者ID:snbbgyth,项目名称:WorkFlowEngine,代码行数:11,代码来源:BasicLazyInitializer.cs


示例7: PostInstantiate

		public virtual void PostInstantiate(string entityName, System.Type persistentClass, ISet<System.Type> interfaces,
		                                    MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod,
		                                    IAbstractComponentType componentIdType)
		{
			_entityName = entityName;
			_persistentClass = persistentClass;
			_interfaces = new System.Type[interfaces.Count];
			interfaces.CopyTo(_interfaces, 0);
			_getIdentifierMethod = getIdentifierMethod;
			_setIdentifierMethod = setIdentifierMethod;
			_componentIdType = componentIdType;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:12,代码来源:CastleProxyFactory.cs


示例8: PropertyChangedLazyInitializer

 public PropertyChangedLazyInitializer(
     string entityName,
     Type persistentClass,
     object id,
     MethodInfo getIdentifierMethod,
     MethodInfo setIdentifierMethod,
     IAbstractComponentType componentIdType,
     ISessionImplementor session,
     bool entityHandlesPropertyChanged)
     : base(entityName, persistentClass, id, getIdentifierMethod, setIdentifierMethod, componentIdType, session)
 {
     _entityHandlesPropertyChanged = entityHandlesPropertyChanged;
 }
开发者ID:pasqualedante,项目名称:NHibernate.PropertyChanged,代码行数:13,代码来源:PropertyChangedLazyInitializer.cs


示例9: ProcessComponent

		internal override object ProcessComponent(object component, IAbstractComponentType componentType)
		{
			IType[] types = componentType.Subtypes;
			if (component == null)
			{
				ProcessValues(new object[types.Length], types);
			}
			else
			{
				base.ProcessComponent(component, componentType);
			}

			return null;
		}
开发者ID:hoangduc007,项目名称:nhibernate-core,代码行数:14,代码来源:ReattachVisitor.cs


示例10: PostInstantiate

		public void PostInstantiate(string entityName, System.Type persistentClass, ISet<System.Type> interfaces, MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, IAbstractComponentType componentIdType)
		{
			if (persistentClass.IsGenericType) return;

			var interfacesCount = interfaces.Count;
			var ifaces = new System.Type[interfacesCount];
			if (interfacesCount > 0)
				interfaces.CopyTo(ifaces, 0);

			var proxyType = ifaces.Length == 1
								? factory.CreateProxyType(persistentClass, ifaces)
								: factory.CreateProxyType(ifaces[0], ifaces);

			proxies[entityName] = proxyType;
		}
开发者ID:uQr,项目名称:NHibernate.ProxyGenerators,代码行数:15,代码来源:GeneratorProxyFactory.cs


示例11: PostInstantiate

		public virtual void PostInstantiate(string entityName, System.Type persistentClass, ISet<System.Type> interfaces,
																				MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod,
																				IAbstractComponentType componentIdType)
		{
			EntityName = entityName;
			PersistentClass = persistentClass;
			Interfaces = new System.Type[interfaces.Count];

			if (interfaces.Count > 0)
			{
				interfaces.CopyTo(Interfaces, 0);
			}

			GetIdentifierMethod = getIdentifierMethod;
			SetIdentifierMethod = setIdentifierMethod;
			ComponentIdType = componentIdType;
		}
开发者ID:pruiz,项目名称:nhibernate-old,代码行数:17,代码来源:AbstractProxyFactory.cs


示例12: PostInstantiate

        public void PostInstantiate(string entityName, Type persistentClass, ISet<Type> interfaces, MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, IAbstractComponentType componentIdType)
        {
            if (persistentClass.IsGenericType) return;

            int interfacesCount = interfaces.Count;
            bool isClassProxy = interfacesCount == 1;
            Type[] ifaces = new Type[interfacesCount];
            interfaces.CopyTo(ifaces, 0);

            Type proxyType;
            if (isClassProxy)
            {
                proxyType = _proxyBuilder.CreateClassProxy(persistentClass, ifaces, ProxyGenerationOptions.Default);
            }
            else
            {
                proxyType = _proxyBuilder.CreateInterfaceProxyTypeWithoutTarget(ifaces[0], ifaces, ProxyGenerationOptions.Default);
            }

            _proxies[entityName] = proxyType;
        }
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:21,代码来源:CastleProxyFactory.cs


示例13: ProcessComponent

        internal override object ProcessComponent(object component, IAbstractComponentType componentType)
        {
            if (component != null)
            {
                object[] values = componentType.GetPropertyValues(component, Session);
                IType[] types = componentType.Subtypes;
                bool substituteComponent = false;
                for (int i = 0; i < types.Length; i++)
                {
                    System.Object result = ProcessValue(values[i], types[i]);
                    if (result != null)
                    {
                        values[i] = result;
                        substituteComponent = true;
                    }
                }
                if (substituteComponent)
                {
                    componentType.SetPropertyValues(component, values, Session.EntityMode);
                }
            }

            return null;
        }
开发者ID:zibler,项目名称:zibler,代码行数:24,代码来源:WrapVisitor.cs


示例14: ProcessComponent

		protected override object ProcessComponent(object component, IAbstractComponentType componentType)
		{
			if (component == null)
			{
				return null;
			}

			object[] values = componentType.GetPropertyValues(component, Session);
			IType[] types = componentType.Subtypes;
			bool substituteComponent = false;
			for (int i = 0; i < types.Length; i++)
			{
				object result = ProcessValue(values[i], types[i]);
				if (result != null)
				{
					substituteComponent = true;
					values[i] = result;
				}
			}

			if (substituteComponent)
			{
				componentType.SetPropertyValues(component, values);
			}

			return null;
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:27,代码来源:WrapVisitor.cs


示例15: PostInstantiate

		public void PostInstantiate(string entityName, System.Type persistentClass, ISet<System.Type> interfaces,
																MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod,
																IAbstractComponentType componentIdType)
		{
			this.entityName = entityName;
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:6,代码来源:MapProxyFactory.cs


示例16: CompositeElementPropertyMapping

		/// <summary>
		/// 
		/// </summary>
		/// <param name="elementColumns"></param>
		/// <param name="compositeType"></param>
		/// <param name="factory"></param>
		public CompositeElementPropertyMapping( string[] elementColumns, IAbstractComponentType compositeType, ISessionFactoryImplementor factory )
		{
			this.compositeType = compositeType;

			InitComponentPropertyPaths( null, compositeType, elementColumns, factory );
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:12,代码来源:CompositeElementPropertyMapping.cs


示例17: AddComponentTypedValues

		protected void AddComponentTypedValues(string path, object component, IAbstractComponentType type, IList list, ICriteria criteria, ICriteriaQuery criteriaQuery)
		{
			if (component != null)
			{
				string[] propertyNames = type.PropertyNames;
				IType[] subtypes = type.Subtypes;
				object[] values = type.GetPropertyValues(component, GetEntityMode(criteria, criteriaQuery));

				for (int i = 0; i < propertyNames.Length; i++)
				{
					object value = values[i];
					IType subtype = subtypes[i];
					string subpath = StringHelper.Qualify(path, propertyNames[i]);
					if (IsPropertyIncluded(value, subpath, subtype))
					{
						if (subtype.IsComponentType)
						{
							AddComponentTypedValues(subpath, value, (IAbstractComponentType) subtype, list, criteria, criteriaQuery);
						}
						else
						{
							AddPropertyTypedValue(value, subtype, list);
						}
					}
				}
			}
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:27,代码来源:Example.cs


示例18: WalkCompositeElementTree

		/// <summary>
		/// For a composite element, add to a list of associations to be fetched by outerjoin
		/// </summary>
		private void WalkCompositeElementTree(IAbstractComponentType compositeType, string[] cols,
			IQueryableCollection persister, string alias, string path, int currentDepth)
		{
			IType[] types = compositeType.Subtypes;
			string[] propertyNames = compositeType.PropertyNames;
			int begin = 0;
			for (int i = 0; i < types.Length; i++)
			{
				int length = types[i].GetColumnSpan(factory);
				string[] lhsColumns = ArrayHelper.Slice(cols, begin, length);

				if (types[i].IsAssociationType)
				{
					IAssociationType associationType = types[i] as IAssociationType;

					// simple, because we can't have a one-to-one or collection
					// (or even a property-ref) in a composite element:
					string[] aliasedLhsColumns = StringHelper.Qualify(alias, lhsColumns);
					string subpath = SubPath(path, propertyNames[i]);
					bool[] propertyNullability = compositeType.PropertyNullability;

					JoinType joinType =
						GetJoinType(associationType, compositeType.GetFetchMode(i), subpath, persister.TableName, lhsColumns,
												propertyNullability == null || propertyNullability[i], currentDepth, compositeType.GetCascadeStyle(i));

					AddAssociationToJoinTreeIfNecessary(associationType, aliasedLhsColumns, alias, subpath, currentDepth, joinType);
				}
				else if (types[i].IsComponentType)
				{
					string subpath = SubPath(path, propertyNames[i]);
					WalkCompositeElementTree((IAbstractComponentType)types[i], lhsColumns, persister, alias, subpath, currentDepth);
				}
				begin += length;
			}
		}
开发者ID:rbirkby,项目名称:nhibernate-core,代码行数:38,代码来源:JoinWalker.cs


示例19: DataBindingInterceptor

 public DataBindingInterceptor(String EntityName, Type persistentClass, object id, MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, IAbstractComponentType aType, ISessionImplementor session)
     : base(EntityName, persistentClass, id, getIdentifierMethod, setIdentifierMethod, aType, session)
 {
 }
开发者ID:MatiasBjorling,项目名称:EcoLoad,代码行数:4,代码来源:DataBindingIntercepter.cs


示例20: CheckComponentNullability

		/// <summary> 
		/// Check component nullability. Returns property path that break
		/// nullability or null if none 
		/// </summary>
		/// <param name="value">component properties </param>
		/// <param name="compType">component not-nullable type </param>
		/// <returns> property path </returns>
		private string CheckComponentNullability(object value, IAbstractComponentType compType)
		{
			// will check current level if some of them are not null or sublevels if they exist
			bool[] nullability = compType.PropertyNullability;
			if (nullability != null)
			{
				//do the test
				object[] values = compType.GetPropertyValues(value, session.EntityMode);
				IType[] propertyTypes = compType.Subtypes;
				for (int i = 0; i < values.Length; i++)
				{
					object subvalue = values[i];
					if (!nullability[i] && subvalue == null)
					{
						return compType.PropertyNames[i];
					}
					else if (subvalue != null)
					{
						string breakProperties = CheckSubElementsNullability(propertyTypes[i], subvalue);
						if (breakProperties != null)
						{
							return BuildPropertyPath(compType.PropertyNames[i], breakProperties);
						}
					}
				}
			}
			return null;
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:35,代码来源:Nullability.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IAcSession类代码示例发布时间:2022-05-24
下一篇:
C# IAbsoluteFilePath类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap