本文整理匯總了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;
}