Regular |
|
Joined: Thu Dec 02, 2004 10:42 am Posts: 54
|
I have a discriminator column which is allowing null. The column's type is Number.
How can I set the null value for discriminator-value attribute?
Is it possible to set "other" value? that means any other value that not specified are give to this subclass.
----------------------------
Another question:
The actually question is how to dynamicly set up discriminator-value?
We have a code table, which is used for all the codes:
ID Code Desc CodeTypeID
1 AccType AccountType
2 UserType User's Type
3 CreditAcc Credit Account 1
4 LoanAcc Loan Account 1
5 Guest Guest User 2
6 Admin Administrator 2
----------------------------------------
I want to set up object like this:
Abstract Class Code
Class CodeType: Code
AccTypeCode: Code
UserTypeCode: Code
-----------------------
The problem is I don't want to use discriminator-value with 1/2....
Cause the ID value can change, I want to have sth like: discriminator-value="Type.Code='UserType' && Type.CodeTypeID is null"
Is there any easy solution without manipulating the persister in Hibernate or NHibernate?
Thanks
|
|