开发者

How to perform locale based sorting while using hibernate as ORM

I use server based sorting(in the db) using orderby clause. But now that I want to support multiple locales, how should I pass the locale information to the DB via hibernate开发者_如何学Python layer. I have pre-defined views to which I add criteria and order in the hibernate layer.


But now that I want to support multiple locales, how should I pass the locale information to the DB via hibernate layer.

Honestly, I'm not sure I understood exactly what you want to do but if you want to order by something in a query, that something should obviously be present at the database level. Maybe you could elaborate a bit or illustrate what you want to achieve with an example?

Just in case, here are some resources that might give some inspiration:

  • How to use a Collection of Elements to map a Map of [language_code]->[description]
  • How to map Internationalized data in Hibernate using a UserType
  • Implementing I18N relationships with JPA
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜