Commits

tbrugz committed 8b29524

small optimization change

  • Participants
  • Parent commits 100d029

Comments (0)

Files changed (2)

File src/tbrugz/queryon/QueryOn.java

 		//XXX: validate column names
 		
 		ActionType atype = null;
+		DBIdentifiable dbobj = null;
 		//StatusObject sobject = StatusObject.valueOf(reqspec.object)
 		if(Arrays.asList(STATUS_OBJECTS).contains(reqspec.object)) {
 			atype = ActionType.STATUS;
 		}
 		else {
-			DBIdentifiable dbobj = SchemaModelUtils.getDBIdentifiableBySchemaAndName(model, reqspec);
+			dbobj = SchemaModelUtils.getDBIdentifiableBySchemaAndName(model, reqspec);
 			if(dbobj==null) {
 				throw new ServletException("unknown object: "+reqspec.object);
 			}
 		
 		try {
 			switch (atype) {
-			//TODO: use dbobj!
 			case SELECT: {
-				Relation rel = SchemaModelUtils.getTable(model, reqspec, true); //XXX: option to search views based on property?
+				Relation rel = (Relation) dbobj; 
+				if(rel==null) {
+					log.warn("strange... rel is null");
+					rel = SchemaModelUtils.getTable(model, reqspec, true); //XXX: option to search views based on property?
+				}
 				doSelect(rel, reqspec, resp);
 				}
 				break;
 			case EXECUTE:
-				ExecutableObject eo = SchemaModelUtils.getExecutable(model, reqspec);
+				ExecutableObject eo = (ExecutableObject) dbobj;
+				if(eo==null) {
+					log.warn("strange... eo is null");
+					eo = SchemaModelUtils.getExecutable(model, reqspec);
+				}
 				doExecute(eo, reqspec, resp);
 				break;
 			case STATUS:

File src/tbrugz/queryon/resultset/BaseResultSetCollectionAdapter.java

 		this(name, uniqueCols, allCols, false, value);
 	}
 
+	//XXX: change 'E value' to 'Class<E> clazz'?
 	public BaseResultSetCollectionAdapter(String name, List<String> uniqueCols, List<String> allCols, boolean onlyUniqueCols, E value) throws IntrospectionException {
 		this.name = name;