public abstract class HierarchyNavigatorWrap<T,E> extends HierarchyNavigator
HierarchyNavigator
with different model object representations.iQuery
Constructor and Description |
---|
HierarchyNavigatorWrap(ome.api.IQuery iQuery) |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableSet<E> |
doLookup(T toType,
E from)
Look up which objects of a given type relate to the given query object.
|
protected abstract java.util.Map.Entry<java.lang.String,java.lang.Long> |
entityToStringLong(E entity)
Convert a model object to the type string and database ID expected by
HierarchyNavigator . |
void |
prepareLookups(T toType,
java.util.Collection<E> from)
Batch bulk database queries to prime the cache for
doLookup(Object, Object) . |
protected abstract E |
stringLongToEntity(java.lang.String typeName,
long id)
Convert the given type string and database ID to the model object.
|
protected abstract T |
stringToType(java.lang.String typeName)
Convert the given type string to the object type.
|
protected abstract java.lang.String |
typeToString(T type)
Convert the given object type to the type strings expected by
HierarchyNavigator . |
doLookup, prepareLookups
protected abstract java.lang.String typeToString(T type)
HierarchyNavigator
.type
- an object typeprotected abstract T stringToType(java.lang.String typeName)
typeName
- a type stringprotected abstract java.util.Map.Entry<java.lang.String,java.lang.Long> entityToStringLong(E entity)
HierarchyNavigator
.entity
- a model objectprotected abstract E stringLongToEntity(java.lang.String typeName, long id)
typeName
- a type stringid
- a database IDpublic void prepareLookups(T toType, java.util.Collection<E> from)
doLookup(Object, Object)
.
It is not necessary to call this method, but it is advised if many lookups are anticipated.
Wraps HierarchyNavigator.prepareLookups(String, String, Collection)
.toType
- the type of the objects to which the query objects may be related, not null
from
- the query objects, none null
, may be of differing typespublic com.google.common.collect.ImmutableSet<E> doLookup(T toType, E from)
prepareLookups(Object, Collection)
.
Wraps HierarchyNavigator.doLookup(String, String, Long)
.toType
- the type of the objects to which the query object may be related, not null
from
- the query object, not null
null