Commits

tbrugz committed 2fc0407

small docs changes

Comments (0)

Files changed (1)

src/tbrugz/queryon/QueryOn.java

 		EXECUTE, //~TODOne: execute action!
 		//QUERY,   //TODOne: SQLQueries action!
 		STATUS   //~TODOne: or CONFIG? show model, user, vars...
-		//XXX: FINDBYKEY action? return only the first result
+		//XXXxx: FINDBYKEY action? return only the first result
 	}
 	
 	public static final String SO_TABLE = "table", 
 		log.info(">> pathInfo: "+req.getPathInfo());
 		
 		RequestSpec reqspec = new RequestSpec(dsutils, req, prop);
-		
-		//XXX: validate column names
+		//XXX app-specific xtra parameters, like auth properties? app should extend QueryOn & implement addXtraParameters
 		
 		ActionType atype = null;
 		DBIdentifiable dbobj = null;
 		//StatusObject sobject = StatusObject.valueOf(reqspec.object)
+		//XXX should status object names have special syntax? like meta:table, meta:fk
 		if(Arrays.asList(STATUS_OBJECTS).contains(reqspec.object)) {
 			atype = ActionType.STATUS;
 		}
 	void doSelect(Relation relation, RequestSpec reqspec, HttpServletResponse resp) throws IOException, ClassNotFoundException, SQLException, NamingException, ServletException {
 		Connection conn = SQLUtils.ConnectionUtil.initDBConnection(CONN_PROPS_PREFIX, prop);
 		
-		//boolean isSQLWrapped = false;
-		
 		SQL sql = SQL.createSQL(relation, reqspec);
 		
 		Constraint pk = null;
 				if(c.type==ConstraintType.PK) { pk = c; break; }
 				if(c.type==ConstraintType.UNIQUE && uk == null) { uk = c; }
 			}
-			//XXXdone: search for unique key?
 			if(pk == null && uk != null) {
 				pk = uk;
 			}
 				log.warn("filter params defined "+reqspec.params+" but table '"+relation.getName()+"' has no PK or UNIQUE constraint");
 			}
 			else {
-				//Constraint pk = relation.getPKConstraint();
 				for(int i=0;i<pk.uniqueColumns.size();i++) {
 					if(reqspec.params.size()<=i) { break; }
 					//String s = reqspec.params.get(i);
 				log.warn("relation '"+relation.getName()+"' has no columns specified");
 			}
 		}
+		
+		//XXX app-specific xtra filters, like auth filters? app should extend QueryOn & implement addXtraConstraints
+		//appXtraConstraints(relation, sql, reqspec, req);
 
 		//limit-offset
-		//XXX: how to decide strategy? default is LimitOffsetStrategy.RESULTSET_CONTROL
+		//how to decide strategy? default is LimitOffsetStrategy.RESULTSET_CONTROL
 		//query type (table, view, query), resultsetType? (not avaiable at this point), database type
 		LimitOffsetStrategy loStrategy = LimitOffsetStrategy.getDefaultStrategy(model.getSqlDialect());
 		if(loStrategy!=LimitOffsetStrategy.RESULTSET_CONTROL) {
 		
 		//query finished!
 		log.info("sql:\n"+sql.getFinalSql());
+		//XXX log sql parameter values?
 		
 		PreparedStatement st = conn.prepareStatement(sql.getFinalSql());
 		for(int i=0;i<parametersToBind;i++) {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.