[ome-devel] Querying Annotations

Matthias Dunda Matthias.Dunda at carus-it.com
Thu Mar 5 15:23:32 GMT 2009


Hi,

I want to find all annotations to a Dataset. I added CommentAnnotations before and am now willing to read them out again...

First shot:

findAllByQuery("select a from Annotation a " +
                        "join DatasetAnnotationLink as dal " +
                        "where dal.parent = 1 ", null);

for dataset-ID = 1.

This gives me:

Exception in thread "main" omero.ApiUsageException
    serverStackTrace = "ome.conditions.ApiUsageException: Path expected for join! [select a from ome.model.annotations.Annotation a join DatasetAnnotationLink as dal where dal.parent = 1 ]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Path expected for join! [select a from ome.model.annotations.Annotation a join DatasetAnnotationLink as dal where dal.parent = 1 ]
                                at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:642)
                                at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
                                at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
                                .......

What's the right way?

Thanks
Matthias



More information about the ome-devel mailing list