Hi

In my opinion you should create a factory class in which you choose proper 
instance to select from database depend on given locale.

for example, if you support two locales you should have something like this:

interface Country {}

class CountryEnglish implement Country{}

class CountryFrench implements Country{}

then your factory class:
class CountryFactory {
   static Country getInctance(int localeId){
              if(localeId == ENGLISH){
                   return new CountryEnglish();
               }
              if(localeId == FRENCH){
                   return new CountryFrench();
               }
    }
}

and you should put EntityManager in those two class and call them to select 
from database instead of calling "em" directly.

hope this help.


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981514#3981514

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981514
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to