Nilesh Soni wrote:1) For getting PersistentList instead of PersistenBag, we have to implement IndexColumn annotation and hence we have to create an extra column into the table. Why on earth, such kind of weird requirement? What if I don't want to have a dedicated column in DB for such solution?
List semantic means that hibernate persists the lists index of each element. Because of that you have to define the column where the index will be persisted.
Personally, I would avoid bag semantic because it has drawbacks. You have to take a look at the generated SQL while using bag semantic. E.g. when you remove 1 element from a collection mapped with bag semantic, the generated SQL first deletes ALL elements from the collection and than inserts ALL elements except the removed one.
I for one would avoid bag semantic and use list or set semantic instead.
Relating your question with ArrayList: Maybe Im wrong, but AFAIK hibernate never uses ArrayList automatically. You have to change the List implementation by yourself.