-->
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.  [ 1 post ] 
Author Message
 Post subject: Internationalization: design exercise
PostPosted: Fri Oct 01, 2004 12:41 pm 
Newbie

Joined: Fri Oct 01, 2004 11:52 am
Posts: 1
Hello,

I would like to discuss the well-known internationalization problem with hibernate.

First, I would need a database schema
Code:
- Entity (ID:char32)
- Entity_Text (Entity_ID:char32, Locale_ID:char32, Description:varchar50)
- Locale (ID:char32)
With Entity_Text.Entity_ID refering to Entity.ID
and Entity_Text.Locale_ID refering to Locale.ID

Second, I would need a class model
Code:
- Entity with a public method getDescription() and a private HashMap of Entity_Text indexed by Locale
- Entity_Text with public methods getDescription() and getLocale()
- Locale

Behind Entity.getDescription(), we would have something like
Code:
this.HashMap.get(currentLocale).getDescription();

The main idea is to allow the following:
    - we can manage the fact that the currentLocale is modified at run-time
    - if no description exists for the current Locale, we can search for another description (see Locale search order - For example, if nothing was found with Locale "en_US", search with Locale "en")
Now my question: could you indicate me how should I proceed in order to load in the Hashmap of the Entity only the requested Locale(s) ? In fact, I would like to load only part of the collection. In other words, I would like to have a lazy loading on part of the collection.
If this is not (yet) possible, does someone know if it will possible with Hibernate 3.0 ? (with some filters ?)

Kind regards, Emmanuel


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

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.