Login Skip Navigation LinksWilsonORMapper > Forums Search
Demo Version Demo Version
Download and try for yourself a fully working demo version, including sample apps and documentation.  The only limitation is that the demo version only works inside the debugger.

PayPal Subscribe
Get It All for $50 USD:
WebPortal, ORMapper,
Source Code, All Updates
PayPal

User Login User Login
Log In
 
 
Reset Password

Wilson ORMapper Forums Wilson ORMapper Forums : Bugs & Issues : Queries on Abstract Base Classes Not Working

Date Post
8/7/2007 6:19:42 AM

Hi, Paul,

Here's a bit of my class hierarchy:

  • Item (abstract, entity in mapping file, typeField="ItemType")
    • CategorizedItem (abstract, inherits Item, subEntity in mapping file, typeValue=1)
      • LineItem (inherits CategorizedItem, subEntity in mapping file, typeValue=2)
      • StaffingItem (inherits CategorizedItem, subEntity in mapping file, typeValue=3)

When I try this code:

ObjectSpace os = Manager.Engine.GetObjectSet(typeof(CategorizedItem), "")

the mapper's SQL criteria, as viewed by SQL Profiler,  specifies 'ItemType = 1'

This doesn't return any values, even if I have LineItems and StaffingItems in the table, because their ItemType values are 2 and 3, respectively.

Am I missing something?  The Mapping File Options wiki entry says that if CategorizedItem is abstract, I don't need to supply a typeValue, but if I don't, the mapper doesn't initialize, saying a typeValue hasn't been specified for CategorizedItem.

Regards,

Brad

8/8/2007 1:17:39 AM

Hi Brad:

I believe my expectation in a case like this was that you wouldn't map CategorizedItem since its not adding anything as far as the mapper is concerned.

Thanks, Paul Wilson