本文整理汇总了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);
}
}
示例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;
}
示例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;
}