简体   繁体   English

Fluent Nhibernate - 如何指定表名

[英]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.

相关问题 流利的NHibernate-如何使用GeneratedBy.Native()为Id指定序列名称 - Fluent NHibernate - how to specify sequence name for Id with GeneratedBy.Native() 如何在流畅的nHibernate中指定Columntype? - How to Specify Columntype in fluent nHibernate? 如何使用 Entity Framework Code First Fluent API 指定表名 - How to specify table name with Entity Framework Code First Fluent API 在Fluent NHibernate中,如何指定字典映射类型的大小? - In Fluent NHibernate how do I specify a dictionary mapping type size? 流利的NHibernate:每个类的表-继承,如何定义其他FK名称? - Fluent NHibernate: Table Per Class - Inheritance, how to define other FK-Name? 如何从数据库映射中检索表名 class C# fluent nhibernate - How to retrieve table name from database mapping class C# fluent nhibernate 如何在联接表(Fluent NHibernate)上使用带有属性(列)的NHibernate ManyToMany - How to use NHibernate ManyToMany with properties (columns) on Join Table (Fluent NHibernate) 流利的NHibernate-如何映射到引用了查询表的表 - Fluent NHibernate - How to map to table which has reference to a lookup table 流利的nhibernate自动映射(按属性名称) - Fluent nhibernate Automaping by property name 流畅的nHibernate动态属性名称 - Fluent nHibernate dynamic property name
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM