Home » Support » Forum » Search through collection for value using index

Search through collection for value using index

#1

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.

#2

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)

Post Reply

To post a reply and/or subscribe to update notifications - please login