ObjectDB ObjectDB

Custom collection types



  In our project in few places there are used collections from emf framework eg EcoreEMap http://download.eclipse.org/modeling/emf/emf/javadoc/2.5.0/org/eclipse/emf/ecore/util/EcoreEMap.html This is strange map for me, it implements List interface but does not implement Map interface, nevertheless it causes some questions.

I checked that i can easily change the type of collection between eg Vector, ArrayList, HashSet and all works fine, moreover Db-exploler does not show fields of this classes but only their content so I suppose that you treat collections some how differently. Can i achieve this for collections which are not in java.util package?

if this collection type will be used in first app release to allow data to be imported to db, can we next changed this type to standard implementation of Map collection?





If a persistent field type is one of java.util.Collection, java.util.List, java.util.Set or java.util.Map - it may contain also non standard collection types during persist.

However, in that case, on retrieval a standard collection instance (e.g. java.util.ArrayList) will be instantiated since instantiation of custom collection types by ObjectDB is not supported (unless defined and handled as ordinary entity / persistence capable classes).

ObjectDB Support


To post on this website please sign in.