simple abstract class that provides a common
creates a query based on the id string by interpreting it as a Class.
counts the number of members in a collection.
single-point of entry for walking of OME container hierarchies.
Query the database for relationships between model objects.
Convenience class for creating versions of
simple query subclass which uses the
always returns null for any id.
walks up the hierarchy tree starting at
base Query type to facilitate the creation of ORM queries.
query locator which is configured by Spring.
definition of a slot into which a
contract for any source of
simple HQL query.
interprets the query id as an HQL query.
something failed in looking up a query
ORM solutions like Hibernate, TopLink, and JDO provide mechanisms for storing
queries by name for faster lookups. Producing parameterizable queries,
however, is far more difficult. The
query package intends to make
writing such queries as easy as possible.
Effort has been placed into making certain activities, like walking (and fetching) OME hierarchies simpler. These queries are used heavily by the IContainer interface. Also, having this work available in code rather than the Strings of previous methods (XML files, Velocity templates, etc.) allows for significantly more reuse and easier re-factoring.
A second design goal is allowing clients to write queries themselves. Parameters allow for the passing of arbitrary arguments (like named arguments in dynamic languages), and the QueryFactory#lookup mechanism allows for a wide variety of client-definition styles. Probably the most useful is the saving of a QueryDefinition using IUpdate, and the subsequent lookup referring to the queryName. (NYI)
QueryFactory factory = new QueryFactory(new StringQuerySource()); Query q = factory.lookup("select p from Project p",null); List allProjects = (List) iQuery.execute( q );
QueryFactory factory = new QueryFactory(new ClassNameSource()); Query subclassQ = factory.lookup(PojosFindAnnotationsQueryDefinition.class.getName(), new Parameters().addIds(Collections.singleton(1L)).addClass(Image.class)); Query datasetQ = factory.lookup(Dataset.class, new Parameters( new Filter().unique() ).addString("name","16.3093-A93")); List imageAnnotations = (List) iQuery.execute( subclassQ ); Dataset dataset = (Dataset) iQuery.execute(datasetQ);
Copyright © 2016 The University of Dundee & Open Microscopy Environment. All Rights Reserved.