Skip to content

Commit 58aa0e1

Browse files
committed
Code style change
1 parent 365f2c6 commit 58aa0e1

121 files changed

Lines changed: 5557 additions & 4212 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.

.editorconfig

Lines changed: 1250 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/junit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: JUnit
22

3-
on: [push]
3+
on: [ push ]
44

55
jobs:
66
test:

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
<img src="https://user-images.githubusercontent.com/67344817/201498814-84314078-3f88-4930-aec1-d3f437e5c9e8.png" width="130px">
33

44
# AdvancedSQLClient
5+
56
Ultimate SQL client with intuitive query builders, Json support and more!<br>
6-
Before documentation is done, here is a <a href="https://github.com/ZorTik/AdvancedSQLClient/blob/master/src/main/java/me/zort/sqllib/Example.java">small example</a>.
7+
Before documentation is done, here is
8+
a <a href="https://github.com/ZorTik/AdvancedSQLClient/blob/master/src/main/java/me/zort/sqllib/Example.java">small
9+
example</a>.
710

811
![Badge](https://img.shields.io/jitpack/version/com.github.ZorTik/AdvancedSQLClient?style=for-the-badge) ![Badge](https://img.shields.io/github/license/ZorTik/AdvancedSQLClient?style=for-the-badge)
912
</div>
@@ -15,7 +18,9 @@ Before documentation is done, here is a <a href="https://github.com/ZorTik/Advan
1518
</p>-->
1619

1720
## Installation
18-
You can add AdvancedSQLClient to your build path using Maven or Gradle. You can also shade&relocate it using shade plugin to have it's unique build path.
21+
22+
You can add AdvancedSQLClient to your build path using Maven or Gradle. You can also shade&relocate it using shade
23+
plugin to have it's unique build path.
1924

2025
<a href="https://github.com/ZorTik/AdvancedSQLClient/wiki/Installation">Installation on Wiki</a>
2126

api/src/main/java/me/zort/sqllib/api/Executive.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
public interface Executive {
44

5-
SQLConnection getConnection();
5+
SQLConnection getConnection();
66

77
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package me.zort.sqllib.api;
22

33
public interface ISQLConnectionBuilder<C extends SQLConnection> {
4-
5-
C build(ISQLDatabaseOptions options);
6-
4+
5+
C build(ISQLDatabaseOptions options);
6+
77
}

api/src/main/java/me/zort/sqllib/api/ISQLDatabaseOptions.java

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,24 @@
55

66
public interface ISQLDatabaseOptions {
77

8-
void setAutoReconnect(boolean autoReconnect);
9-
void setDebug(boolean debug);
10-
void setLogSqlErrors(boolean logSqlErrors);
11-
void setNamingStrategy(NamingStrategy namingStrategy);
12-
void setGson(Gson gson);
13-
14-
boolean isAutoReconnect();
15-
boolean isDebug();
16-
boolean isLogSqlErrors();
17-
NamingStrategy getNamingStrategy();
18-
Gson getGson();
8+
void setAutoReconnect(boolean autoReconnect);
9+
10+
void setDebug(boolean debug);
11+
12+
void setLogSqlErrors(boolean logSqlErrors);
13+
14+
void setNamingStrategy(NamingStrategy namingStrategy);
15+
16+
void setGson(Gson gson);
17+
18+
boolean isAutoReconnect();
19+
20+
boolean isDebug();
21+
22+
boolean isLogSqlErrors();
23+
24+
NamingStrategy getNamingStrategy();
25+
26+
Gson getGson();
1927

2028
}

api/src/main/java/me/zort/sqllib/api/ObjectMapper.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88

99
public interface ObjectMapper {
1010

11-
void registerBackupValueResolver(@NotNull FieldValueResolver resolver);
12-
<T> T assignValues(Row row, Class<T> typeClass);
11+
void registerBackupValueResolver(@NotNull FieldValueResolver resolver);
1312

14-
interface FieldValueResolver {
15-
Object obtainValue(SQLConnection connection,
16-
AnnotatedElement element,
17-
Row row,
18-
String fieldName,
19-
String convertedName,
20-
Type type);
21-
}
13+
<T> T assignValues(Row row, Class<T> typeClass);
14+
15+
interface FieldValueResolver {
16+
Object obtainValue(SQLConnection connection,
17+
AnnotatedElement element,
18+
Row row,
19+
String fieldName,
20+
String convertedName,
21+
Type type);
22+
}
2223
}

api/src/main/java/me/zort/sqllib/api/Query.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,28 @@
44

55
/**
66
* This class represents a query.
7+
*
78
* @author ZorTik
89
*/
910
public interface Query {
1011

11-
String buildQuery();
12+
String buildQuery();
1213

13-
/**
14-
* Returns the highest parent of this query
15-
* tree.
16-
* @return The parent.
17-
*/
18-
default Query getAncestor() {
19-
return this;
20-
}
14+
/**
15+
* Returns the highest parent of this query
16+
* tree.
17+
*
18+
* @return The parent.
19+
*/
20+
default Query getAncestor() {
21+
return this;
22+
}
2123

22-
default boolean isAncestor() {
23-
return getAncestor() == this;
24-
}
24+
default boolean isAncestor() {
25+
return getAncestor() == this;
26+
}
2527

26-
default void errorSignal(SQLException e) {}
28+
default void errorSignal(SQLException e) {
29+
}
2730

2831
}

api/src/main/java/me/zort/sqllib/api/SQLConnection.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,30 @@
1313
*/
1414
public interface SQLConnection {
1515

16-
/**
17-
* Tries to connect to remote SQL server.
18-
*
19-
* @return True if connection was successful,
20-
* otherwise false.
21-
*/
22-
boolean connect();
23-
24-
/**
25-
* Tries to disconnect from remote SQL server.
26-
*/
27-
void disconnect();
28-
29-
/**
30-
* Returns current running connection with
31-
* SQL server.
32-
*
33-
* @return The connection.
34-
*/
35-
@Nullable
36-
Connection getConnection();
37-
38-
default boolean isConnected() {
39-
return getConnection() != null;
40-
}
16+
/**
17+
* Tries to connect to remote SQL server.
18+
*
19+
* @return True if connection was successful,
20+
* otherwise false.
21+
*/
22+
boolean connect();
23+
24+
/**
25+
* Tries to disconnect from remote SQL server.
26+
*/
27+
void disconnect();
28+
29+
/**
30+
* Returns current running connection with
31+
* SQL server.
32+
*
33+
* @return The connection.
34+
*/
35+
@Nullable
36+
Connection getConnection();
37+
38+
default boolean isConnected() {
39+
return getConnection() != null;
40+
}
4141

4242
}

api/src/main/java/me/zort/sqllib/api/SQLEndpoint.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
public interface SQLEndpoint {
44

5-
String buildJdbc();
6-
String getUsername();
7-
String getPassword();
5+
String buildJdbc();
86

9-
default boolean isValid() {
10-
return true;
11-
}
7+
String getUsername();
8+
9+
String getPassword();
10+
11+
default boolean isValid() {
12+
return true;
13+
}
1214

1315
}

0 commit comments

Comments
 (0)