This content has been marked as final.
Show 1 reply
-
1. Re: Enumeration entities
atamur Nov 2, 2008 9:52 PM (in response to ipazmino)just use a @Startup application scoped component to preload data like this:
@Startup @Name("cityCache") @Scope(APPLICATION) public class CityCache { Map<String, City> cityByName; @Create public void preloadCities() { // populate cityByName map } public City findCity(String name) { return cityByName.get(name); } }
this approach apparently requires some synchronisation, but i haven't yet read the docs up to that point :)