What do you want? Do you need to add the result in the DB or is this a
transient property.

In any case, you need to run the SQL query in the getter as shiwn in
the documentation. If you need to cache the result in the database,
add [Property(Access=PropertyAccess.ReadOnly)] to the property. You
should remove the setter in any case.

-Markus

2010/1/18 the.email.tr...@gmail.com <the.email.tr...@gmail.com>:
> Hello,
>
> I have a table with this definition:
>
> [localizations]
>  + id
>  + resourceKey
>  + resourceValue
>  + cultureName
>
> My class is as follows
>
> public class Localization{
>        [PrimaryKey(PrimaryKeyType.Native, "id")]
>        public int Id  { get; set; }
>
>        [Property("resourceKey")]
>        [ValidateIsUnique]
>        public string ResourceKey { get; set; }
>
>        [Property("resourceValue")]
>        public string ResourceValue { get; set; }
>
>        [Property("resourceSet")]
>        public string ResourceSet { get; set; }
>
>        [Property("cultureName")]
>        public string CultureName { get; set; }
>
>        public string DefaultResourceValue{ get; set; }
> }
>
> Please note the DefaultResourceValue property which is not related to
> any field in the database.
>
> What I want is to execute this query (SQL as is)
>
> select  a.resourceKey, a.cultureName, a.resourceSet, a.resourceValue as
> defaultText, b.resourceValue
> from    localizations a join localizations b on a.id = b.id
> where   a.resourceSet='blacklist/edit' and (a.cultureName='' or
> a.cultureName='en')
>
> What I want to know is how to map the property DefaultResourceValue.
>
> How can I achive this in AR?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Castle Project Users" group.
> To post to this group, send email to castle-project-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> castle-project-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/castle-project-users?hl=en.
>
>
>
>
-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to castle-project-us...@googlegroups.com.
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.


Reply via email to