java - Is required new instance of LIST or SET in entity? -


i noticed in tutorials mapping columns in hibernate, initialize list(set). difference when don't use "new" , new arraylist()? can use new linkedlist() too? , set? same in list? , there same difference across versions of hibernate?

@entiy public class student implements serializable{ private list<string> subjects1; private list<string> subjects2 = new arraylist(); } 

or

@entiy public class student implements serializable{ private set<string> subjects1; private set<string> subjects2 = new hashset(); } 

like other collection, need create instance before can add elements. when load entity database, collection created, don't need it.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -