Ejemplo n.º 1
0
  public ArrayList<SuggestedValuesOption> getSuggestedValues() {
    ArrayList<SuggestedValuesOption> result = new ArrayList<SuggestedValuesOption>();
    result.addAll(options);

    if (query != null) {
      try {
        result.addAll(DatabaseManager.getInstance().getSuggestedValues(query));
      } catch (SQLException e) {
        e.printStackTrace();
      }
    }
    return result;
  }
Ejemplo n.º 2
0
 public Collection<String> getPrimaryKeyWhereClauseNames() {
   if (consistsOfSingleFromVariable()) {
     Table table = ((FromVariable) expression.getWords().get(0)).getObject().getTable();
     Collection<String> res = new ArrayList<String>();
     Iterator<Field> iter = table.getPrimaryKeyFields().iterator();
     while (iter.hasNext()) {
       Field field = iter.next();
       res.add(acceptWhereClauseFullName(DatabaseManager.getInstance().getQueryBuilder(), field));
     }
     return res;
   } else {
     System.err.println("Error : trying to get a field from a variable that does not know it");
     return null;
   }
 }