Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
usfalami committed Sep 11, 2024
1 parent b9bc158 commit 972059c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/org/usf/jquery/core/ViewJoin.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public final class ViewJoin implements DBObject {
//join results !?

public ViewJoin(JoinType joinType, DBView view, DBFilter[] filters) {
super();
this.joinType = joinType;
this.view = view;
this.filters = joinType == CROSS
Expand All @@ -39,15 +38,15 @@ public ViewJoin(JoinType joinType, DBView view, DBFilter[] filters) {
}

@Override
public String sql(QueryContext qv, Object[] args) {
public String sql(QueryContext ctx, Object[] args) {
requireNoArgs(args, ViewJoin.class::getSimpleName);
return sql(qv);
return sql(ctx);
}

public String sql(QueryContext ctx) {
var s = joinType + " JOIN " + view.sqlWithTag(ctx);
if(!isEmpty(filters)) {
var val = ctx.withValue();
var val = ctx.withValue(); //literal filter
s += " ON " + Stream.of(filters)
.map(f-> f.sql(val))
.collect(joining(AND.sql()));
Expand Down

0 comments on commit 972059c

Please sign in to comment.