Esempio n. 1
0
 /**
  * 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;
 }
Esempio n. 2
0
 /**
  * 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);
 }