have you tried just using the "order", or "orderby" property in your mapping
for the list?

On Thu, Mar 4, 2010 at 5:49 AM, Marc Climent <[email protected]> wrote:

> I have found some articles about this particular subject but they do
> not solve what I want to achieve and I ran out of ideas.
>
> Right now I have a kind of localizable field which is is stored like
> in <a href="http://fabiomaulo.blogspot.com/2009/06/localized-property-
> with-nhibernate.html<http://fabiomaulo.blogspot.com/2009/06/localized-property-with-nhibernate.html>">this
> article</a>, using a UserType that
> serializes itself to a database field. This solution has worked for
> months but now a list must be sorted by a field of this type and the
> table contains a lot of rows, so sorting by this field forces us to
> retrieve all the entities on the table to get the value of the
> localizable string and sort them. That's pretty inefficient.
>
> Another complexity is that an entity can have several of this
> localizable properties so my idea was to create a couple of tables,
> one containing the reference to the entity and the field and the other
> containing the values for each particular language:
>
> Dictionary           |dict_id|entity_id|entity_field_name|
> DictionaryValues |dict_id|locale_id|value|
>
> This table structure can be mostly achieved as explained in <a
> href="http://www.webdevbros.net/2009/06/24/create-a-multi-languaged-
> domain-model-with-nhibernate-and-c/<http://www.webdevbros.net/2009/06/24/create-a-multi-languaged-domain-model-with-nhibernate-and-c/>">this
> other article</a>, but now I
> need to establish the link with the entity id and the entity field and
> I don't know how to do it using NHibernate in an elegant way (i.e.
> getting automatically the field name and looking for the right
> entity_field_name in the Dictionary table and not having to specify
> the current culture id but getting it from the current Thread).
>
> So, the thing becomes quite challenging for me right now and I'm sure
> that some solution can be found with some help.
>
> Any idea? (I promise a post on my blog whenever I find a good
> solution).
>
> --
> 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]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>


-- 
thanks

cliff

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