Skip to content

Commit aa02f56

Browse files
author
Nikolai Malygin
committed
some javadoc
1 parent 084efc2 commit aa02f56

File tree

8 files changed

+82
-5
lines changed

8 files changed

+82
-5
lines changed

src/main/java/com/nmalygin/superb/jdbc/api/Query.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,12 @@
3232
* @author Nikolai Malygin
3333
*/
3434
public interface Query extends Appendable<Query> {
35+
/**
36+
*
37+
* @param resultSetHandler handler of result set of the query
38+
* @return Result of the resultSetHandler work
39+
* @param <R> Type of the resultSetHandler result
40+
* @throws SQLException SQLException
41+
*/
3542
<R> R executeWith(ResultSetHandler<R> resultSetHandler) throws SQLException;
3643
}

src/main/java/com/nmalygin/superb/jdbc/api/ResultSetHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public interface ResultSetHandler<R> {
4040
*
4141
* @param resultSet ResultSet
4242
* @return Some object after processing resultSet
43-
* @throws SQLException
43+
* @throws SQLException SQLException
4444
*/
4545
R handle(ResultSet resultSet) throws SQLException;
4646
}

src/main/java/com/nmalygin/superb/jdbc/api/Transaction.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,36 @@
3232
* @author Nikolai Malygin
3333
*/
3434
public interface Transaction extends Queries, Changes, Batches, AutoCloseable {
35+
/**
36+
*
37+
* @throws SQLException SQLException
38+
*/
3539
void commit() throws SQLException;
40+
41+
/**
42+
*
43+
* @param name savepoint name
44+
* @throws SQLException SQLException
45+
*/
3646
void setSavepoint(String name) throws SQLException;
47+
48+
/**
49+
*
50+
* @throws SQLException SQLException
51+
*/
3752
void rollback() throws SQLException;
53+
54+
/**
55+
*
56+
* @param savepoint savepoint name
57+
* @throws SQLException SQLException
58+
*/
3859
void rollbackTo(String savepoint) throws SQLException;
60+
61+
/**
62+
*
63+
* @throws SQLException SQLException
64+
*/
3965
@Override
4066
void close() throws SQLException;
4167
}

src/main/java/com/nmalygin/superb/jdbc/api/Transactions.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,20 @@
3434
public interface Transactions {
3535
/**
3636
* @return New transaction with default isolation level
37-
* @throws SQLException
37+
* @throws SQLException SQLException
3838
*/
3939
Transaction transaction() throws SQLException;
4040

4141
/**
4242
*
43-
* @param isolationLevel
43+
* @param isolationLevel the transaction isolation level.
44+
* Level one of the following {@code Connection} constants:
45+
* {@code Connection.TRANSACTION_READ_UNCOMMITTED},
46+
* {@code Connection.TRANSACTION_READ_COMMITTED},
47+
* {@code Connection.TRANSACTION_REPEATABLE_READ}, or
48+
* {@code Connection.TRANSACTION_SERIALIZABLE}.
4449
* @return New transaction with the isolationLevel
45-
* @throws SQLException
50+
* @throws SQLException SQLException
4651
*/
4752
Transaction transaction(int isolationLevel) throws SQLException;
4853
}

src/main/java/com/nmalygin/superb/jdbc/api/handlers/ColumnToListRsh.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,29 @@
3232
import java.util.ArrayList;
3333
import java.util.List;
3434

35+
/**
36+
* ColumnToListRsh
37+
*
38+
* @author Nikolai Malygin
39+
*/
3540
public class ColumnToListRsh<T> implements ResultSetHandler<List<T>> {
3641

3742
private final Column<T> column;
3843

44+
/**
45+
*
46+
* @param column typed column
47+
*/
3948
public ColumnToListRsh(Column<T> column) {
4049
this.column = column;
4150
}
4251

52+
/**
53+
*
54+
* @param resultSet ResultSet
55+
* @return list values of the column
56+
* @throws SQLException SQLException
57+
*/
4358
@Override
4459
public List<T> handle(final ResultSet resultSet) throws SQLException {
4560
final List<T> list = new ArrayList<>();

src/main/java/com/nmalygin/superb/jdbc/api/handlers/columns/Column.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public interface Column<T> {
3737
*
3838
* @param resultSet Result set on the specific row
3939
* @return The value
40-
* @throws SQLException
40+
* @throws SQLException If cell value do not get from the resultSet
4141
*/
4242
T cellValue(ResultSet resultSet) throws SQLException;
4343
}

src/main/java/com/nmalygin/superb/jdbc/api/handlers/columns/StringColumn.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,29 @@
2727
import java.sql.ResultSet;
2828
import java.sql.SQLException;
2929

30+
/**
31+
* StringColumn
32+
*
33+
* @author Nikolai Malygin
34+
*/
3035
public class StringColumn implements Column<String> {
3136

3237
private final String name;
3338

39+
/**
40+
*
41+
* @param name column name
42+
*/
3443
public StringColumn(String name) {
3544
this.name = name;
3645
}
3746

47+
/**
48+
*
49+
* @param resultSet Result set on the specific row
50+
* @return value of a cell in the row for the column
51+
* @throws SQLException SQLException
52+
*/
3853
@Override
3954
public String cellValue(ResultSet resultSet) throws SQLException {
4055
return resultSet.getString(name);

src/main/java/com/nmalygin/superb/jdbc/real/RealRdbms.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,19 @@
3030
import java.sql.Connection;
3131
import java.sql.SQLException;
3232

33+
/**
34+
* RealRdbms
35+
*
36+
* @author Nikolai Malygin
37+
*/
3338
public final class RealRdbms implements Rdbms {
3439

3540
private final DataSource dataSource;
3641

42+
/**
43+
*
44+
* @param dataSource DataSource
45+
*/
3746
public RealRdbms(final DataSource dataSource) {
3847
this.dataSource = dataSource;
3948
}

0 commit comments

Comments
 (0)