Skip to content

Commit 9150b02

Browse files
olim7tadutra
authored andcommitted
JAVA-2151: Drop "Dsl" suffix from query builder main classes (apache#1188)
1 parent 2177de6 commit 9150b02

85 files changed

Lines changed: 271 additions & 251 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

changelog/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### 4.0.0-rc1 (in progress)
66

7+
- [improvement] JAVA-2151: Drop "Dsl" suffix from query builder main classes
78
- [new feature] JAVA-2144: Expose internal API to hook into the session lifecycle
89
- [improvement] JAVA-2119: Add PagingIterable abstraction as a supertype of ResultSet
910
- [bug] JAVA-2063: Normalize authentication logging

core/src/main/java/com/datastax/oss/driver/api/core/type/codec/TypeCodec.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ default boolean accepts(@NonNull DataType cqlType) {
204204
* <li>to format the INITCOND in {@link AggregateMetadata#describe(boolean)};
205205
* <li>in the {@code toString()} representation of some driver objects (such as {@link UdtValue}
206206
* and {@link TupleValue}), which is only used in driver logs;
207-
* <li>for literal values in the query builder (see {@code QueryBuilderDsl#literal(Object,
208-
* CodecRegistry)} and {@code QueryBuilderDsl#literal(Object, TypeCodec)}).
207+
* <li>for literal values in the query builder (see {@code QueryBuilder#literal(Object,
208+
* CodecRegistry)} and {@code QueryBuilder#literal(Object, TypeCodec)}).
209209
* </ol>
210210
*
211211
* If you choose not to implement this method, don't throw an exception but instead return a

integration-tests/src/test/java/com/datastax/oss/driver/osgi/OsgiBaseIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package com.datastax.oss.driver.osgi;
1717

18-
import static com.datastax.oss.driver.api.querybuilder.QueryBuilderDsl.selectFrom;
18+
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.selectFrom;
1919
import static org.assertj.core.api.Assertions.assertThat;
2020

2121
import com.datastax.oss.driver.api.core.CqlSession;

manual/query_builder/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To use it in your application, add the following dependency:
2121
Here is our canonical example rewritten with the query builder:
2222

2323
```java
24-
import static com.datastax.oss.driver.api.querybuilder.QueryBuilderDsl.*;
24+
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.*;
2525

2626
try (CqlSession session = CqlSession.builder().build()) {
2727

@@ -38,11 +38,11 @@ try (CqlSession session = CqlSession.builder().build()) {
3838

3939
#### Fluent API
4040

41-
All the starting methods are centralized in the [QueryBuilderDsl] class. To get started, add the
41+
All the starting methods are centralized in the [QueryBuilder] class. To get started, add the
4242
following import:
4343

4444
```java
45-
import static com.datastax.oss.driver.api.querybuilder.QueryBuilderDsl.*;
45+
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.*;
4646
```
4747

4848
Choose the method matching your desired statement, for example `selectFrom`. Then use your IDE's
@@ -183,6 +183,6 @@ For a complete tour of the API, browse the child pages in this manual:
183183
* [Terms](term/)
184184
* [Idempotence](idempotence/)
185185

186-
[QueryBuilderDsl]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/QueryBuilderDsl.html
187-
[SchemaBuilderDsl]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/SchemaBuilderDsl.html
188-
[CqlIdentifier]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/core/CqlIdentifier.html
186+
[QueryBuilder]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/QueryBuilder.html
187+
[SchemaBuilder]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/SchemaBuilder.html
188+
[CqlIdentifier]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/core/CqlIdentifier.html

manual/query_builder/condition/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You can also create it manually with one of the factory methods in [Condition],
1717
`if_()`:
1818

1919
```java
20-
import static com.datastax.oss.driver.api.querybuilder.QueryBuilderDsl.*;
20+
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.*;
2121

2222
Condition vCondition = Condition.column("v").isEqualTo(literal(1));
2323
deleteFrom("user")

manual/query_builder/delete/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
## DELETE
22

3-
To start a DELETE query, use one of the `deleteFrom` methods in [QueryBuilderDsl]. There are several
3+
To start a DELETE query, use one of the `deleteFrom` methods in [QueryBuilder]. There are several
44
variants depending on whether your table name is qualified, and whether you use case-sensitive
55
identifiers or case-insensitive strings:
66

77
```java
8-
import static com.datastax.oss.driver.api.querybuilder.QueryBuilderDsl.*;
8+
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.*;
99

1010
DeleteSelection delete = deleteFrom("user");
1111
```
@@ -141,5 +141,5 @@ deleteFrom("user")
141141
Conditions are a common feature used by UPDATE and DELETE, so they have a
142142
[dedicated page](../condition) in this manual.
143143

144-
[QueryBuilderDsl]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/QueryBuilderDsl.html
145-
[Selector]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/select/Selector.html
144+
[QueryBuilder]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/QueryBuilder.html
145+
[Selector]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/select/Selector.html

manual/query_builder/insert/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
## INSERT
22

3-
To start an INSERT query, use one of the `insertInto` methods in [QueryBuilderDsl]. There are
3+
To start an INSERT query, use one of the `insertInto` methods in [QueryBuilder]. There are
44
several variants depending on whether your table name is qualified, and whether you use
55
case-sensitive identifiers or case-insensitive strings:
66

77
```java
8-
import static com.datastax.oss.driver.api.querybuilder.QueryBuilderDsl.*;
8+
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.*;
99

1010
InsertInto insert = insertInto("user");
1111
```
@@ -87,4 +87,4 @@ insertInto("user").json(bindMarker()).usingTimestamp(bindMarker())
8787

8888
If you call the method multiple times, the last value will be used.
8989

90-
[QueryBuilderDsl]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/QueryBuilderDsl.html
90+
[QueryBuilder]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/QueryBuilder.html

manual/query_builder/relation/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,5 +201,5 @@ This should be used with caution, as it's possible to generate invalid CQL that
201201
execution time; on the other hand, it can be used as a workaround to handle new CQL features that
202202
are not yet covered by the query builder.
203203

204-
[QueryBuilderDsl]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/QueryBuilderDsl.html
205-
[Relation]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/relation/Relation.html
204+
[QueryBuilder]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/QueryBuilder.html
205+
[Relation]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/query-builder/relation/Relation.html

manual/query_builder/schema/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ one to *generate CQL DDL queries programmatically**. For example it could be us
88
* given a Java class that represents a table, view, or user defined type, generate representative
99
schema DDL `CREATE` queries.
1010

11-
Here is an example that demonstrates creating a keyspace and a table using [SchemaBuilderDsl]:
11+
Here is an example that demonstrates creating a keyspace and a table using [SchemaBuilder]:
1212

1313
```java
14-
import static com.datastax.oss.driver.api.querybuilder.SchemaBuilderDsl.*;
14+
import static com.datastax.oss.driver.api.querybuilder.SchemaBuilder.*;
1515

1616
try (CqlSession session = CqlSession.builder().build()) {
1717
CreateKeyspace createKs = createKeyspace("cycling").withSimpleStrategy(1);
@@ -44,4 +44,4 @@ element type:
4444
* [function](function/)
4545
* [aggregate](aggregate/)
4646

47-
[SchemaBuilderDsl]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/querybuilder/SchemaBuilderDsl.html
47+
[SchemaBuilder]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.html

manual/query_builder/schema/aggregate/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
## Aggregate
22

33
Aggregates enable users to apply User-defined functions (UDF) to rows in a data set and combine
4-
their values into a final result, for example average or standard deviation. [SchemaBuilderDsl]
4+
their values into a final result, for example average or standard deviation. [SchemaBuilder]
55
offers API methods for creating and dropping aggregates.
66

77
### Creating an aggregate (CREATE AGGREGATE)
88

9-
To start a `CREATE AGGREGATE` query, use `createAggregate` in [SchemaBuilderDsl]:
9+
To start a `CREATE AGGREGATE` query, use `createAggregate` in [SchemaBuilder]:
1010

1111
```java
12-
import static com.datastax.oss.driver.api.querybuilder.SchemaBuilderDsl.*;
12+
import static com.datastax.oss.driver.api.querybuilder.SchemaBuilder.*;
1313

1414
CreateAggregateStart create = createAggregate("average");
1515
```
@@ -76,4 +76,4 @@ dropAggregate("average").ifExists();
7676
// DROP AGGREGATE IF EXISTS average
7777
```
7878

79-
[SchemaBuilderDsl]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/querybuilder/SchemaBuilderDsl.html
79+
[SchemaBuilder]: http://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.html

0 commit comments

Comments
 (0)