【发布时间】:2010-10-03 04:42:10
【问题描述】:
问题:我通过属性有以下 nHibernate 映射。
现在我想创建带有动态表前缀的 T_lsDomains。 例如 TBL_lsDomains 或只是 lsDomains。
有什么方法可以用属性做到这一点? 因为它们是在编译时定义的,而且必须是常量?
有什么办法吗?
或者fluentNhibernate可以做到这一点吗?
using System;
using System.Collections.Generic;
using System.Text;
namespace nhDBapi.Tables
{
[NHibernate.Mapping.Attributes.Class(Name = "nhDBapi.Tables.clsDomains, nhDBapi", Table = "T_lsDomains")]
public class clsDomains
{
void clsDOmains()
{
}
[NHibernate.Mapping.Attributes.Id(Name = "DomainID", Column = "DM_DomainID", TypeType = typeof(string))]
public string DomainID = "abc"; // nvarchar(100) NULL DEFAULT (''),
[NHibernate.Mapping.Attributes.Property(Name = "DomainName", Column = "DM_DomainName", Type = "String", Length = 100)]
string DomainName = ""; // nvarchar(100) NULL DEFAULT (''),
[NHibernate.Mapping.Attributes.Property(Name = "Description", Column = "DM_Description", Type = "String", Length = 100)]
string Description = ""; // nvarchar(100) NULL DEFAULT (''),
}
}
【问题讨论】:
-
请指定 T_lsDomains 指的是什么,以及您要创建的具体内容
-
T_lsDomains 是一个数据库表。我想创建一个动态名称的表。
标签: nhibernate fluent-nhibernate nhibernate-mapping