NHibernate Forge
The official new home for the NHibernate for .NET community

Mapping tables

Wiki Page Hierarchy

Pages

Page Details

Published by:
oceantrain
on 11-23-2011
This page has not yet been rated
Article
Comments (1)
History (1)

Mapping tables

I'm new to NHibernate, So I'm not sure if I this is even the place to ask questions. But here goes.

This is my problem:

I am building a website using Orchard CMS.  All the Orchard tables are mapped by NHibernate. I also have tables in the same database that are NOT mapped by NHibernate. These tables were provided by the client. I need to query these tables and display data on the front end using Orchard. I must keep the table schemas in tact. I have a tutorial on how to map tables using NHibernate, however everything I see in the tutorials, requires the tables to have an ID column as the Primary key. None of the tables provided to me by the client have ID as the first/Primary key column. Is it possible to map to these tables without using the ID method? Or a variation of the ID method?

Id(x => x.Id);

 

Instead can I map to the table using:

MyColumnName/Primarykey(x => x.Id);

or

Id(x => x.MyColumnname/PrimaryKey);

 

Again, at this point I cannot migrate the data into new tables mapped by NHibernate and also the table schema must remain in tact. As the Client is updating these tables on a nightly bases.

 

Any help is appreciated.

 

Thanks

 

Oceantrain

:

Recent Comments

By: luedi Posted on 11-27-2011 2:10

It will be better to ask questions in the User Forum

groups.google.com/.../nhusers

View All
Powered by Community Server (Commercial Edition), by Telligent Systems