Thanks for your reply. I now realise that I didn't uderstand what I actually wanted. I'd rather save the contents of the static collenction, than the collection itself.
But, anyway, can I persist single static collection object, after all?
*monu wrote:
There are couple of things you can do about this:
1)Map the models normally as you do and as you want (in hbm)
2)Using Xml you can feed and load the static data directly into the databse.
You are all set , though be sure of the following things too:
1) Make the classes mutabe by mutable=true
2) Do use the secondary cache - ehcache is a good option of course with the mode as readonly (be careful here: sometimes in memory things do cause issues as they are tightly binded to Hibernate -specially when you use sqlz ).
3) For mappings - sometimes it is a good option to keep assosiations egaer (ie lazy=false)
Many a times it also makes sense to load all the static data on startup.