Skip to content

Commit 8dbe766

Browse files
author
synapticloop
committed
Updated comments, h2zero re-gen
1 parent eeb3eb0 commit 8dbe766

8 files changed

+234
-40
lines changed

h2zero-test.db

100 KB
Binary file not shown.

sample.db

100 KB
Binary file not shown.

src/test/java/com/synapticloop/sample/h2zero/sqlite3/test/util/DatabaseSetupTest.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
// (tests/java-sqlite3-database-test-base.templar)
66

77

8+
import static org.junit.Assert.*;
9+
810
import com.mchange.v2.c3p0.ComboPooledDataSource;
9-
import com.synapticloop.h2zero.base.manager.BaseConnectionManager;
10-
import com.synapticloop.h2zero.base.manager.sqlite3.ConnectionManager;
11-
import org.junit.AfterClass;
1211
import org.junit.BeforeClass;
12+
import org.junit.AfterClass;
13+
import com.synapticloop.h2zero.base.manager.sqlite3.ConnectionManager;
14+
import com.synapticloop.h2zero.base.manager.BaseConnectionManager;
1315

1416
import java.beans.PropertyVetoException;
1517
import java.io.BufferedReader;
16-
import java.io.File;
1718
import java.io.IOException;
19+
import java.io.File;
1820
import java.io.InputStreamReader;
1921
import java.sql.Connection;
2022
import java.sql.PreparedStatement;

src/test/java/com/synapticloop/sample/h2zero/sqlite3/updater/AuthorUpdater.java

+36-36
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ public static int updateNumFollowers(Connection connection, Long numFollowersSet
7171
*
7272
* @return The number of rows that were updated or -1 on error
7373
*/
74-
public static int updateNumFollowers(Long numFollowersSet) throws SQLException {
74+
public static int updateNumFollowers(Long numFollowersSet, ) throws SQLException {
7575
try (Connection connection = ConnectionManager.getConnection()) {
76-
return(updateNumFollowers(connection, numFollowersSet));
76+
return(updateNumFollowers(connection, numFollowersSet, ));
7777
}
7878
}
7979

@@ -86,9 +86,9 @@ public static int updateNumFollowers(Long numFollowersSet) throws SQLException {
8686
*
8787
* @return The number of rows that were updated or -1 on error
8888
*/
89-
public static int updateNumFollowersSilent(Long numFollowersSet) {
89+
public static int updateNumFollowersSilent(Long numFollowersSet, ) {
9090
try (Connection connection = ConnectionManager.getConnection()) {
91-
return(updateNumFollowers(connection, numFollowersSet));
91+
return(updateNumFollowers(connection, numFollowersSet, ));
9292
} catch (SQLException sqlex) {
9393
if(LOGGER.isWarnEnabled()) {
9494
LOGGER.warn("SQLException updateNumFollowersSilent(): " + sqlex.getMessage());
@@ -126,9 +126,9 @@ public static int updateIdAuthor(Connection connection, Long idAuthorSet) throws
126126
*
127127
* @return The number of rows that were updated or -1 on error
128128
*/
129-
public static int updateIdAuthor(Long idAuthorSet) throws SQLException {
129+
public static int updateIdAuthor(Long idAuthorSet, ) throws SQLException {
130130
try (Connection connection = ConnectionManager.getConnection()) {
131-
return(updateIdAuthor(connection, idAuthorSet));
131+
return(updateIdAuthor(connection, idAuthorSet, ));
132132
}
133133
}
134134

@@ -141,9 +141,9 @@ public static int updateIdAuthor(Long idAuthorSet) throws SQLException {
141141
*
142142
* @return The number of rows that were updated or -1 on error
143143
*/
144-
public static int updateIdAuthorSilent(Long idAuthorSet) {
144+
public static int updateIdAuthorSilent(Long idAuthorSet, ) {
145145
try (Connection connection = ConnectionManager.getConnection()) {
146-
return(updateIdAuthor(connection, idAuthorSet));
146+
return(updateIdAuthor(connection, idAuthorSet, ));
147147
} catch (SQLException sqlex) {
148148
if(LOGGER.isWarnEnabled()) {
149149
LOGGER.warn("SQLException updateIdAuthorSilent(): " + sqlex.getMessage());
@@ -184,9 +184,9 @@ public static int updateIdAuthorNumFollowers(Connection connection, Long idAutho
184184
*
185185
* @return The number of rows that were updated or -1 on error
186186
*/
187-
public static int updateIdAuthorNumFollowers(Long idAuthorSet, Long numFollowersSet) throws SQLException {
187+
public static int updateIdAuthorNumFollowers(Long idAuthorSet, Long numFollowersSet, ) throws SQLException {
188188
try (Connection connection = ConnectionManager.getConnection()) {
189-
return(updateIdAuthorNumFollowers(connection, idAuthorSet, numFollowersSet));
189+
return(updateIdAuthorNumFollowers(connection, idAuthorSet, numFollowersSet, ));
190190
}
191191
}
192192

@@ -200,9 +200,9 @@ public static int updateIdAuthorNumFollowers(Long idAuthorSet, Long numFollowers
200200
*
201201
* @return The number of rows that were updated or -1 on error
202202
*/
203-
public static int updateIdAuthorNumFollowersSilent(Long idAuthorSet, Long numFollowersSet) {
203+
public static int updateIdAuthorNumFollowersSilent(Long idAuthorSet, Long numFollowersSet, ) {
204204
try (Connection connection = ConnectionManager.getConnection()) {
205-
return(updateIdAuthorNumFollowers(connection, idAuthorSet, numFollowersSet));
205+
return(updateIdAuthorNumFollowers(connection, idAuthorSet, numFollowersSet, ));
206206
} catch (SQLException sqlex) {
207207
if(LOGGER.isWarnEnabled()) {
208208
LOGGER.warn("SQLException updateIdAuthorNumFollowersSilent(): " + sqlex.getMessage());
@@ -295,9 +295,9 @@ public static int setFlIsUpdating(Connection connection, Boolean flIsUpdatingSet
295295
*
296296
* @return The number of rows that were updated or -1 on error
297297
*/
298-
public static int setFlIsUpdating(Boolean flIsUpdatingSet) throws SQLException {
298+
public static int setFlIsUpdating(Boolean flIsUpdatingSet, ) throws SQLException {
299299
try (Connection connection = ConnectionManager.getConnection()) {
300-
return(setFlIsUpdating(connection, flIsUpdatingSet));
300+
return(setFlIsUpdating(connection, flIsUpdatingSet, ));
301301
}
302302
}
303303

@@ -310,9 +310,9 @@ public static int setFlIsUpdating(Boolean flIsUpdatingSet) throws SQLException {
310310
*
311311
* @return The number of rows that were updated or -1 on error
312312
*/
313-
public static int setFlIsUpdatingSilent(Boolean flIsUpdatingSet) {
313+
public static int setFlIsUpdatingSilent(Boolean flIsUpdatingSet, ) {
314314
try (Connection connection = ConnectionManager.getConnection()) {
315-
return(setFlIsUpdating(connection, flIsUpdatingSet));
315+
return(setFlIsUpdating(connection, flIsUpdatingSet, ));
316316
} catch (SQLException sqlex) {
317317
if(LOGGER.isWarnEnabled()) {
318318
LOGGER.warn("SQLException setFlIsUpdatingSilent(): " + sqlex.getMessage());
@@ -350,9 +350,9 @@ public static int setFlIsUpdatingWhereFlAuthorIsFollowedByUser(Connection connec
350350
*
351351
* @return The number of rows that were updated or -1 on error
352352
*/
353-
public static int setFlIsUpdatingWhereFlAuthorIsFollowedByUser(Boolean flIsUpdatingSet) throws SQLException {
353+
public static int setFlIsUpdatingWhereFlAuthorIsFollowedByUser(Boolean flIsUpdatingSet, ) throws SQLException {
354354
try (Connection connection = ConnectionManager.getConnection()) {
355-
return(setFlIsUpdatingWhereFlAuthorIsFollowedByUser(connection, flIsUpdatingSet));
355+
return(setFlIsUpdatingWhereFlAuthorIsFollowedByUser(connection, flIsUpdatingSet, ));
356356
}
357357
}
358358

@@ -365,9 +365,9 @@ public static int setFlIsUpdatingWhereFlAuthorIsFollowedByUser(Boolean flIsUpdat
365365
*
366366
* @return The number of rows that were updated or -1 on error
367367
*/
368-
public static int setFlIsUpdatingWhereFlAuthorIsFollowedByUserSilent(Boolean flIsUpdatingSet) {
368+
public static int setFlIsUpdatingWhereFlAuthorIsFollowedByUserSilent(Boolean flIsUpdatingSet, ) {
369369
try (Connection connection = ConnectionManager.getConnection()) {
370-
return(setFlIsUpdatingWhereFlAuthorIsFollowedByUser(connection, flIsUpdatingSet));
370+
return(setFlIsUpdatingWhereFlAuthorIsFollowedByUser(connection, flIsUpdatingSet, ));
371371
} catch (SQLException sqlex) {
372372
if(LOGGER.isWarnEnabled()) {
373373
LOGGER.warn("SQLException setFlIsUpdatingWhereFlAuthorIsFollowedByUserSilent(): " + sqlex.getMessage());
@@ -405,9 +405,9 @@ public static int setFlAuthorIsFollowedByUserWhereFlIsUpdating(Connection connec
405405
*
406406
* @return The number of rows that were updated or -1 on error
407407
*/
408-
public static int setFlAuthorIsFollowedByUserWhereFlIsUpdating(Boolean flAuthorIsFollowedByUserSet) throws SQLException {
408+
public static int setFlAuthorIsFollowedByUserWhereFlIsUpdating(Boolean flAuthorIsFollowedByUserSet, ) throws SQLException {
409409
try (Connection connection = ConnectionManager.getConnection()) {
410-
return(setFlAuthorIsFollowedByUserWhereFlIsUpdating(connection, flAuthorIsFollowedByUserSet));
410+
return(setFlAuthorIsFollowedByUserWhereFlIsUpdating(connection, flAuthorIsFollowedByUserSet, ));
411411
}
412412
}
413413

@@ -420,9 +420,9 @@ public static int setFlAuthorIsFollowedByUserWhereFlIsUpdating(Boolean flAuthorI
420420
*
421421
* @return The number of rows that were updated or -1 on error
422422
*/
423-
public static int setFlAuthorIsFollowedByUserWhereFlIsUpdatingSilent(Boolean flAuthorIsFollowedByUserSet) {
423+
public static int setFlAuthorIsFollowedByUserWhereFlIsUpdatingSilent(Boolean flAuthorIsFollowedByUserSet, ) {
424424
try (Connection connection = ConnectionManager.getConnection()) {
425-
return(setFlAuthorIsFollowedByUserWhereFlIsUpdating(connection, flAuthorIsFollowedByUserSet));
425+
return(setFlAuthorIsFollowedByUserWhereFlIsUpdating(connection, flAuthorIsFollowedByUserSet, ));
426426
} catch (SQLException sqlex) {
427427
if(LOGGER.isWarnEnabled()) {
428428
LOGGER.warn("SQLException setFlAuthorIsFollowedByUserWhereFlIsUpdatingSilent(): " + sqlex.getMessage());
@@ -460,9 +460,9 @@ public static int setFlIsUpdatingWhereFlAuthorIsFollowingUser(Connection connect
460460
*
461461
* @return The number of rows that were updated or -1 on error
462462
*/
463-
public static int setFlIsUpdatingWhereFlAuthorIsFollowingUser(Boolean flIsUpdatingSet) throws SQLException {
463+
public static int setFlIsUpdatingWhereFlAuthorIsFollowingUser(Boolean flIsUpdatingSet, ) throws SQLException {
464464
try (Connection connection = ConnectionManager.getConnection()) {
465-
return(setFlIsUpdatingWhereFlAuthorIsFollowingUser(connection, flIsUpdatingSet));
465+
return(setFlIsUpdatingWhereFlAuthorIsFollowingUser(connection, flIsUpdatingSet, ));
466466
}
467467
}
468468

@@ -475,9 +475,9 @@ public static int setFlIsUpdatingWhereFlAuthorIsFollowingUser(Boolean flIsUpdati
475475
*
476476
* @return The number of rows that were updated or -1 on error
477477
*/
478-
public static int setFlIsUpdatingWhereFlAuthorIsFollowingUserSilent(Boolean flIsUpdatingSet) {
478+
public static int setFlIsUpdatingWhereFlAuthorIsFollowingUserSilent(Boolean flIsUpdatingSet, ) {
479479
try (Connection connection = ConnectionManager.getConnection()) {
480-
return(setFlIsUpdatingWhereFlAuthorIsFollowingUser(connection, flIsUpdatingSet));
480+
return(setFlIsUpdatingWhereFlAuthorIsFollowingUser(connection, flIsUpdatingSet, ));
481481
} catch (SQLException sqlex) {
482482
if(LOGGER.isWarnEnabled()) {
483483
LOGGER.warn("SQLException setFlIsUpdatingWhereFlAuthorIsFollowingUserSilent(): " + sqlex.getMessage());
@@ -515,9 +515,9 @@ public static int setFlAuthorIsFollowingUserWhereFlIsUpdating(Connection connect
515515
*
516516
* @return The number of rows that were updated or -1 on error
517517
*/
518-
public static int setFlAuthorIsFollowingUserWhereFlIsUpdating(Boolean flAuthorIsFollowingUserSet) throws SQLException {
518+
public static int setFlAuthorIsFollowingUserWhereFlIsUpdating(Boolean flAuthorIsFollowingUserSet, ) throws SQLException {
519519
try (Connection connection = ConnectionManager.getConnection()) {
520-
return(setFlAuthorIsFollowingUserWhereFlIsUpdating(connection, flAuthorIsFollowingUserSet));
520+
return(setFlAuthorIsFollowingUserWhereFlIsUpdating(connection, flAuthorIsFollowingUserSet, ));
521521
}
522522
}
523523

@@ -530,9 +530,9 @@ public static int setFlAuthorIsFollowingUserWhereFlIsUpdating(Boolean flAuthorIs
530530
*
531531
* @return The number of rows that were updated or -1 on error
532532
*/
533-
public static int setFlAuthorIsFollowingUserWhereFlIsUpdatingSilent(Boolean flAuthorIsFollowingUserSet) {
533+
public static int setFlAuthorIsFollowingUserWhereFlIsUpdatingSilent(Boolean flAuthorIsFollowingUserSet, ) {
534534
try (Connection connection = ConnectionManager.getConnection()) {
535-
return(setFlAuthorIsFollowingUserWhereFlIsUpdating(connection, flAuthorIsFollowingUserSet));
535+
return(setFlAuthorIsFollowingUserWhereFlIsUpdating(connection, flAuthorIsFollowingUserSet, ));
536536
} catch (SQLException sqlex) {
537537
if(LOGGER.isWarnEnabled()) {
538538
LOGGER.warn("SQLException setFlAuthorIsFollowingUserWhereFlIsUpdatingSilent(): " + sqlex.getMessage());
@@ -570,9 +570,9 @@ public static int updateFlIsFollowing(Connection connection, Boolean flIsUpdatin
570570
*
571571
* @return The number of rows that were updated or -1 on error
572572
*/
573-
public static int updateFlIsFollowing(Boolean flIsUpdatingSet) throws SQLException {
573+
public static int updateFlIsFollowing(Boolean flIsUpdatingSet, ) throws SQLException {
574574
try (Connection connection = ConnectionManager.getConnection()) {
575-
return(updateFlIsFollowing(connection, flIsUpdatingSet));
575+
return(updateFlIsFollowing(connection, flIsUpdatingSet, ));
576576
}
577577
}
578578

@@ -585,9 +585,9 @@ public static int updateFlIsFollowing(Boolean flIsUpdatingSet) throws SQLExcepti
585585
*
586586
* @return The number of rows that were updated or -1 on error
587587
*/
588-
public static int updateFlIsFollowingSilent(Boolean flIsUpdatingSet) {
588+
public static int updateFlIsFollowingSilent(Boolean flIsUpdatingSet, ) {
589589
try (Connection connection = ConnectionManager.getConnection()) {
590-
return(updateFlIsFollowing(connection, flIsUpdatingSet));
590+
return(updateFlIsFollowing(connection, flIsUpdatingSet, ));
591591
} catch (SQLException sqlex) {
592592
if(LOGGER.isWarnEnabled()) {
593593
LOGGER.warn("SQLException updateFlIsFollowingSilent(): " + sqlex.getMessage());
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
2+
#
3+
# - - - - thoughtfully generated by synapticloop h2zero - - - -
4+
# with the use of synapticloop templar templating language
5+
# (/java/util/properties-create-application-properties-example.templar)
6+
#
7+
# This is an example .properties file which can be used (or ignored) as a quick
8+
# properties file for connecting to a specific database.
9+
## This also is used by the
10+
# com.synapticloop.sample.h2zero.mariadb.ConnectionManagerInitialiserOverride
11+
# example database initialiser.
12+
#
13+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
14+
15+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
16+
#
17+
# The following properties are required when no database exists and a new one is
18+
# being created.
19+
#
20+
# You cannot connect to a jdbc url with a database appended to it, so it is a
21+
# blank jdbc url
22+
#
23+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
24+
25+
db.initial.user=root
26+
db.initial.password=password
27+
db.initial.jdbcUrl=jdbc:mariadb://localhost:3306/
28+
29+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
30+
#
31+
# The following properties are used by the c3p0 database connection pool
32+
#
33+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
34+
35+
c3p0.user=root
36+
c3p0.password=password
37+
c3p0.jdbcUrl=jdbc:mariadb://localhost:3306/h2zero-test
38+
c3p0.maxPoolSize=20
39+
c3p0.minPoolSize=20
40+
c3p0.initialPoolSize=20
41+
42+
c3p0.acquireIncrement=3
43+
44+
c3p0.maxStatements=0
45+
c3p0.maxStatementsPerConnection=0
46+
47+
c3p0.acquireRetryAttempts=1
48+
c3p0.debugUnreturnedConnectionStackTraces=true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
2+
#
3+
# - - - - thoughtfully generated by synapticloop h2zero - - - -
4+
# with the use of synapticloop templar templating language
5+
# (/java/util/properties-create-application-properties-example.templar)
6+
#
7+
# This is an example .properties file which can be used (or ignored) as a quick
8+
# properties file for connecting to a specific database.
9+
## This also is used by the
10+
# com.synapticloop.sample.h2zero.mysql.ConnectionManagerInitialiserOverride
11+
# example database initialiser.
12+
#
13+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
14+
15+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
16+
#
17+
# The following properties are required when no database exists and a new one is
18+
# being created.
19+
#
20+
# You cannot connect to a jdbc url with a database appended to it, so it is a
21+
# blank jdbc url
22+
#
23+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
24+
25+
db.initial.user=root
26+
db.initial.password=password
27+
db.initial.jdbcUrl=jdbc:mysql://127.0.0.1:3306/
28+
29+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
30+
#
31+
# The following properties are used by the c3p0 database connection pool
32+
#
33+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
34+
35+
c3p0.user=root
36+
c3p0.password=password
37+
c3p0.jdbcUrl=jdbc:mysql://127.0.0.1:3306/h2zero-test
38+
c3p0.maxPoolSize=20
39+
c3p0.minPoolSize=20
40+
c3p0.initialPoolSize=20
41+
42+
c3p0.acquireIncrement=3
43+
44+
c3p0.maxStatements=0
45+
c3p0.maxStatementsPerConnection=0
46+
47+
c3p0.acquireRetryAttempts=1
48+
c3p0.debugUnreturnedConnectionStackTraces=true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
2+
#
3+
# - - - - thoughtfully generated by synapticloop h2zero - - - -
4+
# with the use of synapticloop templar templating language
5+
# (/java/util/properties-create-application-properties-example.templar)
6+
#
7+
# This is an example .properties file which can be used (or ignored) as a quick
8+
# properties file for connecting to a specific database.
9+
## This also is used by the
10+
# com.synapticloop.sample.h2zero.postgresql.ConnectionManagerInitialiserOverride
11+
# example database initialiser.
12+
#
13+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
14+
15+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
16+
#
17+
# The following properties are required when no database exists and a new one is
18+
# being created.
19+
#
20+
# You cannot connect to a jdbc url with a database appended to it, so it is a
21+
# blank jdbc url
22+
#
23+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
24+
25+
db.initial.user=root
26+
db.initial.password=password
27+
db.initial.jdbcUrl=jdbc:postgresql://localhost:5432/
28+
29+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
30+
#
31+
# The following properties are used by the c3p0 database connection pool
32+
#
33+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
34+
35+
c3p0.user=root
36+
c3p0.password=password
37+
c3p0.jdbcUrl=jdbc:postgresql://localhost:5432/h2zero-test
38+
c3p0.maxPoolSize=20
39+
c3p0.minPoolSize=20
40+
c3p0.initialPoolSize=20
41+
42+
c3p0.acquireIncrement=3
43+
44+
c3p0.maxStatements=0
45+
c3p0.maxStatementsPerConnection=0
46+
47+
c3p0.acquireRetryAttempts=1
48+
c3p0.debugUnreturnedConnectionStackTraces=true

0 commit comments

Comments
 (0)