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


C# IAbstractComponentType类代码示例

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


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


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