lets say i have Employee which is a concrete class with the properties
Id
Type

and i have CoolEmployee and MoronEmployee that extend Employee

now i have many employee types and i want type=1 to generate CoolEmployee
and type=2 to generate MoronEmployee.
there are alot of other possible values, for instance, 3 is manager and 4 is
Cleaning guy, and i want all of these other values to generate the Employee
class

Do i need an extra column to discriminate between the classes or can i
somehow say that Employee is the default class of a not-found value and use
the type column?

(i don't have a mapping because it is just a theoritical question :) )

btw, another thing i was wondering about but couldn't google an answer is if
it is currently possible to set range of values for discrimination (similar
to the previous question)
lets say that i have the sub classes RichGuy, PoorGuy both extend Guy
and i wanna have the RichGuy subclass generated when the Income column is
more than 1,000,000
if the Income is between  10,000 to 1,000,000 its just a Guy
and less than 10,000 is a PoorGuy

could this be mapped?
i see a big problem with this scenario because if the Income property is
updatebly by the application, we could have a PoorGuy that his Income just
became
high enough that he should become just a Guy
but if the Income property isn't updatebly it might make sense

again, it is just a theoretical question.

thanks.

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