[Building Sakai] Help on how to query Sakai database

Virgílio Santos virgilio.santos at gmail.com
Wed Jul 9 08:04:55 PDT 2014


Hello,

I have a query do execute on Sakai database that I could not figured
out how to do with the available services. Basically, I want to query
all Sites that have some specific tool in at least one of its pages.

For know, I'm trying something like this (It's not the query I will
really use, just an example):

String sql = "SELECT * from SAKAI_SITE";
List<Site> siteList = null;

SQLQuery query = this.getSession().createSQLQuery(sql);
query.addEntity(Site.class);
query.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP);
List results = query.list();

for(Object object : results) {
    Site s = (Site) object;
    // do stuff
}

And getting this error:
org.sakaiproject.portal.api.PortalHandlerException:
org.sakaiproject.tool.api.ToolException:
org.springframework.web.util.NestedServletException: Request
processing failed; nested exception is org.hibernate.MappingException:
Unknown entity: org.sakaiproject.site.api.Site

Any tips on making complex data queries on Sakai database will be very
useful as well

Thanks in advance.

-- 
Deserve's Got Nothing To Do With It


More information about the sakai-dev mailing list