Package ome.services.query
Class HierarchyNavigator
- java.lang.Object
-
- ome.services.query.HierarchyNavigator
-
- Direct Known Subclasses:
HierarchyNavigatorWrap
public class HierarchyNavigator extends java.lang.ObjectQuery the database for relationships between model objects. Caches results, so designed for a short lifetime.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description protected ome.api.IQueryiQueryavailable query service
-
Constructor Summary
Constructors Modifier Constructor Description protectedHierarchyNavigator(ome.api.IQuery iQuery)Construct a new hierarchy navigator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.google.common.collect.ImmutableSet<java.lang.Long>doLookup(java.lang.String toType, java.lang.String fromType, java.lang.Long fromId)Look up which objects of a given type relate to the given query object.protected voidprepareLookups(java.lang.String toType, java.lang.String fromType, java.util.Collection<java.lang.Long> fromIds)Batch bulk database queries to prime the cache fordoLookup(String, String, Long).
-
-
-
Method Detail
-
prepareLookups
protected void prepareLookups(java.lang.String toType, java.lang.String fromType, java.util.Collection<java.lang.Long> fromIds)Batch bulk database queries to prime the cache fordoLookup(String, String, Long). It is not necessary to call this method, but it is advised if many lookups are anticipated.- Parameters:
toType- the type of the objects to which the query objects may be related, notnullfromType- the query object's type, notnullfromIds- the query objects' database IDs, nonenull
-
doLookup
protected com.google.common.collect.ImmutableSet<java.lang.Long> doLookup(java.lang.String toType, java.lang.String fromType, java.lang.Long fromId)Look up which objects of a given type relate to the given query object. Caches results, and one may bulk-cache results in advance usingprepareLookups(String, String, Collection).- Parameters:
toType- the type of the objects to which the query object may be related, notnullfromType- the query object's type, notnullfromId- the query object's database ID, notnull- Returns:
- the related objects' database IDs, never
null
-
-