Class HierarchyNavigator

  • Direct Known Subclasses:
    HierarchyNavigatorWrap

    public class HierarchyNavigator
    extends java.lang.Object
    Query 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.IQuery iQuery
      available query service
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected HierarchyNavigator​(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 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 for doLookup(String, String, Long).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • iQuery

        protected final ome.api.IQuery iQuery
        available query service
    • Constructor Detail

      • HierarchyNavigator

        protected HierarchyNavigator​(ome.api.IQuery iQuery)
        Construct a new hierarchy navigator.
        Parameters:
        iQuery - the query service
    • 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 for doLookup(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, not null
        fromType - the query object's type, not null
        fromIds - the query objects' database IDs, none null
      • 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 using prepareLookups(String, String, Collection).
        Parameters:
        toType - the type of the objects to which the query object may be related, not null
        fromType - the query object's type, not null
        fromId - the query object's database ID, not null
        Returns:
        the related objects' database IDs, never null