| 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 |