ObjectDB ObjectDB

Search through collection for value using index


I have an entity that contains a java collection of a Long id of user entities that can modify it (many users can modify it).  I would like to be able to search for all entities that can be modified by a paticular user, since I will do this query often I would like to index it.  How would I tell ObjectDB to make an index and then use it in a query?

I have yet to deploy this entity so I could do something besides a java collection if there is a better approach.


You can define an index on a collection field as explained in the manual, and the index will be used automatically by queries when possible, so this is usually an efficient solution.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)


To post on this website please sign in.