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

torand / FasterSQL / 13389227868

18 Feb 2025 11:10AM UTC coverage: 59.667% (+0.9%) from 58.785%
13389227868

push

github

torand
test: H2 specific testing of select and insert clauses

157 of 346 branches covered (45.38%)

Branch coverage included in aggregate %.

846 of 1335 relevant lines covered (63.37%)

3.35 hits per line

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

57.14
/src/main/java/io/github/torand/fastersql/statement/Statements.java
1
/*
2
 * Copyright (c) 2024 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.statement;
17

18
import io.github.torand.fastersql.Table;
19
import io.github.torand.fastersql.projection.Projection;
20

21
import java.util.Collection;
22
import java.util.List;
23

24
import static io.github.torand.fastersql.util.collection.CollectionHelper.asNonEmptyList;
25
import static java.util.Objects.requireNonNull;
26

27
public final class Statements {
28
    private Statements() {}
29

30
    /*public static SelectFromBuilder select(Object value) {
31
        return new SelectFromBuilder(false, singletonList($(value)));
32
    }*/
33

34
    public static SelectFromBuilder select(Projection firstProjection, Projection... moreProjections) {
35
        requireNonNull(firstProjection, "First projection is null");
4✔
36
        List<Projection> projections = asNonEmptyList(firstProjection, moreProjections);
4✔
37
        return new SelectFromBuilder(false, projections);
6✔
38
    }
39

40
    public static SelectFromBuilder selectDistinct(Projection firstProjection, Projection... moreProjections) {
41
        requireNonNull(firstProjection, "First projection is null");
×
42
        List<Projection> projections = asNonEmptyList(firstProjection, moreProjections);
×
43
        return new SelectFromBuilder(true, projections);
×
44
    }
45

46
    public static UpdateStatement update(Table<?> table) {
47
        return new UpdateStatement(table, null, null);
7✔
48
    }
49

50
    public static DeleteFromBuilder delete() {
51
        return new DeleteFromBuilder();
4✔
52
    }
53

54
    public static DeleteStatement deleteFrom(Table<?> table) {
55
        return new DeleteStatement(table, null);
×
56
    }
57

58
    public static TruncateTableBuilder truncate() {
59
        return new TruncateTableBuilder();
4✔
60
    }
61

62
    public static TruncateStatement truncateTable(Table<?> table) {
63
        return new TruncateStatement(table);
×
64
    }
65

66
    public static InsertIntoBuilder insert() {
67
        return new InsertIntoBuilder();
4✔
68
    }
69

70
    public static InsertStatement insertInto(Table<?> table) {
71
        return new InsertStatement(table, null);
×
72
    }
73

74
    public static <T> InsertBatchIntoBuilder<T> insertBatch(Collection<T> entities) {
75
        return new InsertBatchIntoBuilder<>(entities);
5✔
76
    }
77
}
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