Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
usfalami committed Aug 27, 2024
1 parent 0156a27 commit 8199e14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/usf/jquery/web/ArgumentParsers.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static JDBCArgumentParser jdbcArgParser(@NonNull JDBCType type) {
public static JavaArgumentParser jqueryArgParser(@NonNull JQueryType type) {
switch (type) {
case QUERY_COLUMN: return RequestEntryChain::evalQueryColumn;
case NAMED_COLUMN: return (e,v)-> e.evalColumn(v, true, false);
case NAMED_COLUMN: return (e,v)-> e.evalColumn(v, true, true); //separate query context
case COLUMN: return (e,v)-> e.evalColumn(v, false, false);
case FILTER: return RequestEntryChain::evalFilter;
case ORDER: return RequestEntryChain::evalOrder;
Expand Down
13 changes: 6 additions & 7 deletions src/main/java/org/usf/jquery/web/RequestEntryChain.java
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,12 @@ private Optional<ViewResource> lookupResource(ViewDecorator td) { //do not chang
}

private Optional<ViewResource> lookupViewResource(ViewDecorator td, Predicate<TypedOperator> pre) {
if(td instanceof QueryDecorator qd) { //query column
return ofNullable(qd.column(value))
.map(c-> new ViewResource(td, null, requireNoArgs(), c)); //no column decorator
}
return currentContext().lookupRegisteredColumn(value)
.map(cd-> new ViewResource(td, cd, requireNoArgs(), td.column(cd)))
.or(()-> lookupOperation(td, null, pre).map(col-> new ViewResource(td, null, this, col))); //no column decorator
var res = td instanceof QueryDecorator qd
? ofNullable(qd.column(value))
.map(c-> new ViewResource(td, null, requireNoArgs(), c))
: currentContext().lookupRegisteredColumn(value)
.map(cd-> new ViewResource(td, cd, requireNoArgs(), td.column(cd)));
return res.or(()-> lookupOperation(td, null, pre).map(col-> new ViewResource(td, null, this, col)));
}

private Optional<OperationColumn> lookupOperation(ViewDecorator vd, DBColumn col, Predicate<TypedOperator> opr) {
Expand Down

0 comments on commit 8199e14

Please sign in to comment.