-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Internationalized data in Hibernate
PostPosted: Tue Jul 20, 2004 9:31 am 
Newbie

Joined: Tue Jul 20, 2004 9:09 am
Posts: 1
Hi,

I'm new to Hibernate and I spotted the blog entry on the"Internationalized data" pattern that Gavin published on the 23rd june and liked what I saw. I've been looking for just such a pattern for some time now.

I've been trying to implement it but I'm a bit confused by the parts that I'm supposed to know and are not covered in the blog. Could someone explain how the Label.getDescription(code, language) method is implemented. I've tried to do this but I thought you needed a Session to do a query for the correct label. It also talks about the cache but I'm not sure how to use this.

...
Code:
return Label.getDescrption( code, User.current().getLanguage());


And I'm assuming this User object isn't a Hibernate object right? I want to use this pattern it in a web application so how do I specify what language I


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 20, 2004 10:35 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
The idea is that the codes/descriptions would have been pre-cached at application startup somewhere (aka, by your app). Thus Label.getDescrption(...) simply needs to look into that pre-cache for the appropriate value.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.