01: package org.makumba.providers.query.hql;
02:
03: import org.makumba.commons.NamedResourceFactory;
04: import org.makumba.commons.NamedResources;
05: import org.makumba.providers.QueryAnalysis;
06: import org.makumba.providers.QueryAnalysisProvider;
07:
08: public class HQLQueryAnalysisProvider implements QueryAnalysisProvider {
09:
10: public QueryAnalysis getQueryAnalysis(String query) {
11: return getHqlAnalyzer(query);
12: }
13:
14: static public HqlAnalyzer getHqlAnalyzer(String hqlQuery) {
15: return (HqlAnalyzer) NamedResources.getStaticCache(
16: parsedHqlQueries).getResource(hqlQuery);
17: }
18:
19: public static int parsedHqlQueries = NamedResources
20: .makeStaticCache("Hibernate HQL parsed queries",
21: new NamedResourceFactory() {
22: private static final long serialVersionUID = 1L;
23:
24: protected Object makeResource(Object nm,
25: Object hashName) throws Exception {
26: return new HqlAnalyzer((String) nm);
27: }
28: }, true);
29:
30: }
|