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
|
Suppose I have an Entity User which has a property Password. The password isn't a simple string, but an custom object, that has a string property "Value".
What I want to achieve is to map the Password.Value string to the database column "Password" (nvarchar(24)) in the user-table.
How do I accomplish this?
//Daniel
|
|
|
We don't currently support this in the general case. However, if *ALL* fields of the Password type are mapped (or, equivalently, non-mapped fields are marked as [Transient]), then you can do this by marking the Password field with the ValueObjectAttribute. Note that the default expected column name for a value object field is a composite name e.g. if the value object field of type Password is called _password and the string field within the Password is called _value, then the database column is expected to be called PasswordValue. You can customise this using ColumnAttribute on the value object field (to modify the prefix) and the Password _value field (to modify the suffix), e.g. // in User class // in Password class |
|
|
Does this work for the "stable version" or is it for the nightly build?
I'm getting "The provided string argument [name] cannot be empty" for the Column attribute.
|
|
|
Mea culpa. We do currently have that restriction which prevents the approach I described. I have removed this restriction and the fix will be in the 9 June nightly build, available from about 1430 GMT. Apologies for the error. |
|