Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement 'jpx.jdbc' project. #2

Open
wants to merge 259 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
259 commits
Select commit Hold shift + click to select a range
f822948
Add 'hashCode' and 'equals' method.
jenetics Dec 22, 2016
e4628d8
Execute tests on H2DB.
jenetics Dec 22, 2016
4516274
Some DAO experiments.
jenetics Dec 22, 2016
4ad6d50
DAO experiments.
jenetics Dec 26, 2016
752b211
Add person creation method.
jenetics Dec 26, 2016
ab15b01
Add person creation method.
jenetics Dec 26, 2016
71ede89
Fix DB tests.
jenetics Dec 26, 2016
4d88c62
Merge remote-tracking branch 'origin/master' into issues/JPX-1-JDBC_a…
jenetics Dec 27, 2016
1888d10
Minor code improvements.
jenetics Jan 1, 2017
03c3689
#1: Some JDBC experiments.
jenetics Jan 5, 2017
a8e9609
#1: Extract 'RowParser' to top level class.
jenetics Jan 5, 2017
d7425d8
#1: Fix comments.
jenetics Jan 5, 2017
021c198
#1: Extract 'PreparedQuery' to top level class.
jenetics Jan 5, 2017
e3a5304
#1: Extract 'AbstractQuery' to top level class.
jenetics Jan 5, 2017
f78ac95
#1: Extract 'SQLQuery' to top level class.
jenetics Jan 5, 2017
d90897f
#1: Extract 'BatchQuery' to top level class.
jenetics Jan 5, 2017
697cc49
#1: Extract 'Param' to top level class.
jenetics Jan 5, 2017
64f58dd
#1: Implement query classes.
jenetics Jan 5, 2017
a157c13
#1: Rename 'PreparedQuery' to 'PreparedSQL'.
jenetics Jan 5, 2017
8807de8
#1: Implement query classes.
jenetics Jan 6, 2017
731167b
#1: Implement LinkDAO.
jenetics Jan 6, 2017
d71cab7
#1: Add Javadoc.
jenetics Jan 6, 2017
49dddfe
#1: Implement PersonDAO.
jenetics Jan 6, 2017
d34c814
#1: person.name non null.
jenetics Jan 6, 2017
bb21d1b
#1: Implement PersonDAO tests.
jenetics Jan 6, 2017
8ac618f
#1: Code simplification.
jenetics Jan 6, 2017
aeab477
#1: Code cleanup.
jenetics Jan 6, 2017
701b026
#1: Fix copyright info.
jenetics Jan 6, 2017
5bfb26e
#1: Code cleanup.
jenetics Jan 6, 2017
0770adb
#1: Add CopyrightDAO.
jenetics Jan 6, 2017
ce8f6f6
Merge remote-tracking branch 'origin/r1.0.1' into issues/JPX-1-JDBC_a…
jenetics Jan 6, 2017
64ad1a5
#1: Implement CopyrightDAO.
jenetics Jan 6, 2017
ba0afc5
#1: Add 'BoundsDAO' class.
jenetics Jan 6, 2017
9d095ea
#1: Improve data model.
jenetics Jan 6, 2017
552d5ae
#1: Simplify DB creation script.
jenetics Jan 7, 2017
6caedb5
#1: Add 'ResultSet' delegate class.
jenetics Jan 7, 2017
9040610
#1: Code improvements.
jenetics Jan 7, 2017
1f1c628
#1: Code improvements.
jenetics Jan 8, 2017
b768bd5
Merge remote-tracking branch 'origin/r1.1.0' into issues/JPX-1-JDBC_a…
jenetics Jan 8, 2017
aba6f54
Merge remote-tracking branch 'origin/r1.1.0' into issues/JPX-1-JDBC_a…
jenetics Jan 9, 2017
c63eaeb
#1: Code improvements.
jenetics Jan 9, 2017
1fe601c
#1: Implement MetadataDAO.insert method.
jenetics Jan 9, 2017
5866f40
#1: Implement 'MetadataDAO' object.
jenetics Jan 9, 2017
75c3b8c
#1: Move 'ListMapper' and 'OptionMapper' to top level.
jenetics Jan 9, 2017
6de17b2
#1: Improve DB creation scripts.
jenetics Jan 9, 2017
c5add1b
#1: Organize imports.
jenetics Jan 9, 2017
c943b4b
#1: Implement 'WayPointDAO' object.
jenetics Jan 10, 2017
22cb443
#1: Implement 'RouteDAO'.
jenetics Jan 10, 2017
1239968
#1: Implement 'TrackSegmentDAO'.
jenetics Jan 11, 2017
4541446
#1: Add DAO classes.
jenetics Jan 11, 2017
6511570
#1: Implement 'TrackLinkDAO'.
jenetics Jan 11, 2017
fc914d3
#1: Implement 'GPXDAO' object.
jenetics Jan 11, 2017
6f34832
#1: Improving 'LinkDAO' object.
jenetics Jan 11, 2017
0faa238
#1: Improve LinkDAO testint.
jenetics Jan 12, 2017
8ce2113
#1: Extracting common code.
jenetics Jan 12, 2017
023d877
#1: Fix copyright info.
jenetics Jan 12, 2017
9c6577c
#1: Code improvements.
jenetics Jan 12, 2017
9848ab1
#1: Code cleanup.
jenetics Jan 12, 2017
8044c4b
#1: Improve DAO tests.
jenetics Jan 12, 2017
7d10af5
#1: Improve DB model.
jenetics Jan 12, 2017
c2414eb
#1: Implement 'CopyrightDAO'.
jenetics Jan 13, 2017
81f2228
#1: Implement 'CopyrightDAO'.
jenetics Jan 13, 2017
12c454a
#1: Implement 'CopyrightDAO'.
jenetics Jan 13, 2017
51307ef
#1: Implement 'BoundsDAO' object.
jenetics Jan 13, 2017
3250fa6
#1: Implement 'MetadataDAO'.
jenetics Jan 13, 2017
63862be
#1: Fix equals method of Metadata.
jenetics Jan 13, 2017
b3c85ed
#1: Implement 'MetadataDAOTest' class.
jenetics Jan 13, 2017
a770833
#1: Implement 'MetadataDAOTest' class.
jenetics Jan 13, 2017
7e2a7f1
#1: Simplify code.
jenetics Jan 13, 2017
4e37ec7
#1: Organize imports.
jenetics Jan 13, 2017
afe8ec6
#1: Rename interface 'DeleteBy' to 'Delete'.
jenetics Jan 13, 2017
2739fe6
#1: Simplify code.
jenetics Jan 13, 2017
a71af7d
#1: Extract 'MetadataLink.Row' class.
jenetics Jan 13, 2017
2265863
Merge remote-tracking branch 'origin/r1.1.0' into issues/JPX-1-JDBC_a…
jenetics Jan 13, 2017
ef89b29
#1: Implement 'WayPointDAO' class.
jenetics Jan 14, 2017
91a44ba
#1: Implement 'RouteDAO'.
jenetics Jan 14, 2017
b2ccc21
#1: Experimental classes.
jenetics Jan 14, 2017
b7962f6
#1: Experimental classes.
jenetics Jan 14, 2017
381cd90
#1: Move 'AbstractQuery' into internal package.
jenetics Jan 14, 2017
7f0bb28
#1: Move 'BatchQuery' into internal package.
jenetics Jan 14, 2017
b1de916
#1: Move 'Column' into internal package.
jenetics Jan 14, 2017
3a14613
#1: Move 'DAO' into internal package.
jenetics Jan 14, 2017
e5b2374
#1: Move 'Delete' into internal package.
jenetics Jan 14, 2017
13749bc
#1: Move 'Diff' into internal package.
jenetics Jan 14, 2017
19584b6
#1: Move 'Insert' into internal package.
jenetics Jan 14, 2017
a7c9385
#1: Move 'ListMapper' into internal package.
jenetics Jan 14, 2017
5a4dcc0
#1: Move 'OptionMapper' into internal package.
jenetics Jan 14, 2017
139e3df
#1: Move 'Pair' into internal package.
jenetics Jan 14, 2017
8495224
#1: Move 'Param' into internal package.
jenetics Jan 14, 2017
ce27901
#1: Move 'Results' into internal package.
jenetics Jan 14, 2017
eadc83e
#1: Move 'RowParser' into internal package.
jenetics Jan 14, 2017
c166739
#1: Move 'SelectBy' into internal package.
jenetics Jan 14, 2017
800bd23
#1: Move 'SQL' into internal package.
jenetics Jan 14, 2017
c22ecd4
#1: Move 'SQLQuery' into internal package.
jenetics Jan 14, 2017
02580d8
#1: Move 'Stored' into internal package.
jenetics Jan 14, 2017
25938b7
#1: Move 'Tuple3' into internal package.
jenetics Jan 14, 2017
08281fb
#1: Move 'Update' into internal package.
jenetics Jan 14, 2017
368d33b
#1: Move 'PrepareSQL' into internal package.
jenetics Jan 14, 2017
6626b3e
#1: Move 'Lists' into internal package.
jenetics Jan 14, 2017
b38ab8e
#1: Fix visibility after refactorings.
jenetics Jan 14, 2017
ba268c0
#1: Prototype implementation.
jenetics Jan 15, 2017
a9dc797
Merge remote-tracking branch 'origin/master' into issues/JPX-1-JDBC_a…
jenetics Jan 10, 2018
902dc95
#1: Fix build file.
jenetics Jan 10, 2018
65a0b04
#1: Fix tests.
jenetics Jan 10, 2018
771af19
#1: Fix Javadoc.
jenetics Jan 10, 2018
e2de6cd
Merge remote-tracking branch 'origin/master' into issues/JPX-1-JDBC_a…
jenetics Jan 29, 2018
a909802
Merge remote-tracking branch 'origin/master' into issues/JPX-1-JDBC_a…
jenetics Jan 29, 2018
4f6d3d6
#1: Temporary commenting tests.
jenetics Jan 29, 2018
7b8de6b
Merge remote-tracking branch 'origin/r1.3.0' into issues/JPX-1-JDBC_a…
jenetics Mar 18, 2018
ed85bcd
#1: Some refactorings.
jenetics Mar 18, 2018
fda8d36
#1: Some interface renaming.
jenetics Mar 18, 2018
443c38c
#1: Some refactorings.
jenetics Mar 19, 2018
27e840f
Merge remote-tracking branch 'origin/master' into issues/JPX-1-JDBC_a…
jenetics Sep 20, 2018
2db6fba
#1: Add 'Lombok' dependency.
jenetics Sep 20, 2018
a98f93b
#1: Lombok builder.
jenetics Sep 23, 2018
d795de4
Merge remote-tracking branch 'origin/master' into issues/JPX-1-JDBC_a…
jenetics Aug 29, 2019
7472a5a
#1: Make it compile again.
jenetics Aug 29, 2019
0153785
#1: Some SQL testing.
jenetics Aug 29, 2019
49dcb56
#1: Fix copyright header.
jenetics Aug 29, 2019
a963b47
#1: Add 'SqlFunction' interface.
jenetics Aug 29, 2019
e55e9f0
#1: Some code reformatting.
jenetics Aug 29, 2019
e0e47db
#1: 'SQL' class is no longer needed.
jenetics Aug 29, 2019
5fd1697
#1: Add main entry point.
jenetics Aug 29, 2019
d3be7d0
#1: Add query class stub.
jenetics Aug 29, 2019
524d55d
#1: Move 'Param' class into 'anorm' package.
jenetics Aug 29, 2019
643a55e
#1: Improve code structure.
jenetics Aug 29, 2019
9904c2a
#1: Implement query parsing.
jenetics Aug 29, 2019
e904412
#1: Add 'QueryTest' class.
jenetics Aug 29, 2019
291e118
#1: Organize imports.
jenetics Aug 29, 2019
60ef16a
#1: Some refactorings.
jenetics Aug 29, 2019
09bfa5f
#1: API tests.
jenetics Aug 29, 2019
a7bfaaf
#1: Fix parameter name.
jenetics Aug 30, 2019
b931247
#1: Rename package 'anorm' to 'querily'.
jenetics Aug 30, 2019
b9ab886
#1: Add stubs for execution methods.
jenetics Aug 30, 2019
0754965
#1: Move 'RowParser' and 'Results' class to 'querily' package.
jenetics Aug 30, 2019
36e2820
#1: Static factories.
jenetics Aug 30, 2019
2dd6967
#1: Add 'execute' method.
jenetics Aug 30, 2019
8306424
#1: Rename test class.
jenetics Aug 30, 2019
d2540e8
#1: Implement 'executeInsert' method.
jenetics Aug 30, 2019
461e028
#1: Move 'Stored' class to 'querily' package.
jenetics Aug 30, 2019
6bacfeb
#1: Some code cleanup.
jenetics Aug 30, 2019
fdab901
#1: 'RowParser' refactoring.
jenetics Aug 30, 2019
4229f3f
#1: Cleanup 'Row' class.
jenetics Aug 31, 2019
9157a5b
#1: Implement 'Row' class.
jenetics Aug 31, 2019
8b36a38
#1: API cleanup.
jenetics Aug 31, 2019
a750c89
#1: Remove no longer needed class.
jenetics Aug 31, 2019
25502fc
#1: Add Javadoc.
jenetics Sep 1, 2019
a034ce7
#1: Implement 'PreparedQuery'.
jenetics Sep 1, 2019
cf92c5c
#1: Rename 'Query' to 'SimpleQuery'.
jenetics Sep 1, 2019
95a63dd
#1: Introduce 'Query' interface.
jenetics Sep 1, 2019
43f886e
#1: Implement 'Query' interface.
jenetics Sep 1, 2019
fdd904e
#1: 'SimpleQuery' implements 'Query' interface.
jenetics Sep 1, 2019
81a3034
#1: Some design experiments.
jenetics Sep 1, 2019
1831596
#1: Some code cleanup.
jenetics Sep 1, 2019
98267eb
#1: Fix copyright header.
jenetics Sep 1, 2019
b22f959
#1: Implement 'Dctor' class.
jenetics Sep 1, 2019
111b610
#1: Refactor 'Query' interface to abstract class.
jenetics Sep 2, 2019
3d0cd1e
#1: Query refactorings.
jenetics Sep 2, 2019
bc0a1d1
#1: Query refactorings.
jenetics Sep 2, 2019
6f0637b
#1: Implement batch insertion.
jenetics Sep 3, 2019
9b8ac50
#1: Remove 'SimpleQuery' class.
jenetics Sep 3, 2019
28decc3
#1: Rename query tests.
jenetics Sep 3, 2019
49dc159
#1: Implement 'PreparedQuery' class.
jenetics Sep 3, 2019
feed8b1
#1: Refactoring of 'Value' class.
jenetics Sep 3, 2019
fb13fb3
#1: API streamlining.
jenetics Sep 3, 2019
0b83196
#1: Implement 'LinkDAO'.
jenetics Sep 4, 2019
09e70bb
#1: Implement 'PersonDAO'.
jenetics Sep 4, 2019
62be094
#1: Fix DDL script.
jenetics Sep 5, 2019
80b9353
#1: Improve insertion queries.
jenetics Sep 5, 2019
b5f70fa
#1: Move 'CopyrightDAO' to 'dao' package.
jenetics Sep 5, 2019
88132a6
#1: Implement 'CopyrightDAO'.
jenetics Sep 5, 2019
789e9dc
#1: Implement inserts.
jenetics Sep 5, 2019
d2a8b8b
#1: Extend 'Dctor' class.
jenetics Sep 6, 2019
227c3d0
#1: Implementing.
jenetics Sep 6, 2019
563e136
#1: Implementing.
jenetics Sep 6, 2019
e6b3a10
#1: Implement 'WayPointAccess'.
jenetics Sep 6, 2019
6571a22
#1: Implement 'RouteAccess'.
jenetics Sep 6, 2019
0535679
#1: Implement 'TrackSegmentAccess'.
jenetics Sep 6, 2019
fb56cf6
#1: Implement 'TrackAccess'.
jenetics Sep 6, 2019
1523e60
#1: Implement 'GPXAccess'.
jenetics Sep 6, 2019
585b187
#1: Write insert code and fix accessors.
jenetics Sep 6, 2019
c61b768
#1: Fix model for real MariaDB.
jenetics Sep 6, 2019
2862696
#1: Cleanup of old DB classes.
jenetics Sep 6, 2019
529500a
#1: Move accessor class to module base package.
jenetics Sep 6, 2019
1be9f06
#1: Cleanup.
jenetics Sep 6, 2019
8691205
#1: Cleanup.
jenetics Sep 6, 2019
9be5307
#1: Rename 'Query.executeInsert' to 'inserts'.
jenetics Sep 6, 2019
40aea1e
#1: Cleanup.
jenetics Sep 6, 2019
7ae8e60
#1: Cleanup.
jenetics Sep 6, 2019
748b2b7
#1: Improve error messages.
jenetics Sep 6, 2019
4303647
#1: Add missing column.
jenetics Sep 6, 2019
4232001
#1: Remove code duplications.
jenetics Sep 6, 2019
dcab4ea
#1: Fix 'BoundsAccess'.
jenetics Sep 6, 2019
9d3e2f2
#1: Fix person constraint.
jenetics Sep 6, 2019
90d6fb6
#1: Impl.
jenetics Sep 7, 2019
9262a52
Merge remote-tracking branch 'origin/r1.6.0' into issues/JPX-1-JDBC_a…
jenetics Sep 9, 2019
1bb039b
#1: Improve data model.
jenetics Sep 9, 2019
cc577c9
#1: Improve DB model.
jenetics Sep 11, 2019
d164191
#1: Add Docker Compose file for local PostgreSQL DB.
jenetics Sep 11, 2019
ef9c0af
#1: Docker setup.
jenetics Sep 11, 2019
54af2bb
#1: Add pgAdimin config.
jenetics Sep 11, 2019
2c3be65
#1: Ignore data directories.
jenetics Sep 11, 2019
85c2725
#1: PSQL tests.
jenetics Sep 11, 2019
5af5ef9
#1: Add model script for PSQL.
jenetics Sep 11, 2019
194da65
#1: Improve access classes.
jenetics Sep 11, 2019
cbde990
#1: Improve model types.
jenetics Sep 12, 2019
ee037c0
#1: Minor code improvements.
jenetics Sep 12, 2019
77aa4b3
#1: Fix object conversion.
jenetics Sep 12, 2019
d409053
#1: Fix 'prepare' method.
jenetics Sep 12, 2019
1269ed0
#1: Fix visibility.
jenetics Sep 12, 2019
0879c68
#1: Fix Longitude range.
jenetics Sep 13, 2019
585a309
Fix Javadoc.
jenetics Sep 13, 2019
468a0dd
Merge remote-tracking branch 'origin/master' into issues/JPX-1-JDBC_a…
jenetics Oct 29, 2019
217c426
#1: Using 'facilejdbc' library.
jenetics Nov 8, 2019
6a15a12
Update to Java 11.
jenetics Nov 8, 2019
6aeb100
#1: Define composite build.
jenetics Nov 8, 2019
8dfa7cf
Fix query strings.
jenetics Nov 8, 2019
33a2a46
#1: Implement GPX type to SQL type mapper.
jenetics Nov 8, 2019
e9bde8d
#1: Implement GPX type to SQL type mapper.
jenetics Nov 8, 2019
6272b37
#1: Implement type mapper.
jenetics Nov 8, 2019
46a9656
#1: Add select queries.
jenetics Nov 8, 2019
1f3db01
#1: Add select queries.
jenetics Nov 8, 2019
cb5344a
#1: Adapt 'RowParser' interfaces.
jenetics Nov 9, 2019
963ea01
#1: Disable integration test.
jenetics Nov 10, 2019
73c9c31
#1: Update 'facilejdbc' version number to 0.3.0.
jenetics Nov 10, 2019
be6890d
#1: Remove Java 8 compatibility.
jenetics Nov 10, 2019
32e6aad
#1: Minor code improvements.
jenetics Dec 10, 2019
ff994cd
Adding some tooling classes.
jenetics Dec 28, 2019
5f252f5
Adding some tooling classes.
jenetics Dec 28, 2019
84932f3
Splitting tracks.
jenetics Dec 28, 2019
f2dc525
Fix 'Tracks.toTrack' method.
jenetics Dec 28, 2019
14b49d2
Improve tooling.
jenetics Dec 28, 2019
a3c2119
Fix bounds calculation.
jenetics Dec 28, 2019
416bba5
Improve normalizer.
jenetics Dec 28, 2019
652dce2
Improve normalizer.
jenetics Dec 28, 2019
0c3040f
Improve normalizer.
jenetics Dec 28, 2019
df176f3
Improve normalizer.
jenetics Dec 28, 2019
adf6632
Streamlining of 'Track' collector.
jenetics Dec 28, 2019
f6d0c60
Add pre-condition check.
jenetics Dec 29, 2019
3b6a293
Filter improvements.
jenetics Dec 30, 2019
74a2c9e
Merge remote-tracking branch 'origin/r1.6.1' into issues/JPX-1-JDBC_a…
jenetics Dec 30, 2019
13634c1
Minor improvements.
jenetics Jan 6, 2020
5fd1270
Merge remote-tracking branch 'origin/master' into issues/JPX-1-JDBC_a…
jenetics Sep 13, 2020
28aa5c4
Implement TCX splitter.
jenetics Nov 12, 2020
2f83f7c
#1: Change path.
jenetics Jan 18, 2021
169059d
#1: Remove DB files.
jenetics Aug 25, 2021
cda622c
#1: Some tests.
jenetics Nov 12, 2021
0e30e28
Merge remote-tracking branch 'origin/releases/r3.0.0' into issues/JPX…
jenetics Dec 31, 2021
e6447d7
Merge remote-tracking branch 'origin/master' into issues/JPX-1-JDBC_a…
jenetics Jul 10, 2022
77e9caf
#1: Add tracksegment splitter example.
jenetics Jul 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
root = true

[*]
[*.{java,gradle,groovy}]
charset = utf-8
indent_style = tab
indent_size = 4
tab_width = 4
trim_trailing_whitespace = true
insert_final_newline = true


[*.{java,gradle,groovy,kt,kts}]
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
125 changes: 125 additions & 0 deletions jpx.jdbc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/*
* Java GPX Library (@__identifier__@).
* Copyright (c) @__year__@ Franz Wilhelmstötter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Author:
* Franz Wilhelmstötter (franz.wilhelmstoetter@gmail.com)
*/

/**
* @author <a href="mailto:franz.wilhelmstoetter@gmail.com">Franz Wilhelmstötter</a>
* @since 1.0
* @version 1.0
*/

import io.franzbecker.gradle.lombok.task.DelombokTask

plugins {
id "io.franzbecker.gradle-lombok" version "3.2.0"
}

apply plugin: 'java-library'
apply plugin: 'maven'
apply plugin: 'signing'

compileTestJava.dependsOn tasks.getByPath(':jpx:compileTestJava')

description = 'JPX - Java GPX Library'

repositories {
mavenCentral()
jcenter()
}

dependencies {
api project(':jpx')
implementation 'io.jenetics:facilejdbc:0.3.0'

testImplementation project(':jpx').sourceSets.test.output
testImplementation 'org.testng:testng:6.9.10'
testImplementation 'com.h2database:h2:1.4.193'
testImplementation 'mysql:mysql-connector-java:6.0.5'
testImplementation 'org.mariadb.jdbc:mariadb-java-client:2.4.3'
testImplementation 'org.postgresql:postgresql:42.2.7'
}

task delombok(type: DelombokTask, dependsOn: compileJava) {
ext.outputDir = file("$buildDir/delombok")
outputs.dir(outputDir)
sourceSets.main.java.srcDirs.each {
inputs.dir(it)
args(it, "-d", outputDir)
}
doFirst {
outputDir.deleteDir()
}
}

javadoc {
dependsOn delombok

project.configure(options) {
memberLevel = 'PROTECTED'
version = true
author = true
docEncoding = 'UTF-8'
charSet = 'UTF-8'
linkSource = true
links = [
'https://docs.oracle.com/javase/8/docs/api',
'https://jenetics.github.io/jpx/javadoc/jpx'
]
windowTitle = "JPX ${project.version}"
docTitle = "<h1>JPX ${project.version}</h1>"
bottom = "&copy; ${copyrightYear} Franz Wilhelmst&ouml;tter &nbsp;<i>(${dateformat.format(now)})</i>"
options.tags = ["apiNote:a:API Note:",
"implSpec:a:Implementation Requirements:",
"implNote:a:Implementation Note:"]
//exclude '**/internal/**'
}

// Copy the doc-files.
doLast {
project.copy {
from('src/main/java') {
include 'org/**/doc-files/*.*'
}
includeEmptyDirs = false
into destinationDir.path
}
}
}

test {
testLogging.showStandardStreams = true
useTestNG {
preserveOrder true
parallel = 'tests' // 'methods'
}
}

jar {
manifest {
attributes(
'Implementation-Title': 'JPX - Java GPX library',
'Implementation-Version': "${project.name}-${project.version}",
'Implementation-URL': 'https://jenetics.github.io/jpx',
'Implementation-Vendor': 'jenetics',
'ProjectName': project.name,
'Version': project.version,
'Maintainer': 'Franz Wilhelmstötter'
)
}
}
88 changes: 88 additions & 0 deletions jpx.jdbc/src/main/java/io/jenetics/jpx/jdbc/BoundsAccess.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
* Java Genetic Algorithm Library (@__identifier__@).
* Copyright (c) @__year__@ Franz Wilhelmstötter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Author:
* Franz Wilhelmstötter (franz.wilhelmstoetter@gmail.com)
*/
package io.jenetics.jpx.jdbc;

import static io.jenetics.facilejdbc.Dctor.field;
import static io.jenetics.facilejdbc.Param.value;

import java.sql.Connection;
import java.sql.SQLException;

import io.jenetics.jpx.Bounds;

import io.jenetics.facilejdbc.Dctor;
import io.jenetics.facilejdbc.Query;
import io.jenetics.facilejdbc.RowParser;

/**
* @author <a href="mailto:franz.wilhelmstoetter@gmail.com">Franz Wilhelmstötter</a>
* @version !__version__!
* @since !__version__!
*/
public final class BoundsAccess {
private BoundsAccess() {}

private static final Query SELECT = Query.of(
"SELECT minlat, minlon, maxlat, maxlon " +
"FROM bounds " +
"WHERE id = :id"
);

private static final Query INSERT = Query.of(
"INSERT INTO bounds(minlat, minlon, maxlat, maxlon) " +
"VALUES(:minlat, :minlon, :maxlat, :maxlon)"
);

private static final RowParser<Bounds> PARSER = (row, conn) -> Bounds.of(
row.getDouble("minlat"),
row.getDouble("minlon"),
row.getDouble("maxlat"),
row.getDouble("maxlon")
);

private static final Dctor<Bounds> DCTOR = Dctor.of(
field("minlat", Bounds::getMinLatitude),
field("minlon", Bounds::getMinLongitude),
field("maxlat", Bounds::getMaxLatitude),
field("maxlon", Bounds::getMaxLongitude)
);

public static Bounds selectById(final Long id, final Connection conn)
throws SQLException
{
return id != null
? SELECT
.on(value("id", id))
.as(PARSER.singleNull(), conn)
: null;
}

public static Long insert(final Bounds bounds, final Connection conn)
throws SQLException
{
return bounds != null
? INSERT
.on(bounds, DCTOR)
.executeInsert(conn)
.orElseThrow()
: null;
}

}
88 changes: 88 additions & 0 deletions jpx.jdbc/src/main/java/io/jenetics/jpx/jdbc/CopyrightAccess.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
* Java Genetic Algorithm Library (@__identifier__@).
* Copyright (c) @__year__@ Franz Wilhelmstötter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Author:
* Franz Wilhelmstötter (franz.wilhelmstoetter@gmail.com)
*/
package io.jenetics.jpx.jdbc;

import static io.jenetics.facilejdbc.Dctor.field;
import static io.jenetics.facilejdbc.Param.value;

import java.net.URI;
import java.sql.Connection;
import java.sql.SQLException;
import java.time.Year;

import io.jenetics.jpx.Copyright;

import io.jenetics.facilejdbc.Dctor;
import io.jenetics.facilejdbc.Query;
import io.jenetics.facilejdbc.RowParser;

/**
* @author <a href="mailto:franz.wilhelmstoetter@gmail.com">Franz Wilhelmstötter</a>
* @version !__version__!
* @since !__version__!
*/
public final class CopyrightAccess {
private CopyrightAccess() {}

private static final Query SELECT = Query.of(
"SELECT id, author, year, license " +
"FROM copyright " +
"WHERE id = :id"
);

private static final Query INSERT = Query.of(
"INSERT INTO copyright(author, year, license) " +
"VALUES(:author, :year, :license)"
);

private static final RowParser<Copyright> PARSER = (row, conn) -> Copyright.of(
row.getString("author"),
Year.of(row.getInt("year")),
URI.create(row.getString("license"))
);

private static final Dctor<Copyright> DCTOR = Dctor.of(
field("author", Copyright::getAuthor),
field("year", c -> c.getYear().map(Year::getValue)),
field("license", Copyright::getLicense)
);

public static Copyright selectById(final Long id, final Connection conn)
throws SQLException
{
return id != null
? SELECT
.on(value("id", id))
.as(PARSER.singleNull(), conn)
: null;
}

public static Long insert(final Copyright copyright, final Connection conn)
throws SQLException
{
return copyright != null
? INSERT
.on(copyright, DCTOR)
.executeInsert(conn)
.orElseThrow()
: null;
}

}
Loading