This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hmmph! It seems to me that maybe I have breached the Truman Show boundary of the Lightspeed abstraction. Until now we've been using STI method of implementing inheritance but we out-grew that method of implementation. Now we are moving to CTI but with a "twist". The Twist Under STI we have a simple Int32 Discriminator and an enum in the code that mapped to those values. I hated that when I was snooping around in the database I had to remember what a "1" was versus a "2" or a "3" ... I longed to have string Discriminators. Damn the extra space it would take up! So when implementing CTI I specified the Discriminator as a String; but more than that! ... In actual fact I declared the Data Type as a User Defined Type PartyType, the definition of which is ...
In code I have an enum that defines the types, but I used the PartyTypeConverter to cast to/from the enum's label rather than the enum's value. (To make the data more readable). But everything is coming unstuck. The problem I can create and save entities and the discriminator is persisted as a String. Awesome! But when I try to rehydrate the object I get an System.FormatException : Input string was not in a correct format. It seems that when Lightspeed hydrates the object it is using the PartyTypeconverter, but when it rehydrates it just assumes the value is an Int32.
|
|
|
Status update: I decided that for now I would live without being able to eat the cake, just looking for now. And by that I mean that I've changed the Data Type for my Discriminator from the fancy-schmancy enum into a bog standard String. That seems to alleviated a lot of bugs. It's just not quite as groovylicous. Now my only MAJOR problem that is holding me back from releasing the awesomeness is http://www.mindscapehq.com/forums/thread/729641 |
|