So are you mapping to a single table in your db or are you mapping to 2
separate tables.  The use of a discriminator says a single table so while
you abstract Customer class won't have a Property name Discriminator, you
still have to map a discriminator column on your map.

See this post on inheritance in NHibernate

http://notherdev.blogspot.com/2012/01/mapping-by-code-inheritance.html


On Monday, January 7, 2013, James Klett wrote:

> New first time to NHibernate, used another tool for years though.  Working
> with already existing db design, that works with the other tool, getting
> this error with NHibernate - DevArt EntityDesigner
>
> Custom tool error: Invalid inheritance 'Company_Customer'. Base Class
> Discriminator Value is not specified..
> Single Table Inheritance:
>
> I have an abstract Company base class, and an inherited concrete Customer
> and Vendor Classes.
>
> the discriminator is string "Customer", "Vendor" and I have no
> discriminator on Company because it is abstract and should never be
> created, and therefore there are only Vendors or Customers.
>
> Our current ORM, when querying Companies, will generate
>     WHERE discriminator  = "Customer" or discriminator  = "Vendor"
>
> So, how do I fix this error?  If I put one in just to get rid of the error
> e.g. "Company", then the generated SQL on a query for Companies would not
> be as shown above would it?  it would be WHERE discriminator  = "Company"
> which will always return 0 zero results .
>
> How do I resolve this?
> Thanks in advance
>
> JAMES
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nhusers/-/BeyLz8t2mVAJ.
> To post to this group, send email to 
> [email protected]<javascript:_e({}, 'cvml', 
> '[email protected]');>
> .
> To unsubscribe from this group, send email to
> [email protected] <javascript:_e({}, 'cvml',
> 'nhusers%[email protected]');>.
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to