NHibernate: Same class for multiple tables?

Please see Chapter 8 for polymorphic mapping rules with Nbernate.

Please see Chapter 8 for polymorphic mapping rules with N In short, you will need a discriminator column to specify what discriminator persists to what table. Here's an instance from the N OR if you use inheritance, you will only need to map your derived classes as subclasses and specify the datatable name for each of them from within your base type class mapping. ... ... ... ... You may observe that a Payment is a payment, whatever its type of payment.So, it is mapped as a IPayment.

Then, subcategorized in multiple tables which represents each type of payment by its discriminator column. Chapter 8 - Polymorphic mapping.

Some options here - I don't know which one will work best for you: You may be able to use the mapping to do what you want. More info at the NHForge docs and from Ayende. I haven't used this myself, so I'm not entirely sure it will help.

Create ArticleAttachment and CategoryAttachment classes which both derive from FileAttachment. These class can be mapped normally and Nb does not need to be specially told about the base class. The problem here is that you will not be able to map a collection that contains both ArticleAttachments and CategoryAttachments.

Have a single FileAttachment table which stores details of all attachments. These can then be linked to your Article and Category table using a join.

Thx – Yannis Dec 6 '09 at 7:14 Table ArticleAttachment: columns ArticleID, FileAttachmentID Table CategoryAttachment: columns CategoryID, FileAttachmentID Table FileAttachment: columns ID, Name, etc Your Article and Category mappings should then include something like: – John Rayner Dec 6 '09 at 22:09.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions