• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

torand / FasterSQL / 15071216480

16 May 2025 02:49PM UTC coverage: 69.877% (+2.4%) from 67.475%
15071216480

push

github

web-flow
Merge pull request #30 from torand/access-support

Access support

229 of 414 branches covered (55.31%)

Branch coverage included in aggregate %.

105 of 152 new or added lines in 26 files covered. (69.08%)

3 existing lines in 3 files now uncovered.

1193 of 1621 relevant lines covered (73.6%)

3.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/io/github/torand/fastersql/predicate/InSubquery.java
1
/*
2
 * Copyright (c) 2024-2025 Tore Eide Andersen
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package io.github.torand.fastersql.predicate;
17

18
import io.github.torand.fastersql.Column;
19
import io.github.torand.fastersql.Context;
20
import io.github.torand.fastersql.alias.ColumnAlias;
21
import io.github.torand.fastersql.subquery.Subquery;
22

23
import java.util.stream.Stream;
24

25
import static io.github.torand.fastersql.Clause.RESTRICTION;
26
import static java.util.Objects.requireNonNull;
27

28
/**
29
 * Implements the 'member of set' predicate, using a set defined by a subquery.
30
 */
31
public class InSubquery implements Predicate {
32
    private final LeftOperand left;
33
    private final Subquery query;
34

NEW
35
    InSubquery(LeftOperand left, Subquery query) {
×
36
        this.left = requireNonNull(left, "No left operand specified");
×
NEW
37
        this.query = requireNonNull(query, "No right operand (query) specified");
×
38
    }
×
39

40
    // Sql
41

42
    @Override
43
    public String sql(Context context) {
44
        Context localContext = context.withClause(RESTRICTION);
×
NEW
45
        return left.sql(localContext) + " in " + query.sql(localContext);
×
46
    }
47

48
    @Override
49
    public Stream<Object> params(Context context) {
50
        Context localContext = context.withClause(RESTRICTION);
×
NEW
51
        return query.params(localContext);
×
52
    }
53

54
    @Override
55
    public Stream<Column> columnRefs() {
56
        return left.columnRefs();
×
57
    }
58

59
    @Override
60
    public Stream<ColumnAlias> aliasRefs() {
61
        return left.aliasRefs();
×
62
    }
63

64
    // Predicate
65

66
    @Override
67
    public String negatedSql(Context context) {
68
        Context localContext = context.withClause(RESTRICTION);
×
NEW
69
        return left.sql(localContext) + " not in " + query.sql(localContext);
×
70
    }
71
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc