本文整理汇总了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)
{
}
示例2: CompositeElementPropertyMapping
public CompositeElementPropertyMapping(string[] elementColumns, string[] elementFormulaTemplates,
IAbstractComponentType compositeType, IMapping factory)
{
this.compositeType = compositeType;
InitComponentPropertyPaths(null, compositeType, elementColumns, elementFormulaTemplates, factory);
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例15: PostInstantiate
public void PostInstantiate(string entityName, System.Type persistentClass, ISet<System.Type> interfaces,
MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod,
IAbstractComponentType componentIdType)
{
this.entityName = entityName;
}