0

I have a library with a class called Recipient which has it's own fluent mapping setup within the library.

Now in another project I have created a new class called SentEmail which inherits from Recipient, I want to be able to create a new mapping class file based on the original Recipient map. If I could update the original ClassMap file I would use

JoinedSubClass("ID", m => MAPPING HERE);

However because I can't adjust the original class map I am stuck as to how I can do this.

There must be another way to skin this cat, if anyone has any ideas they would be much appreciated.

Thanks

UPDATE

Also one thing I forgot to mention part of the details in the new SentEmail model class are stored in a seperate table to the Recipient table.

John_
  • 2,931
  • 3
  • 32
  • 49

1 Answers1

1

If you can't adjust the original mapping at all, then you're out of luck; otherwise you could use the AddPart method to add a separate instance of JoinedSubClassPart.

An aside: your design sounds a bit peculiar. SentEmail doesn't sound like it should really inherit from Recipient. SentEmail would inherit from Email, or SuccessfulRecipient from Recipient; Recipient and Email are two separate concepts.

James Gregory
  • 14,173
  • 2
  • 42
  • 60
  • That is a good point thanks James, I have amended the name to be RecipientEmailHistory as it is more related to the recipient than the email. I've also decided that creating a map for the file was unneccesary because it was a read only class so I create a query and transform it into my new model using NHibernate.Transform.Transformers.AliasToBean. Thanks for your assistance. – John_ May 09 '09 at 09:54