In my application, instead of flatfile, i used XML to have the key and value
(again these entries are used for drop down) and i read the values using
xPath api's.  Given that the country list is static as said before, i guess
it should be work fine.

Thanks
Hari

2010/7/10 cscsaba <strongfr...@gmail.com>

> Hello,
>
> I dont know the way of generating sequence 1,2,3 for countries by JPA.
> It generates keys which are not agree with country codes.
> Sorry, I was not clear enough.
>
> On júl. 9, 09:51, Nacho Coloma <icol...@gmail.com> wrote:
> > That seems like good advice. For this concrete use case there is a
> > country list included with your JDK:
> >
> > Locale[] locales = Locale.getAvailableLocales();
> > for (Locale locale : locales) {
> >     countries.add(new Option(locale.getCountry(),
> > locale.getDisplayCountry(currentLocale)));
> >
> > }
> >
> > On Jul 8, 7:11 pm, "Ikai L (Google)" <ika...@google.com> wrote:
> >
> > > Why not just load these from a flatfile and load it into local memory?
> The
> > > number of countries in the world is something that changes very
> > > infrequently.
> >
> > > On Mon, Jul 5, 2010 at 12:28 PM, cscsaba <strongfr...@gmail.com>
> wrote:
> > > > Hello,
> >
> > > > What is the best practice to generation sequence ids for persistence
> > > > classes like Country's id (for Country drop down)?
> > > > I mean:
> > > >   1.Hungary
> > > >   2.US
> > > >   3.Spain
> >
> > > > The well known Toplink annotation help suggest the following.
> >
> > > > @SequenceGenerator(name="CUST_SEQ", allocationSize=25)
> > > > @GeneratedValue(strategy=SEQUENCE, generator="CUST_SEQ")
> >
> > > > But the SEQUENCE strategy is invalid (underlined by Eclipse)
> >
> > > > Is there any real world GAE - JPA example with drop downs anywhere ?
> > > > What is the paved way to persisting classes with sequential ids ?
> >
> > > > Thanks in advance.
> >
> > > > cscsaba
> >
> > > > (Since there many case when we have to upload these entities from
> file with
> > > > their own ids  - Country, City and many more)
> >
> > > >  --
> > > > You received this message because you are subscribed to the Google
> Groups
> > > > "Google App Engine for Java" group.
> > > > To post to this group, send email to
> > > > google-appengine-j...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> <google-appengine-java%2bunsubscr...@googlegroups.com<google-appengine-java%252bunsubscr...@googlegroups.com>
> >
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-appengine-java?hl=en.
> >
> > > --
> > > Ikai Lan
> > > Developer Programs Engineer, Google App Engine
> > > Blog:http://googleappengine.blogspot.com
> > > Twitter:http://twitter.com/app_engine
> > > Reddit:http://www.reddit.com/r/appengine
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to