/** * Singleton access method * * @return the single instance of SumQueryService */ public static final SumQueryService getInstance() { if (instance == null) { instance = new SumQueryService(); try { Document doc = instance.openDocument(); instance.readQueries(doc); } catch (DocumentException e) { e.printStackTrace(); } } return instance; }
/** * A convenience method for getting a named query from the service. * * @param name * @return SumNativeQuery */ public static SumNativeQuery getQuery(String name) { return (SumNativeQuery) SumQueryService.getInstance().getQueries().get(name); }