Exemplo n.º 1
0
 public static Class<? extends BaseQueryItem> getQueryItemClass(BaseQueryCondition condition) {
   String queryConditionClassName = condition.getClass().getName();
   if (queryConditionClassName.endsWith("QueryCondition")) {
     String queryItemClassName =
         queryConditionClassName.substring(0, queryConditionClassName.length() - 9) + "Item";
     try {
       return (Class<? extends BaseQueryItem>) Class.forName(queryItemClassName);
     } catch (ClassNotFoundException cnfe) {
       throw new RuntimeException(cnfe);
     }
   } else {
     throw new RuntimeException("Item class for " + queryConditionClassName + " not found");
   }
 }
Exemplo n.º 2
0
 public static String getSqlQueryName(BaseQueryCondition condition) {
   return getSqlQueryName(condition.getClass());
 }