3 date: 2019-09-27T18:51:08+02:00
6 parent: Persistence APIs
13 The `javax.sql` based implementation. It does not require any dependencies outside from standard JDK classes.
20 In order to use `YoSQL` together with [Maven](https://maven.apache.org/), take a look at the tooling [documentation
21 for Maven](/tooling/maven/).
28 <groupId>wtf.metio.yosql</groupId>
29 <artifactId>yosql-tooling-maven</artifactId>
43 In order to use `YoSQL` together with [Gradle](https://gradle.org/), take a look at the tooling [documentation for Gradle](/tooling/gradle/).
59 In order to use `YoSQL` together with [Bazel](https://bazel.build/), take a look at the tooling [documentation for
60 Bazel](/tooling/bazel/).
64 In order to use YoSQL on the command line, take a look at the tooling [documentation for CLI](/tooling/cli/).
67 $ yosql --apis-dao-api=JDBC
70 The shorter form is available as well:
73 $ yosql --dao-api=JDBC
78 The JDBC API offers no built-in object mapping mechanism. In order to use high level types of your domain, use a converter to map results to your types.
82 -- converter: my.own.UserConverter
87 You can either specify the fully-qualified name of the converter or use its alias. The result type is read from the converter configuration as well. This in turn changes the generated code into this:
90 // uses "User" as type argument for all return types
91 List<User> findUsers()
92 Stream<User> findUsersStreamEager()
93 Stream<User> findUsersStreamLazy()
94 Flowable<User> findUsersFlow()
97 `my.own.UserConverter` could look like this:
102 import java.sql.ResultSet;
103 import java.sql.SQLException;
106 import my.own.persistence.util.ResultState;
108 public class UserConverter {
110 public final User asUserType(final ResultState result) throws SQLException {
111 final ResultSet resultSet = result.getResultSet();
112 final User pojo = new User();
113 pojo.setId(resultSet.getInt("id"));
114 pojo.setName(resultSet.getString("name"));