[英]Fluent Nhibernate - How to specify table name
I just started learning Nhibernate and Fluent Nhibernate. 我刚开始学习Nhibernate和Fluent Nhibernate。 I want to specify table name when I create my mapping class. 我想在创建映射类时指定表名。
Entity name in application is "CustomerOrders" but in the oracle database, table name is "CUSTOMER_ORDERS". 应用程序中的实体名称为“CustomerOrders”,但在oracle数据库中,表名为“CUSTOMER_ORDERS”。
I learnt from googling that I can use "WithTable" to specify database table name. 我从谷歌搜索了解到我可以使用“WithTable”来指定数据库表名。
I am not sure how to use it and where as Vs2008 didn't find the method. 我不知道如何使用它和Vs2008没有找到方法的地方。
Thanks 谢谢
public class CustomerOrdersMap : IAutoMappingOverride<CustomerOrders>
{
public void Override(AutoMapping<CustomerOrders> mapping)
{
mapping.Table("CUSTOMER_ORDERS");
}
}
WithTable
was renamed to Table
for the 1.0 release. WithTable
在1.0版本中重命名为Table
。 It was mentioned in the release notes (first bullet point). 它在发行说明 (第一个要点)中提到过。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.