[ome-devel] load object graph

Bernhard Voigt bernhard.voigt at gmail.com
Thu Nov 27 12:00:16 GMT 2008


Hi!

I'd like to know the best praxis to load object graphs of objects
which might not have the same childs. E.g. I'd like to get all
wellsamples taken for a given plate. I can do the following:

        query = '''
        select p from Plate p
        join fetch p.wells w
        join fetch w.wellSamples ws
        where p.id = %i
        ''' % plate.getId().val
        queryservice.findByQuery(query, None)

This works well, if there are wellsamples linked to the wells.
However, if the plate does not have wells and/or wellsamples, the
query returns no object at all. Is there a generic approach to the
problem of listing all plates including childs without querying
beforehand whether certain childs exist.

Thanks! Bernhard


More information about the ome-devel mailing list