diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/modules/simple-database-kotlin_main.iml b/.idea/modules/simple-database-kotlin_main.iml index 6f48844..3ef6611 100644 --- a/.idea/modules/simple-database-kotlin_main.iml +++ b/.idea/modules/simple-database-kotlin_main.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -10,12 +11,10 @@ - - - - + + + + - - \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/modules/simple-database-kotlin_main.iml b/.idea/modules/simple-database-kotlin_main.iml index 6f48844..3ef6611 100644 --- a/.idea/modules/simple-database-kotlin_main.iml +++ b/.idea/modules/simple-database-kotlin_main.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -10,12 +11,10 @@ - - - - + + + + - - \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin_test.iml b/.idea/modules/simple-database-kotlin_test.iml index 27bbb5c..8a224c0 100644 --- a/.idea/modules/simple-database-kotlin_test.iml +++ b/.idea/modules/simple-database-kotlin_test.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -13,14 +14,13 @@ - - + + - - + + + - - diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/modules/simple-database-kotlin_main.iml b/.idea/modules/simple-database-kotlin_main.iml index 6f48844..3ef6611 100644 --- a/.idea/modules/simple-database-kotlin_main.iml +++ b/.idea/modules/simple-database-kotlin_main.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -10,12 +11,10 @@ - - - - + + + + - - \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin_test.iml b/.idea/modules/simple-database-kotlin_test.iml index 27bbb5c..8a224c0 100644 --- a/.idea/modules/simple-database-kotlin_test.iml +++ b/.idea/modules/simple-database-kotlin_test.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -13,14 +14,13 @@ - - + + - - + + + - - diff --git a/.idea/modules/simple_database_kotlin_main.iml b/.idea/modules/simple_database_kotlin_main.iml deleted file mode 100644 index 52d8a33..0000000 --- a/.idea/modules/simple_database_kotlin_main.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/modules/simple-database-kotlin_main.iml b/.idea/modules/simple-database-kotlin_main.iml index 6f48844..3ef6611 100644 --- a/.idea/modules/simple-database-kotlin_main.iml +++ b/.idea/modules/simple-database-kotlin_main.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -10,12 +11,10 @@ - - - - + + + + - - \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin_test.iml b/.idea/modules/simple-database-kotlin_test.iml index 27bbb5c..8a224c0 100644 --- a/.idea/modules/simple-database-kotlin_test.iml +++ b/.idea/modules/simple-database-kotlin_test.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -13,14 +14,13 @@ - - + + - - + + + - - diff --git a/.idea/modules/simple_database_kotlin_main.iml b/.idea/modules/simple_database_kotlin_main.iml deleted file mode 100644 index 52d8a33..0000000 --- a/.idea/modules/simple_database_kotlin_main.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/simple_database_kotlin_test.iml b/.idea/modules/simple_database_kotlin_test.iml deleted file mode 100644 index abf4720..0000000 --- a/.idea/modules/simple_database_kotlin_test.iml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/modules/simple-database-kotlin_main.iml b/.idea/modules/simple-database-kotlin_main.iml index 6f48844..3ef6611 100644 --- a/.idea/modules/simple-database-kotlin_main.iml +++ b/.idea/modules/simple-database-kotlin_main.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -10,12 +11,10 @@ - - - - + + + + - - \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin_test.iml b/.idea/modules/simple-database-kotlin_test.iml index 27bbb5c..8a224c0 100644 --- a/.idea/modules/simple-database-kotlin_test.iml +++ b/.idea/modules/simple-database-kotlin_test.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -13,14 +14,13 @@ - - + + - - + + + - - diff --git a/.idea/modules/simple_database_kotlin_main.iml b/.idea/modules/simple_database_kotlin_main.iml deleted file mode 100644 index 52d8a33..0000000 --- a/.idea/modules/simple_database_kotlin_main.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/simple_database_kotlin_test.iml b/.idea/modules/simple_database_kotlin_test.iml deleted file mode 100644 index abf4720..0000000 --- a/.idea/modules/simple_database_kotlin_test.iml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index fb33c63..4687896 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ -group 'nl.astraeus.database' -version '1.4.12-SNAPSHOT' +group 'nl.astraeus' +version '2.0.5' apply plugin: 'kotlin' apply plugin: 'idea' @@ -8,19 +8,15 @@ apply plugin: 'maven-publish' apply plugin: 'net.researchgate.release' -sourceSets { - main.java.srcDirs += 'src' - test.java.srcDirs += 'test' -} - repositories { + mavenCentral() maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" } } buildscript { - ext.kotlin_version = '1.0.4' + ext.kotlin_version = '1.2.30' repositories { maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" @@ -37,11 +33,13 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' + testCompile "com.h2database:h2:1.4.+" compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - compile "nl.astraeus.database:simple-database:1.3.1" + compile "nl.astraeus:simple-database:2.0.4" } +/* uploadArchives { repositories { mavenDeployer { @@ -54,6 +52,7 @@ } } } +*/ findbugs { ignoreFailures = true @@ -63,6 +62,21 @@ failOnError = false } +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar + archives javadocJar +} + publishing { publications { mavenJava(MavenPublication) { @@ -70,3 +84,14 @@ } } } + +task fatJar(type: Jar) { + manifest { + attributes 'Implementation-Title': 'simple-database-kotlin', + 'Implementation-Version': version + } + baseName = project.name + '-nodep' + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + with jar +} + diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/modules/simple-database-kotlin_main.iml b/.idea/modules/simple-database-kotlin_main.iml index 6f48844..3ef6611 100644 --- a/.idea/modules/simple-database-kotlin_main.iml +++ b/.idea/modules/simple-database-kotlin_main.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -10,12 +11,10 @@ - - - - + + + + - - \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin_test.iml b/.idea/modules/simple-database-kotlin_test.iml index 27bbb5c..8a224c0 100644 --- a/.idea/modules/simple-database-kotlin_test.iml +++ b/.idea/modules/simple-database-kotlin_test.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -13,14 +14,13 @@ - - + + - - + + + - - diff --git a/.idea/modules/simple_database_kotlin_main.iml b/.idea/modules/simple_database_kotlin_main.iml deleted file mode 100644 index 52d8a33..0000000 --- a/.idea/modules/simple_database_kotlin_main.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/simple_database_kotlin_test.iml b/.idea/modules/simple_database_kotlin_test.iml deleted file mode 100644 index abf4720..0000000 --- a/.idea/modules/simple_database_kotlin_test.iml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index fb33c63..4687896 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ -group 'nl.astraeus.database' -version '1.4.12-SNAPSHOT' +group 'nl.astraeus' +version '2.0.5' apply plugin: 'kotlin' apply plugin: 'idea' @@ -8,19 +8,15 @@ apply plugin: 'maven-publish' apply plugin: 'net.researchgate.release' -sourceSets { - main.java.srcDirs += 'src' - test.java.srcDirs += 'test' -} - repositories { + mavenCentral() maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" } } buildscript { - ext.kotlin_version = '1.0.4' + ext.kotlin_version = '1.2.30' repositories { maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" @@ -37,11 +33,13 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' + testCompile "com.h2database:h2:1.4.+" compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - compile "nl.astraeus.database:simple-database:1.3.1" + compile "nl.astraeus:simple-database:2.0.4" } +/* uploadArchives { repositories { mavenDeployer { @@ -54,6 +52,7 @@ } } } +*/ findbugs { ignoreFailures = true @@ -63,6 +62,21 @@ failOnError = false } +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar + archives javadocJar +} + publishing { publications { mavenJava(MavenPublication) { @@ -70,3 +84,14 @@ } } } + +task fatJar(type: Jar) { + manifest { + attributes 'Implementation-Title': 'simple-database-kotlin', + 'Implementation-Version': version + } + baseName = project.name + '-nodep' + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + with jar +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f6b5590..d579dc8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/modules/simple-database-kotlin_main.iml b/.idea/modules/simple-database-kotlin_main.iml index 6f48844..3ef6611 100644 --- a/.idea/modules/simple-database-kotlin_main.iml +++ b/.idea/modules/simple-database-kotlin_main.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -10,12 +11,10 @@ - - - - + + + + - - \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin_test.iml b/.idea/modules/simple-database-kotlin_test.iml index 27bbb5c..8a224c0 100644 --- a/.idea/modules/simple-database-kotlin_test.iml +++ b/.idea/modules/simple-database-kotlin_test.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -13,14 +14,13 @@ - - + + - - + + + - - diff --git a/.idea/modules/simple_database_kotlin_main.iml b/.idea/modules/simple_database_kotlin_main.iml deleted file mode 100644 index 52d8a33..0000000 --- a/.idea/modules/simple_database_kotlin_main.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/simple_database_kotlin_test.iml b/.idea/modules/simple_database_kotlin_test.iml deleted file mode 100644 index abf4720..0000000 --- a/.idea/modules/simple_database_kotlin_test.iml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index fb33c63..4687896 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ -group 'nl.astraeus.database' -version '1.4.12-SNAPSHOT' +group 'nl.astraeus' +version '2.0.5' apply plugin: 'kotlin' apply plugin: 'idea' @@ -8,19 +8,15 @@ apply plugin: 'maven-publish' apply plugin: 'net.researchgate.release' -sourceSets { - main.java.srcDirs += 'src' - test.java.srcDirs += 'test' -} - repositories { + mavenCentral() maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" } } buildscript { - ext.kotlin_version = '1.0.4' + ext.kotlin_version = '1.2.30' repositories { maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" @@ -37,11 +33,13 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' + testCompile "com.h2database:h2:1.4.+" compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - compile "nl.astraeus.database:simple-database:1.3.1" + compile "nl.astraeus:simple-database:2.0.4" } +/* uploadArchives { repositories { mavenDeployer { @@ -54,6 +52,7 @@ } } } +*/ findbugs { ignoreFailures = true @@ -63,6 +62,21 @@ failOnError = false } +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar + archives javadocJar +} + publishing { publications { mavenJava(MavenPublication) { @@ -70,3 +84,14 @@ } } } + +task fatJar(type: Jar) { + manifest { + attributes 'Implementation-Title': 'simple-database-kotlin', + 'Implementation-Version': version + } + baseName = project.name + '-nodep' + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + with jar +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f6b5590..d579dc8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..92c5565 --- /dev/null +++ b/readme.md @@ -0,0 +1,97 @@ +# Simple database kotlin + +## Maven, gradle etc: + +Add maven repository: https://nexus.astraeus.nl/nexus/content/groups/public + +Pom: + +```xml + + nl.astraeus + simple-database-kotlin + 2.0.2 + +``` + +## Minimal example: + +```kotlin +// see in test: nl.astraeus.database.example.MinimalExample.kt +@Table(name="persons") +@Cache(maxSize = 6) +class Person( + @Id val id: Long = 0, + + @Length(value = 200) + @Default("'new name'") + var name: String, + + @Default("21") + var age: Int, + + @Length(precision = 10, scale = 2) + var balance: Double, + + var address: String +) { + // no-arg constructor required + constructor(): this(0, "", 0, 0.0, "") + + constructor(name: String, age: Int, address: String): this(0, name, age, 0.0, address) +} + +fun main(args: Array) { + // define the default database, all it needs it a way to get a connection + val db = SimpleDatabase.define(object : ConnectionProvider() { + @Throws(SQLException::class, ClassNotFoundException::class) + override fun getConnection(): Connection { + Class.forName("org.h2.Driver") + + val connection = DriverManager.getConnection("jdbc:h2:mem:Example;DB_CLOSE_DELAY=-1", "sa", "") + connection.autoCommit = false + + return connection + } + }) + + // automatically create database tables and columns if needed + db.setExecuteDDLUpdates(true) + + // use default dao (extends it if you need more) + val personDao = SimpleDao(Person::class.java) + + // execute multiple dao actions in transaction + personDao.execute({ dao -> + dao.insert(Person("John", 40, "Road")) + dao.insert(Person("Jan", 32, "Straat")) + dao.insert(Person("Ronald", 31, "Wherever")) + dao.insert(Person("Piet", 26, "Weg")) + dao.insert(Person("Klaas", 10, "Pad")) + }) + + // find persons, read actions don't need a transaction + var persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } + + // start transaction because of the update + db.begin() + + transaction { + val person = personDao.find("name = ? and age = ?", "John", 40) + + person.name = "Johnny" + + personDao.update(person) + } + + persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } +} +``` \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/modules/simple-database-kotlin_main.iml b/.idea/modules/simple-database-kotlin_main.iml index 6f48844..3ef6611 100644 --- a/.idea/modules/simple-database-kotlin_main.iml +++ b/.idea/modules/simple-database-kotlin_main.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -10,12 +11,10 @@ - - - - + + + + - - \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin_test.iml b/.idea/modules/simple-database-kotlin_test.iml index 27bbb5c..8a224c0 100644 --- a/.idea/modules/simple-database-kotlin_test.iml +++ b/.idea/modules/simple-database-kotlin_test.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -13,14 +14,13 @@ - - + + - - + + + - - diff --git a/.idea/modules/simple_database_kotlin_main.iml b/.idea/modules/simple_database_kotlin_main.iml deleted file mode 100644 index 52d8a33..0000000 --- a/.idea/modules/simple_database_kotlin_main.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/simple_database_kotlin_test.iml b/.idea/modules/simple_database_kotlin_test.iml deleted file mode 100644 index abf4720..0000000 --- a/.idea/modules/simple_database_kotlin_test.iml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index fb33c63..4687896 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ -group 'nl.astraeus.database' -version '1.4.12-SNAPSHOT' +group 'nl.astraeus' +version '2.0.5' apply plugin: 'kotlin' apply plugin: 'idea' @@ -8,19 +8,15 @@ apply plugin: 'maven-publish' apply plugin: 'net.researchgate.release' -sourceSets { - main.java.srcDirs += 'src' - test.java.srcDirs += 'test' -} - repositories { + mavenCentral() maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" } } buildscript { - ext.kotlin_version = '1.0.4' + ext.kotlin_version = '1.2.30' repositories { maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" @@ -37,11 +33,13 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' + testCompile "com.h2database:h2:1.4.+" compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - compile "nl.astraeus.database:simple-database:1.3.1" + compile "nl.astraeus:simple-database:2.0.4" } +/* uploadArchives { repositories { mavenDeployer { @@ -54,6 +52,7 @@ } } } +*/ findbugs { ignoreFailures = true @@ -63,6 +62,21 @@ failOnError = false } +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar + archives javadocJar +} + publishing { publications { mavenJava(MavenPublication) { @@ -70,3 +84,14 @@ } } } + +task fatJar(type: Jar) { + manifest { + attributes 'Implementation-Title': 'simple-database-kotlin', + 'Implementation-Version': version + } + baseName = project.name + '-nodep' + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + with jar +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f6b5590..d579dc8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..92c5565 --- /dev/null +++ b/readme.md @@ -0,0 +1,97 @@ +# Simple database kotlin + +## Maven, gradle etc: + +Add maven repository: https://nexus.astraeus.nl/nexus/content/groups/public + +Pom: + +```xml + + nl.astraeus + simple-database-kotlin + 2.0.2 + +``` + +## Minimal example: + +```kotlin +// see in test: nl.astraeus.database.example.MinimalExample.kt +@Table(name="persons") +@Cache(maxSize = 6) +class Person( + @Id val id: Long = 0, + + @Length(value = 200) + @Default("'new name'") + var name: String, + + @Default("21") + var age: Int, + + @Length(precision = 10, scale = 2) + var balance: Double, + + var address: String +) { + // no-arg constructor required + constructor(): this(0, "", 0, 0.0, "") + + constructor(name: String, age: Int, address: String): this(0, name, age, 0.0, address) +} + +fun main(args: Array) { + // define the default database, all it needs it a way to get a connection + val db = SimpleDatabase.define(object : ConnectionProvider() { + @Throws(SQLException::class, ClassNotFoundException::class) + override fun getConnection(): Connection { + Class.forName("org.h2.Driver") + + val connection = DriverManager.getConnection("jdbc:h2:mem:Example;DB_CLOSE_DELAY=-1", "sa", "") + connection.autoCommit = false + + return connection + } + }) + + // automatically create database tables and columns if needed + db.setExecuteDDLUpdates(true) + + // use default dao (extends it if you need more) + val personDao = SimpleDao(Person::class.java) + + // execute multiple dao actions in transaction + personDao.execute({ dao -> + dao.insert(Person("John", 40, "Road")) + dao.insert(Person("Jan", 32, "Straat")) + dao.insert(Person("Ronald", 31, "Wherever")) + dao.insert(Person("Piet", 26, "Weg")) + dao.insert(Person("Klaas", 10, "Pad")) + }) + + // find persons, read actions don't need a transaction + var persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } + + // start transaction because of the update + db.begin() + + transaction { + val person = personDao.find("name = ? and age = ?", "John", 40) + + person.name = "Johnny" + + personDao.update(person) + } + + persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } +} +``` \ No newline at end of file diff --git a/simple-database-kotlin.ipr b/simple-database-kotlin.ipr index f0ea744..d8ea304 100644 --- a/simple-database-kotlin.ipr +++ b/simple-database-kotlin.ipr @@ -1,25 +1,9 @@ - + + + + + @@ -57,26 +47,18 @@ - - + + + - + - - - - - - - - - @@ -86,16 +68,16 @@ - + - + - + - + @@ -109,40 +91,31 @@ - + - + - + - + - + - + - + - + - - - - - - - - - - + diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/modules/simple-database-kotlin_main.iml b/.idea/modules/simple-database-kotlin_main.iml index 6f48844..3ef6611 100644 --- a/.idea/modules/simple-database-kotlin_main.iml +++ b/.idea/modules/simple-database-kotlin_main.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -10,12 +11,10 @@ - - - - + + + + - - \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin_test.iml b/.idea/modules/simple-database-kotlin_test.iml index 27bbb5c..8a224c0 100644 --- a/.idea/modules/simple-database-kotlin_test.iml +++ b/.idea/modules/simple-database-kotlin_test.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -13,14 +14,13 @@ - - + + - - + + + - - diff --git a/.idea/modules/simple_database_kotlin_main.iml b/.idea/modules/simple_database_kotlin_main.iml deleted file mode 100644 index 52d8a33..0000000 --- a/.idea/modules/simple_database_kotlin_main.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/simple_database_kotlin_test.iml b/.idea/modules/simple_database_kotlin_test.iml deleted file mode 100644 index abf4720..0000000 --- a/.idea/modules/simple_database_kotlin_test.iml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index fb33c63..4687896 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ -group 'nl.astraeus.database' -version '1.4.12-SNAPSHOT' +group 'nl.astraeus' +version '2.0.5' apply plugin: 'kotlin' apply plugin: 'idea' @@ -8,19 +8,15 @@ apply plugin: 'maven-publish' apply plugin: 'net.researchgate.release' -sourceSets { - main.java.srcDirs += 'src' - test.java.srcDirs += 'test' -} - repositories { + mavenCentral() maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" } } buildscript { - ext.kotlin_version = '1.0.4' + ext.kotlin_version = '1.2.30' repositories { maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" @@ -37,11 +33,13 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' + testCompile "com.h2database:h2:1.4.+" compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - compile "nl.astraeus.database:simple-database:1.3.1" + compile "nl.astraeus:simple-database:2.0.4" } +/* uploadArchives { repositories { mavenDeployer { @@ -54,6 +52,7 @@ } } } +*/ findbugs { ignoreFailures = true @@ -63,6 +62,21 @@ failOnError = false } +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar + archives javadocJar +} + publishing { publications { mavenJava(MavenPublication) { @@ -70,3 +84,14 @@ } } } + +task fatJar(type: Jar) { + manifest { + attributes 'Implementation-Title': 'simple-database-kotlin', + 'Implementation-Version': version + } + baseName = project.name + '-nodep' + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + with jar +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f6b5590..d579dc8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..92c5565 --- /dev/null +++ b/readme.md @@ -0,0 +1,97 @@ +# Simple database kotlin + +## Maven, gradle etc: + +Add maven repository: https://nexus.astraeus.nl/nexus/content/groups/public + +Pom: + +```xml + + nl.astraeus + simple-database-kotlin + 2.0.2 + +``` + +## Minimal example: + +```kotlin +// see in test: nl.astraeus.database.example.MinimalExample.kt +@Table(name="persons") +@Cache(maxSize = 6) +class Person( + @Id val id: Long = 0, + + @Length(value = 200) + @Default("'new name'") + var name: String, + + @Default("21") + var age: Int, + + @Length(precision = 10, scale = 2) + var balance: Double, + + var address: String +) { + // no-arg constructor required + constructor(): this(0, "", 0, 0.0, "") + + constructor(name: String, age: Int, address: String): this(0, name, age, 0.0, address) +} + +fun main(args: Array) { + // define the default database, all it needs it a way to get a connection + val db = SimpleDatabase.define(object : ConnectionProvider() { + @Throws(SQLException::class, ClassNotFoundException::class) + override fun getConnection(): Connection { + Class.forName("org.h2.Driver") + + val connection = DriverManager.getConnection("jdbc:h2:mem:Example;DB_CLOSE_DELAY=-1", "sa", "") + connection.autoCommit = false + + return connection + } + }) + + // automatically create database tables and columns if needed + db.setExecuteDDLUpdates(true) + + // use default dao (extends it if you need more) + val personDao = SimpleDao(Person::class.java) + + // execute multiple dao actions in transaction + personDao.execute({ dao -> + dao.insert(Person("John", 40, "Road")) + dao.insert(Person("Jan", 32, "Straat")) + dao.insert(Person("Ronald", 31, "Wherever")) + dao.insert(Person("Piet", 26, "Weg")) + dao.insert(Person("Klaas", 10, "Pad")) + }) + + // find persons, read actions don't need a transaction + var persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } + + // start transaction because of the update + db.begin() + + transaction { + val person = personDao.find("name = ? and age = ?", "John", 40) + + person.name = "Johnny" + + personDao.update(person) + } + + persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } +} +``` \ No newline at end of file diff --git a/simple-database-kotlin.ipr b/simple-database-kotlin.ipr index f0ea744..d8ea304 100644 --- a/simple-database-kotlin.ipr +++ b/simple-database-kotlin.ipr @@ -1,25 +1,9 @@ - + + + + + @@ -57,26 +47,18 @@ - - + + + - + - - - - - - - - - @@ -86,16 +68,16 @@ - + - + - + - + @@ -109,40 +91,31 @@ - + - + - + - + - + - + - + - + - - - - - - - - - - + diff --git a/src/main/kotlin/nl/astraeus/database/Database.kt b/src/main/kotlin/nl/astraeus/database/Database.kt new file mode 100644 index 0000000..f827971 --- /dev/null +++ b/src/main/kotlin/nl/astraeus/database/Database.kt @@ -0,0 +1,49 @@ +package nl.astraeus.database + +/** + * User: rnentjes + * Date: 18-10-15 + * Time: 16:40 + */ + +fun transaction(name: String = "default", task: () -> Unit) { + val db = SimpleDatabase.get(name) + + if (db.transactionActive()) { + return task() + } else { + try { + db.begin() + + task() + + db.commit() + } finally { + if (db.transactionActive()) { + db.rollback() + } + } + } +} + +fun transaction(name: String = "default", task: () -> T): T { + val db = SimpleDatabase.get(name) + + if (db.transactionActive()) { + return task() + } else { + try { + db.begin() + + val result = task() + + db.commit() + + return result + } finally { + if (db.transactionActive()) { + db.rollback() + } + } + } +} diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/modules/simple-database-kotlin_main.iml b/.idea/modules/simple-database-kotlin_main.iml index 6f48844..3ef6611 100644 --- a/.idea/modules/simple-database-kotlin_main.iml +++ b/.idea/modules/simple-database-kotlin_main.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -10,12 +11,10 @@ - - - - + + + + - - \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin_test.iml b/.idea/modules/simple-database-kotlin_test.iml index 27bbb5c..8a224c0 100644 --- a/.idea/modules/simple-database-kotlin_test.iml +++ b/.idea/modules/simple-database-kotlin_test.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -13,14 +14,13 @@ - - + + - - + + + - - diff --git a/.idea/modules/simple_database_kotlin_main.iml b/.idea/modules/simple_database_kotlin_main.iml deleted file mode 100644 index 52d8a33..0000000 --- a/.idea/modules/simple_database_kotlin_main.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/simple_database_kotlin_test.iml b/.idea/modules/simple_database_kotlin_test.iml deleted file mode 100644 index abf4720..0000000 --- a/.idea/modules/simple_database_kotlin_test.iml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index fb33c63..4687896 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ -group 'nl.astraeus.database' -version '1.4.12-SNAPSHOT' +group 'nl.astraeus' +version '2.0.5' apply plugin: 'kotlin' apply plugin: 'idea' @@ -8,19 +8,15 @@ apply plugin: 'maven-publish' apply plugin: 'net.researchgate.release' -sourceSets { - main.java.srcDirs += 'src' - test.java.srcDirs += 'test' -} - repositories { + mavenCentral() maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" } } buildscript { - ext.kotlin_version = '1.0.4' + ext.kotlin_version = '1.2.30' repositories { maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" @@ -37,11 +33,13 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' + testCompile "com.h2database:h2:1.4.+" compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - compile "nl.astraeus.database:simple-database:1.3.1" + compile "nl.astraeus:simple-database:2.0.4" } +/* uploadArchives { repositories { mavenDeployer { @@ -54,6 +52,7 @@ } } } +*/ findbugs { ignoreFailures = true @@ -63,6 +62,21 @@ failOnError = false } +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar + archives javadocJar +} + publishing { publications { mavenJava(MavenPublication) { @@ -70,3 +84,14 @@ } } } + +task fatJar(type: Jar) { + manifest { + attributes 'Implementation-Title': 'simple-database-kotlin', + 'Implementation-Version': version + } + baseName = project.name + '-nodep' + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + with jar +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f6b5590..d579dc8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..92c5565 --- /dev/null +++ b/readme.md @@ -0,0 +1,97 @@ +# Simple database kotlin + +## Maven, gradle etc: + +Add maven repository: https://nexus.astraeus.nl/nexus/content/groups/public + +Pom: + +```xml + + nl.astraeus + simple-database-kotlin + 2.0.2 + +``` + +## Minimal example: + +```kotlin +// see in test: nl.astraeus.database.example.MinimalExample.kt +@Table(name="persons") +@Cache(maxSize = 6) +class Person( + @Id val id: Long = 0, + + @Length(value = 200) + @Default("'new name'") + var name: String, + + @Default("21") + var age: Int, + + @Length(precision = 10, scale = 2) + var balance: Double, + + var address: String +) { + // no-arg constructor required + constructor(): this(0, "", 0, 0.0, "") + + constructor(name: String, age: Int, address: String): this(0, name, age, 0.0, address) +} + +fun main(args: Array) { + // define the default database, all it needs it a way to get a connection + val db = SimpleDatabase.define(object : ConnectionProvider() { + @Throws(SQLException::class, ClassNotFoundException::class) + override fun getConnection(): Connection { + Class.forName("org.h2.Driver") + + val connection = DriverManager.getConnection("jdbc:h2:mem:Example;DB_CLOSE_DELAY=-1", "sa", "") + connection.autoCommit = false + + return connection + } + }) + + // automatically create database tables and columns if needed + db.setExecuteDDLUpdates(true) + + // use default dao (extends it if you need more) + val personDao = SimpleDao(Person::class.java) + + // execute multiple dao actions in transaction + personDao.execute({ dao -> + dao.insert(Person("John", 40, "Road")) + dao.insert(Person("Jan", 32, "Straat")) + dao.insert(Person("Ronald", 31, "Wherever")) + dao.insert(Person("Piet", 26, "Weg")) + dao.insert(Person("Klaas", 10, "Pad")) + }) + + // find persons, read actions don't need a transaction + var persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } + + // start transaction because of the update + db.begin() + + transaction { + val person = personDao.find("name = ? and age = ?", "John", 40) + + person.name = "Johnny" + + personDao.update(person) + } + + persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } +} +``` \ No newline at end of file diff --git a/simple-database-kotlin.ipr b/simple-database-kotlin.ipr index f0ea744..d8ea304 100644 --- a/simple-database-kotlin.ipr +++ b/simple-database-kotlin.ipr @@ -1,25 +1,9 @@ - + + + + + @@ -57,26 +47,18 @@ - - + + + - + - - - - - - - - - @@ -86,16 +68,16 @@ - + - + - + - + @@ -109,40 +91,31 @@ - + - + - + - + - + - + - + - + - - - - - - - - - - + diff --git a/src/main/kotlin/nl/astraeus/database/Database.kt b/src/main/kotlin/nl/astraeus/database/Database.kt new file mode 100644 index 0000000..f827971 --- /dev/null +++ b/src/main/kotlin/nl/astraeus/database/Database.kt @@ -0,0 +1,49 @@ +package nl.astraeus.database + +/** + * User: rnentjes + * Date: 18-10-15 + * Time: 16:40 + */ + +fun transaction(name: String = "default", task: () -> Unit) { + val db = SimpleDatabase.get(name) + + if (db.transactionActive()) { + return task() + } else { + try { + db.begin() + + task() + + db.commit() + } finally { + if (db.transactionActive()) { + db.rollback() + } + } + } +} + +fun transaction(name: String = "default", task: () -> T): T { + val db = SimpleDatabase.get(name) + + if (db.transactionActive()) { + return task() + } else { + try { + db.begin() + + val result = task() + + db.commit() + + return result + } finally { + if (db.transactionActive()) { + db.rollback() + } + } + } +} diff --git a/src/main/kotlin/nl/astraeus/database/Queries.kt b/src/main/kotlin/nl/astraeus/database/Queries.kt new file mode 100644 index 0000000..68f4a7f --- /dev/null +++ b/src/main/kotlin/nl/astraeus/database/Queries.kt @@ -0,0 +1,27 @@ +package nl.astraeus.database + +import java.sql.ResultSet + +/** + * User: rnentjes + * Date: 18-10-15 + * Time: 16:46 + */ + +fun execute(dbName: String = "default", query: String, vararg args: Any) { + val db = SimpleDatabase.get(dbName) + + db.execute(query, *args) +} + +fun query(dbName: String = "default", query: String, vararg args: Any): ResultSet { + val db = SimpleDatabase.get(dbName) + + return db.executeQuery(query, *args) +} + +fun update(dbName: String = "default", query: String, vararg args: Any): Int { + val db = SimpleDatabase.get(dbName) + + return db.executeUpdate(query, *args) +} diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/modules/simple-database-kotlin_main.iml b/.idea/modules/simple-database-kotlin_main.iml index 6f48844..3ef6611 100644 --- a/.idea/modules/simple-database-kotlin_main.iml +++ b/.idea/modules/simple-database-kotlin_main.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -10,12 +11,10 @@ - - - - + + + + - - \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin_test.iml b/.idea/modules/simple-database-kotlin_test.iml index 27bbb5c..8a224c0 100644 --- a/.idea/modules/simple-database-kotlin_test.iml +++ b/.idea/modules/simple-database-kotlin_test.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -13,14 +14,13 @@ - - + + - - + + + - - diff --git a/.idea/modules/simple_database_kotlin_main.iml b/.idea/modules/simple_database_kotlin_main.iml deleted file mode 100644 index 52d8a33..0000000 --- a/.idea/modules/simple_database_kotlin_main.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/simple_database_kotlin_test.iml b/.idea/modules/simple_database_kotlin_test.iml deleted file mode 100644 index abf4720..0000000 --- a/.idea/modules/simple_database_kotlin_test.iml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index fb33c63..4687896 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ -group 'nl.astraeus.database' -version '1.4.12-SNAPSHOT' +group 'nl.astraeus' +version '2.0.5' apply plugin: 'kotlin' apply plugin: 'idea' @@ -8,19 +8,15 @@ apply plugin: 'maven-publish' apply plugin: 'net.researchgate.release' -sourceSets { - main.java.srcDirs += 'src' - test.java.srcDirs += 'test' -} - repositories { + mavenCentral() maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" } } buildscript { - ext.kotlin_version = '1.0.4' + ext.kotlin_version = '1.2.30' repositories { maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" @@ -37,11 +33,13 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' + testCompile "com.h2database:h2:1.4.+" compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - compile "nl.astraeus.database:simple-database:1.3.1" + compile "nl.astraeus:simple-database:2.0.4" } +/* uploadArchives { repositories { mavenDeployer { @@ -54,6 +52,7 @@ } } } +*/ findbugs { ignoreFailures = true @@ -63,6 +62,21 @@ failOnError = false } +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar + archives javadocJar +} + publishing { publications { mavenJava(MavenPublication) { @@ -70,3 +84,14 @@ } } } + +task fatJar(type: Jar) { + manifest { + attributes 'Implementation-Title': 'simple-database-kotlin', + 'Implementation-Version': version + } + baseName = project.name + '-nodep' + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + with jar +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f6b5590..d579dc8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..92c5565 --- /dev/null +++ b/readme.md @@ -0,0 +1,97 @@ +# Simple database kotlin + +## Maven, gradle etc: + +Add maven repository: https://nexus.astraeus.nl/nexus/content/groups/public + +Pom: + +```xml + + nl.astraeus + simple-database-kotlin + 2.0.2 + +``` + +## Minimal example: + +```kotlin +// see in test: nl.astraeus.database.example.MinimalExample.kt +@Table(name="persons") +@Cache(maxSize = 6) +class Person( + @Id val id: Long = 0, + + @Length(value = 200) + @Default("'new name'") + var name: String, + + @Default("21") + var age: Int, + + @Length(precision = 10, scale = 2) + var balance: Double, + + var address: String +) { + // no-arg constructor required + constructor(): this(0, "", 0, 0.0, "") + + constructor(name: String, age: Int, address: String): this(0, name, age, 0.0, address) +} + +fun main(args: Array) { + // define the default database, all it needs it a way to get a connection + val db = SimpleDatabase.define(object : ConnectionProvider() { + @Throws(SQLException::class, ClassNotFoundException::class) + override fun getConnection(): Connection { + Class.forName("org.h2.Driver") + + val connection = DriverManager.getConnection("jdbc:h2:mem:Example;DB_CLOSE_DELAY=-1", "sa", "") + connection.autoCommit = false + + return connection + } + }) + + // automatically create database tables and columns if needed + db.setExecuteDDLUpdates(true) + + // use default dao (extends it if you need more) + val personDao = SimpleDao(Person::class.java) + + // execute multiple dao actions in transaction + personDao.execute({ dao -> + dao.insert(Person("John", 40, "Road")) + dao.insert(Person("Jan", 32, "Straat")) + dao.insert(Person("Ronald", 31, "Wherever")) + dao.insert(Person("Piet", 26, "Weg")) + dao.insert(Person("Klaas", 10, "Pad")) + }) + + // find persons, read actions don't need a transaction + var persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } + + // start transaction because of the update + db.begin() + + transaction { + val person = personDao.find("name = ? and age = ?", "John", 40) + + person.name = "Johnny" + + personDao.update(person) + } + + persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } +} +``` \ No newline at end of file diff --git a/simple-database-kotlin.ipr b/simple-database-kotlin.ipr index f0ea744..d8ea304 100644 --- a/simple-database-kotlin.ipr +++ b/simple-database-kotlin.ipr @@ -1,25 +1,9 @@ - + + + + + @@ -57,26 +47,18 @@ - - + + + - + - - - - - - - - - @@ -86,16 +68,16 @@ - + - + - + - + @@ -109,40 +91,31 @@ - + - + - + - + - + - + - + - + - - - - - - - - - - + diff --git a/src/main/kotlin/nl/astraeus/database/Database.kt b/src/main/kotlin/nl/astraeus/database/Database.kt new file mode 100644 index 0000000..f827971 --- /dev/null +++ b/src/main/kotlin/nl/astraeus/database/Database.kt @@ -0,0 +1,49 @@ +package nl.astraeus.database + +/** + * User: rnentjes + * Date: 18-10-15 + * Time: 16:40 + */ + +fun transaction(name: String = "default", task: () -> Unit) { + val db = SimpleDatabase.get(name) + + if (db.transactionActive()) { + return task() + } else { + try { + db.begin() + + task() + + db.commit() + } finally { + if (db.transactionActive()) { + db.rollback() + } + } + } +} + +fun transaction(name: String = "default", task: () -> T): T { + val db = SimpleDatabase.get(name) + + if (db.transactionActive()) { + return task() + } else { + try { + db.begin() + + val result = task() + + db.commit() + + return result + } finally { + if (db.transactionActive()) { + db.rollback() + } + } + } +} diff --git a/src/main/kotlin/nl/astraeus/database/Queries.kt b/src/main/kotlin/nl/astraeus/database/Queries.kt new file mode 100644 index 0000000..68f4a7f --- /dev/null +++ b/src/main/kotlin/nl/astraeus/database/Queries.kt @@ -0,0 +1,27 @@ +package nl.astraeus.database + +import java.sql.ResultSet + +/** + * User: rnentjes + * Date: 18-10-15 + * Time: 16:46 + */ + +fun execute(dbName: String = "default", query: String, vararg args: Any) { + val db = SimpleDatabase.get(dbName) + + db.execute(query, *args) +} + +fun query(dbName: String = "default", query: String, vararg args: Any): ResultSet { + val db = SimpleDatabase.get(dbName) + + return db.executeQuery(query, *args) +} + +fun update(dbName: String = "default", query: String, vararg args: Any): Int { + val db = SimpleDatabase.get(dbName) + + return db.executeUpdate(query, *args) +} diff --git a/src/test/kotlin/nl/astraeus/database/TestQueries.kt b/src/test/kotlin/nl/astraeus/database/TestQueries.kt new file mode 100644 index 0000000..224cfb6 --- /dev/null +++ b/src/test/kotlin/nl/astraeus/database/TestQueries.kt @@ -0,0 +1,193 @@ +package nl.astraeus.database + +import nl.astraeus.database.annotations.Column +import nl.astraeus.database.annotations.Id +import nl.astraeus.database.annotations.Table +import nl.astraeus.database.jdbc.ConnectionPool +import nl.astraeus.database.jdbc.ConnectionProvider +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Test +import java.sql.Connection +import java.sql.DriverManager + +/** + * User: rnentjes + * Date: 18-10-15 + * Time: 17:00 + */ + +@Table +class Company(var name: String) { + @Id var id: Long = 0 + + protected constructor(): this("") + + fun users(): List { + return transaction> { + UserDao.where("company = ?", id) + } + } +} + +@Table(name = "usr") +class User( + var company: Company, + var name: String, + var email: String) { + @Id var id: Long = 0 + + protected constructor(): this(Company(""), "", "") +} + +// needs manual index to prevent double entries +@Table +class ManyToMany(var company: Company, @Column(name = "usr") var user: User) { + @Id var id: Long = 0 + + protected constructor(): this(Company(""), User(Company(""), "", "")) +} + +object CompanyDao: SimpleDao(Company::class.java) + +object UserDao: SimpleDao(User::class.java) + +object MTMDao: SimpleDao(ManyToMany::class.java) { + + fun users(comp: Company): List { + return transaction> { + UserDao.from("join manytomany where manytomany.user = usr.id and manytomany.company = ?", comp.id) + val dao = UserDao() + + dao.from("join manytomany where manytomany.user = usr.id and manytomany.company = ?", comp.id) + } + } + + fun companies(user: User): List { + return transaction> { + CompanyDao.from("join manytomany where manytomany.company = company.id and manytomany.user = ?", user.id) + } + } +} + +fun createConnection(): Connection { + Class.forName("org.h2.Driver") + + val connection = DriverManager.getConnection("jdbc:h2:mem:TestQueries", "sa", "") + connection.autoCommit = false + + // result + return connection +} + +class MyConnectionProvider : ConnectionProvider() { + + override fun getConnection() = createConnection() + + override fun getDefinition(): DdlMapping.DatabaseDefinition { + return DdlMapping.DatabaseDefinition.H2 + } +} + +class TestQueries { + @Before fun setUp() { + val db = SimpleDatabase.define(ConnectionPool(MyConnectionProvider())) + + db.setExecuteDDLUpdates(true); + } + + @Test fun testWhere() { + + transaction { + val company = Company("company") + + val rien = User(company, "Rien", "info@somewhere.com") + val piet = User(company, "Piet", "piet@somewhere.com") + + UserDao.insert(info) + UserDao.upsert(piet) + + info.name = "Iiiinfo" + UserDao.update(info) + + piet.email = "pietje@somewhere.com" + UserDao.upsert(piet) + + MTMDao.insert(ManyToMany(company, info)) + MTMDao.insert(ManyToMany(company, piet)) + MTMDao.insert(ManyToMany(Company("Other company"), info)) + } + + transaction { + val user = UserDao.find("name = ?", "Iiiinfo") + + if (user != null) { + user.company.name = "Better Company!" + + CompanyDao.update(user.company) + + val companies = MTMDao.companies(user) + + for (company in companies) { + println("Company from ${user.name} -> ${company.name}") + } + } + } + + transaction { + val found = UserDao.where("name = ?", "Iiiinfo") + + assertTrue(found.size == 1) + + assertTrue(UserDao.all().size == 2) + + assertTrue(UserDao.count("name = ?", "Piet") == 1) + + for(company in CompanyDao.all()) { + println("Company: #${company.id} - ${company.name}") + + for(user in company.users()) { + println("Company user: #${user.id} - ${user.name} - ${user.email} - ${user.company.name}") + } + } + + for(user in UserDao.all()) { + println("Found: #${user.id} - ${user.name} - ${user.email} - ${user.company.name}") + } + + var rs = query(query = "SELECT * FROM company") + + while(rs.next()) { + print("Company: ") + print(rs.getLong(1)) + print(" - ") + println(rs.getString(2)) + } + + rs = query(query = "SELECT * FROM usr") + + while(rs.next()) { + print("User: ") + print(rs.getLong(1)) + print(" - ") + print(rs.getLong(2)) + print(" - ") + print(rs.getString(3)) + print(" - ") + println(rs.getString(4)) + } + + rs = query(query = "SELECT * FROM manytomany") + + while(rs.next()) { + print("MTM: ") + print(rs.getLong(1)) + print(" - ") + print(rs.getLong(2)) + print(" - ") + println(rs.getLong(3)) + } + } + } + +} diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/modules/simple-database-kotlin_main.iml b/.idea/modules/simple-database-kotlin_main.iml index 6f48844..3ef6611 100644 --- a/.idea/modules/simple-database-kotlin_main.iml +++ b/.idea/modules/simple-database-kotlin_main.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -10,12 +11,10 @@ - - - - + + + + - - \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin_test.iml b/.idea/modules/simple-database-kotlin_test.iml index 27bbb5c..8a224c0 100644 --- a/.idea/modules/simple-database-kotlin_test.iml +++ b/.idea/modules/simple-database-kotlin_test.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -13,14 +14,13 @@ - - + + - - + + + - - diff --git a/.idea/modules/simple_database_kotlin_main.iml b/.idea/modules/simple_database_kotlin_main.iml deleted file mode 100644 index 52d8a33..0000000 --- a/.idea/modules/simple_database_kotlin_main.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/simple_database_kotlin_test.iml b/.idea/modules/simple_database_kotlin_test.iml deleted file mode 100644 index abf4720..0000000 --- a/.idea/modules/simple_database_kotlin_test.iml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index fb33c63..4687896 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ -group 'nl.astraeus.database' -version '1.4.12-SNAPSHOT' +group 'nl.astraeus' +version '2.0.5' apply plugin: 'kotlin' apply plugin: 'idea' @@ -8,19 +8,15 @@ apply plugin: 'maven-publish' apply plugin: 'net.researchgate.release' -sourceSets { - main.java.srcDirs += 'src' - test.java.srcDirs += 'test' -} - repositories { + mavenCentral() maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" } } buildscript { - ext.kotlin_version = '1.0.4' + ext.kotlin_version = '1.2.30' repositories { maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" @@ -37,11 +33,13 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' + testCompile "com.h2database:h2:1.4.+" compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - compile "nl.astraeus.database:simple-database:1.3.1" + compile "nl.astraeus:simple-database:2.0.4" } +/* uploadArchives { repositories { mavenDeployer { @@ -54,6 +52,7 @@ } } } +*/ findbugs { ignoreFailures = true @@ -63,6 +62,21 @@ failOnError = false } +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar + archives javadocJar +} + publishing { publications { mavenJava(MavenPublication) { @@ -70,3 +84,14 @@ } } } + +task fatJar(type: Jar) { + manifest { + attributes 'Implementation-Title': 'simple-database-kotlin', + 'Implementation-Version': version + } + baseName = project.name + '-nodep' + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + with jar +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f6b5590..d579dc8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..92c5565 --- /dev/null +++ b/readme.md @@ -0,0 +1,97 @@ +# Simple database kotlin + +## Maven, gradle etc: + +Add maven repository: https://nexus.astraeus.nl/nexus/content/groups/public + +Pom: + +```xml + + nl.astraeus + simple-database-kotlin + 2.0.2 + +``` + +## Minimal example: + +```kotlin +// see in test: nl.astraeus.database.example.MinimalExample.kt +@Table(name="persons") +@Cache(maxSize = 6) +class Person( + @Id val id: Long = 0, + + @Length(value = 200) + @Default("'new name'") + var name: String, + + @Default("21") + var age: Int, + + @Length(precision = 10, scale = 2) + var balance: Double, + + var address: String +) { + // no-arg constructor required + constructor(): this(0, "", 0, 0.0, "") + + constructor(name: String, age: Int, address: String): this(0, name, age, 0.0, address) +} + +fun main(args: Array) { + // define the default database, all it needs it a way to get a connection + val db = SimpleDatabase.define(object : ConnectionProvider() { + @Throws(SQLException::class, ClassNotFoundException::class) + override fun getConnection(): Connection { + Class.forName("org.h2.Driver") + + val connection = DriverManager.getConnection("jdbc:h2:mem:Example;DB_CLOSE_DELAY=-1", "sa", "") + connection.autoCommit = false + + return connection + } + }) + + // automatically create database tables and columns if needed + db.setExecuteDDLUpdates(true) + + // use default dao (extends it if you need more) + val personDao = SimpleDao(Person::class.java) + + // execute multiple dao actions in transaction + personDao.execute({ dao -> + dao.insert(Person("John", 40, "Road")) + dao.insert(Person("Jan", 32, "Straat")) + dao.insert(Person("Ronald", 31, "Wherever")) + dao.insert(Person("Piet", 26, "Weg")) + dao.insert(Person("Klaas", 10, "Pad")) + }) + + // find persons, read actions don't need a transaction + var persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } + + // start transaction because of the update + db.begin() + + transaction { + val person = personDao.find("name = ? and age = ?", "John", 40) + + person.name = "Johnny" + + personDao.update(person) + } + + persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } +} +``` \ No newline at end of file diff --git a/simple-database-kotlin.ipr b/simple-database-kotlin.ipr index f0ea744..d8ea304 100644 --- a/simple-database-kotlin.ipr +++ b/simple-database-kotlin.ipr @@ -1,25 +1,9 @@ - + + + + + @@ -57,26 +47,18 @@ - - + + + - + - - - - - - - - - @@ -86,16 +68,16 @@ - + - + - + - + @@ -109,40 +91,31 @@ - + - + - + - + - + - + - + - + - - - - - - - - - - + diff --git a/src/main/kotlin/nl/astraeus/database/Database.kt b/src/main/kotlin/nl/astraeus/database/Database.kt new file mode 100644 index 0000000..f827971 --- /dev/null +++ b/src/main/kotlin/nl/astraeus/database/Database.kt @@ -0,0 +1,49 @@ +package nl.astraeus.database + +/** + * User: rnentjes + * Date: 18-10-15 + * Time: 16:40 + */ + +fun transaction(name: String = "default", task: () -> Unit) { + val db = SimpleDatabase.get(name) + + if (db.transactionActive()) { + return task() + } else { + try { + db.begin() + + task() + + db.commit() + } finally { + if (db.transactionActive()) { + db.rollback() + } + } + } +} + +fun transaction(name: String = "default", task: () -> T): T { + val db = SimpleDatabase.get(name) + + if (db.transactionActive()) { + return task() + } else { + try { + db.begin() + + val result = task() + + db.commit() + + return result + } finally { + if (db.transactionActive()) { + db.rollback() + } + } + } +} diff --git a/src/main/kotlin/nl/astraeus/database/Queries.kt b/src/main/kotlin/nl/astraeus/database/Queries.kt new file mode 100644 index 0000000..68f4a7f --- /dev/null +++ b/src/main/kotlin/nl/astraeus/database/Queries.kt @@ -0,0 +1,27 @@ +package nl.astraeus.database + +import java.sql.ResultSet + +/** + * User: rnentjes + * Date: 18-10-15 + * Time: 16:46 + */ + +fun execute(dbName: String = "default", query: String, vararg args: Any) { + val db = SimpleDatabase.get(dbName) + + db.execute(query, *args) +} + +fun query(dbName: String = "default", query: String, vararg args: Any): ResultSet { + val db = SimpleDatabase.get(dbName) + + return db.executeQuery(query, *args) +} + +fun update(dbName: String = "default", query: String, vararg args: Any): Int { + val db = SimpleDatabase.get(dbName) + + return db.executeUpdate(query, *args) +} diff --git a/src/test/kotlin/nl/astraeus/database/TestQueries.kt b/src/test/kotlin/nl/astraeus/database/TestQueries.kt new file mode 100644 index 0000000..224cfb6 --- /dev/null +++ b/src/test/kotlin/nl/astraeus/database/TestQueries.kt @@ -0,0 +1,193 @@ +package nl.astraeus.database + +import nl.astraeus.database.annotations.Column +import nl.astraeus.database.annotations.Id +import nl.astraeus.database.annotations.Table +import nl.astraeus.database.jdbc.ConnectionPool +import nl.astraeus.database.jdbc.ConnectionProvider +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Test +import java.sql.Connection +import java.sql.DriverManager + +/** + * User: rnentjes + * Date: 18-10-15 + * Time: 17:00 + */ + +@Table +class Company(var name: String) { + @Id var id: Long = 0 + + protected constructor(): this("") + + fun users(): List { + return transaction> { + UserDao.where("company = ?", id) + } + } +} + +@Table(name = "usr") +class User( + var company: Company, + var name: String, + var email: String) { + @Id var id: Long = 0 + + protected constructor(): this(Company(""), "", "") +} + +// needs manual index to prevent double entries +@Table +class ManyToMany(var company: Company, @Column(name = "usr") var user: User) { + @Id var id: Long = 0 + + protected constructor(): this(Company(""), User(Company(""), "", "")) +} + +object CompanyDao: SimpleDao(Company::class.java) + +object UserDao: SimpleDao(User::class.java) + +object MTMDao: SimpleDao(ManyToMany::class.java) { + + fun users(comp: Company): List { + return transaction> { + UserDao.from("join manytomany where manytomany.user = usr.id and manytomany.company = ?", comp.id) + val dao = UserDao() + + dao.from("join manytomany where manytomany.user = usr.id and manytomany.company = ?", comp.id) + } + } + + fun companies(user: User): List { + return transaction> { + CompanyDao.from("join manytomany where manytomany.company = company.id and manytomany.user = ?", user.id) + } + } +} + +fun createConnection(): Connection { + Class.forName("org.h2.Driver") + + val connection = DriverManager.getConnection("jdbc:h2:mem:TestQueries", "sa", "") + connection.autoCommit = false + + // result + return connection +} + +class MyConnectionProvider : ConnectionProvider() { + + override fun getConnection() = createConnection() + + override fun getDefinition(): DdlMapping.DatabaseDefinition { + return DdlMapping.DatabaseDefinition.H2 + } +} + +class TestQueries { + @Before fun setUp() { + val db = SimpleDatabase.define(ConnectionPool(MyConnectionProvider())) + + db.setExecuteDDLUpdates(true); + } + + @Test fun testWhere() { + + transaction { + val company = Company("company") + + val rien = User(company, "Rien", "info@somewhere.com") + val piet = User(company, "Piet", "piet@somewhere.com") + + UserDao.insert(info) + UserDao.upsert(piet) + + info.name = "Iiiinfo" + UserDao.update(info) + + piet.email = "pietje@somewhere.com" + UserDao.upsert(piet) + + MTMDao.insert(ManyToMany(company, info)) + MTMDao.insert(ManyToMany(company, piet)) + MTMDao.insert(ManyToMany(Company("Other company"), info)) + } + + transaction { + val user = UserDao.find("name = ?", "Iiiinfo") + + if (user != null) { + user.company.name = "Better Company!" + + CompanyDao.update(user.company) + + val companies = MTMDao.companies(user) + + for (company in companies) { + println("Company from ${user.name} -> ${company.name}") + } + } + } + + transaction { + val found = UserDao.where("name = ?", "Iiiinfo") + + assertTrue(found.size == 1) + + assertTrue(UserDao.all().size == 2) + + assertTrue(UserDao.count("name = ?", "Piet") == 1) + + for(company in CompanyDao.all()) { + println("Company: #${company.id} - ${company.name}") + + for(user in company.users()) { + println("Company user: #${user.id} - ${user.name} - ${user.email} - ${user.company.name}") + } + } + + for(user in UserDao.all()) { + println("Found: #${user.id} - ${user.name} - ${user.email} - ${user.company.name}") + } + + var rs = query(query = "SELECT * FROM company") + + while(rs.next()) { + print("Company: ") + print(rs.getLong(1)) + print(" - ") + println(rs.getString(2)) + } + + rs = query(query = "SELECT * FROM usr") + + while(rs.next()) { + print("User: ") + print(rs.getLong(1)) + print(" - ") + print(rs.getLong(2)) + print(" - ") + print(rs.getString(3)) + print(" - ") + println(rs.getString(4)) + } + + rs = query(query = "SELECT * FROM manytomany") + + while(rs.next()) { + print("MTM: ") + print(rs.getLong(1)) + print(" - ") + print(rs.getLong(2)) + print(" - ") + println(rs.getLong(3)) + } + } + } + +} diff --git a/src/test/kotlin/nl/astraeus/database/example/MinimalExample.kt b/src/test/kotlin/nl/astraeus/database/example/MinimalExample.kt new file mode 100644 index 0000000..35fcfba --- /dev/null +++ b/src/test/kotlin/nl/astraeus/database/example/MinimalExample.kt @@ -0,0 +1,92 @@ +package nl.astraeus.database.example + +import nl.astraeus.database.SimpleDao +import nl.astraeus.database.SimpleDatabase +import nl.astraeus.database.annotations.* +import nl.astraeus.database.jdbc.ConnectionProvider +import nl.astraeus.database.transaction +import java.sql.Connection +import java.sql.DriverManager +import java.sql.SQLException + +/** + * User: rnentjes + * Date: 11-12-16 + * Time: 16:43 + */ +@Table(name="persons") +@Cache(maxSize = 6) +class Person( + @Id val id: Long = 0, + + @Length(value = 200) + @Default("'new name'") + var name: String, + + @Default("21") + var age: Int, + + @Length(precision = 10, scale = 2) + var balance: Double, + + var address: String +) { + // no-arg constructor required + constructor(): this(0, "", 0, 0.0, "") + + constructor(name: String, age: Int, address: String): this(0, name, age, 0.0, address) +} + +fun main(args: Array) { + // define the default database, all it needs it a way to get a connection + val db = SimpleDatabase.define(object : ConnectionProvider() { + @Throws(SQLException::class, ClassNotFoundException::class) + override fun getConnection(): Connection { + Class.forName("org.h2.Driver") + + val connection = DriverManager.getConnection("jdbc:h2:mem:Example;DB_CLOSE_DELAY=-1", "sa", "") + connection.autoCommit = false + + return connection + } + }) + + // automatically create database tables and columns if needed + db.setExecuteDDLUpdates(true) + + // use default dao (extends it if you need more) + val personDao = SimpleDao(Person::class.java) + + // execute multiple dao actions in transaction + personDao.execute({ dao -> + dao.insert(Person("John", 40, "Road")) + dao.insert(Person("Jan", 32, "Straat")) + dao.insert(Person("Ronald", 31, "Wherever")) + dao.insert(Person("Piet", 26, "Weg")) + dao.insert(Person("Klaas", 10, "Pad")) + }) + + // find persons, read actions don't need a transaction + var persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } + + // start transaction because of the update + db.begin() + + transaction { + val person = personDao.find("name = ? and age = ?", "John", 40) + + person.name = "Johnny" + + personDao.update(person) + } + + persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } +} diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..c78bf7a --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hotswap_agent.xml b/.idea/hotswap_agent.xml new file mode 100644 index 0000000..d73a0fd --- /dev/null +++ b/.idea/hotswap_agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml deleted file mode 100644 index da14166..0000000 --- a/.idea/libraries/Gradle__com_h2database_h2_1_4_192.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml new file mode 100644 index 0000000..80cfa8b --- /dev/null +++ b/.idea/libraries/Gradle__com_h2database_h2_1_4_196.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml deleted file mode 100644 index f9056ef..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_database_simple_database_1_2_4_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml new file mode 100644 index 0000000..4380f62 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_simple_database_2_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml deleted file mode 100644 index a93b4c0..0000000 --- a/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3_SNAPSHOT.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml new file mode 100644 index 0000000..7755a30 --- /dev/null +++ b/.idea/libraries/Gradle__nl_astraeus_very_simple_templates_1_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml new file mode 100644 index 0000000..0f8be77 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_2_30.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml deleted file mode 100644 index 1a91ac2..0000000 --- a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_21.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296c449..ade17ed 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,8 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin.iml b/.idea/modules/simple-database-kotlin.iml index 9bc01e1..2e7168a 100644 --- a/.idea/modules/simple-database-kotlin.iml +++ b/.idea/modules/simple-database-kotlin.iml @@ -1,10 +1,11 @@ - + + diff --git a/.idea/modules/simple-database-kotlin_main.iml b/.idea/modules/simple-database-kotlin_main.iml index 6f48844..3ef6611 100644 --- a/.idea/modules/simple-database-kotlin_main.iml +++ b/.idea/modules/simple-database-kotlin_main.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -10,12 +11,10 @@ - - - - + + + + - - \ No newline at end of file diff --git a/.idea/modules/simple-database-kotlin_test.iml b/.idea/modules/simple-database-kotlin_test.iml index 27bbb5c..8a224c0 100644 --- a/.idea/modules/simple-database-kotlin_test.iml +++ b/.idea/modules/simple-database-kotlin_test.iml @@ -1,7 +1,8 @@ - - - + + + + @@ -13,14 +14,13 @@ - - + + - - + + + - - diff --git a/.idea/modules/simple_database_kotlin_main.iml b/.idea/modules/simple_database_kotlin_main.iml deleted file mode 100644 index 52d8a33..0000000 --- a/.idea/modules/simple_database_kotlin_main.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/simple_database_kotlin_test.iml b/.idea/modules/simple_database_kotlin_test.iml deleted file mode 100644 index abf4720..0000000 --- a/.idea/modules/simple_database_kotlin_test.iml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index fb33c63..4687896 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ -group 'nl.astraeus.database' -version '1.4.12-SNAPSHOT' +group 'nl.astraeus' +version '2.0.5' apply plugin: 'kotlin' apply plugin: 'idea' @@ -8,19 +8,15 @@ apply plugin: 'maven-publish' apply plugin: 'net.researchgate.release' -sourceSets { - main.java.srcDirs += 'src' - test.java.srcDirs += 'test' -} - repositories { + mavenCentral() maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" } } buildscript { - ext.kotlin_version = '1.0.4' + ext.kotlin_version = '1.2.30' repositories { maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" @@ -37,11 +33,13 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' + testCompile "com.h2database:h2:1.4.+" compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - compile "nl.astraeus.database:simple-database:1.3.1" + compile "nl.astraeus:simple-database:2.0.4" } +/* uploadArchives { repositories { mavenDeployer { @@ -54,6 +52,7 @@ } } } +*/ findbugs { ignoreFailures = true @@ -63,6 +62,21 @@ failOnError = false } +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar + archives javadocJar +} + publishing { publications { mavenJava(MavenPublication) { @@ -70,3 +84,14 @@ } } } + +task fatJar(type: Jar) { + manifest { + attributes 'Implementation-Title': 'simple-database-kotlin', + 'Implementation-Version': version + } + baseName = project.name + '-nodep' + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + with jar +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f6b5590..d579dc8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..92c5565 --- /dev/null +++ b/readme.md @@ -0,0 +1,97 @@ +# Simple database kotlin + +## Maven, gradle etc: + +Add maven repository: https://nexus.astraeus.nl/nexus/content/groups/public + +Pom: + +```xml + + nl.astraeus + simple-database-kotlin + 2.0.2 + +``` + +## Minimal example: + +```kotlin +// see in test: nl.astraeus.database.example.MinimalExample.kt +@Table(name="persons") +@Cache(maxSize = 6) +class Person( + @Id val id: Long = 0, + + @Length(value = 200) + @Default("'new name'") + var name: String, + + @Default("21") + var age: Int, + + @Length(precision = 10, scale = 2) + var balance: Double, + + var address: String +) { + // no-arg constructor required + constructor(): this(0, "", 0, 0.0, "") + + constructor(name: String, age: Int, address: String): this(0, name, age, 0.0, address) +} + +fun main(args: Array) { + // define the default database, all it needs it a way to get a connection + val db = SimpleDatabase.define(object : ConnectionProvider() { + @Throws(SQLException::class, ClassNotFoundException::class) + override fun getConnection(): Connection { + Class.forName("org.h2.Driver") + + val connection = DriverManager.getConnection("jdbc:h2:mem:Example;DB_CLOSE_DELAY=-1", "sa", "") + connection.autoCommit = false + + return connection + } + }) + + // automatically create database tables and columns if needed + db.setExecuteDDLUpdates(true) + + // use default dao (extends it if you need more) + val personDao = SimpleDao(Person::class.java) + + // execute multiple dao actions in transaction + personDao.execute({ dao -> + dao.insert(Person("John", 40, "Road")) + dao.insert(Person("Jan", 32, "Straat")) + dao.insert(Person("Ronald", 31, "Wherever")) + dao.insert(Person("Piet", 26, "Weg")) + dao.insert(Person("Klaas", 10, "Pad")) + }) + + // find persons, read actions don't need a transaction + var persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } + + // start transaction because of the update + db.begin() + + transaction { + val person = personDao.find("name = ? and age = ?", "John", 40) + + person.name = "Johnny" + + personDao.update(person) + } + + persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } +} +``` \ No newline at end of file diff --git a/simple-database-kotlin.ipr b/simple-database-kotlin.ipr index f0ea744..d8ea304 100644 --- a/simple-database-kotlin.ipr +++ b/simple-database-kotlin.ipr @@ -1,25 +1,9 @@ - + + + + + @@ -57,26 +47,18 @@ - - + + + - + - - - - - - - - - @@ -86,16 +68,16 @@ - + - + - + - + @@ -109,40 +91,31 @@ - + - + - + - + - + - + - + - + - - - - - - - - - - + diff --git a/src/main/kotlin/nl/astraeus/database/Database.kt b/src/main/kotlin/nl/astraeus/database/Database.kt new file mode 100644 index 0000000..f827971 --- /dev/null +++ b/src/main/kotlin/nl/astraeus/database/Database.kt @@ -0,0 +1,49 @@ +package nl.astraeus.database + +/** + * User: rnentjes + * Date: 18-10-15 + * Time: 16:40 + */ + +fun transaction(name: String = "default", task: () -> Unit) { + val db = SimpleDatabase.get(name) + + if (db.transactionActive()) { + return task() + } else { + try { + db.begin() + + task() + + db.commit() + } finally { + if (db.transactionActive()) { + db.rollback() + } + } + } +} + +fun transaction(name: String = "default", task: () -> T): T { + val db = SimpleDatabase.get(name) + + if (db.transactionActive()) { + return task() + } else { + try { + db.begin() + + val result = task() + + db.commit() + + return result + } finally { + if (db.transactionActive()) { + db.rollback() + } + } + } +} diff --git a/src/main/kotlin/nl/astraeus/database/Queries.kt b/src/main/kotlin/nl/astraeus/database/Queries.kt new file mode 100644 index 0000000..68f4a7f --- /dev/null +++ b/src/main/kotlin/nl/astraeus/database/Queries.kt @@ -0,0 +1,27 @@ +package nl.astraeus.database + +import java.sql.ResultSet + +/** + * User: rnentjes + * Date: 18-10-15 + * Time: 16:46 + */ + +fun execute(dbName: String = "default", query: String, vararg args: Any) { + val db = SimpleDatabase.get(dbName) + + db.execute(query, *args) +} + +fun query(dbName: String = "default", query: String, vararg args: Any): ResultSet { + val db = SimpleDatabase.get(dbName) + + return db.executeQuery(query, *args) +} + +fun update(dbName: String = "default", query: String, vararg args: Any): Int { + val db = SimpleDatabase.get(dbName) + + return db.executeUpdate(query, *args) +} diff --git a/src/test/kotlin/nl/astraeus/database/TestQueries.kt b/src/test/kotlin/nl/astraeus/database/TestQueries.kt new file mode 100644 index 0000000..224cfb6 --- /dev/null +++ b/src/test/kotlin/nl/astraeus/database/TestQueries.kt @@ -0,0 +1,193 @@ +package nl.astraeus.database + +import nl.astraeus.database.annotations.Column +import nl.astraeus.database.annotations.Id +import nl.astraeus.database.annotations.Table +import nl.astraeus.database.jdbc.ConnectionPool +import nl.astraeus.database.jdbc.ConnectionProvider +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Test +import java.sql.Connection +import java.sql.DriverManager + +/** + * User: rnentjes + * Date: 18-10-15 + * Time: 17:00 + */ + +@Table +class Company(var name: String) { + @Id var id: Long = 0 + + protected constructor(): this("") + + fun users(): List { + return transaction> { + UserDao.where("company = ?", id) + } + } +} + +@Table(name = "usr") +class User( + var company: Company, + var name: String, + var email: String) { + @Id var id: Long = 0 + + protected constructor(): this(Company(""), "", "") +} + +// needs manual index to prevent double entries +@Table +class ManyToMany(var company: Company, @Column(name = "usr") var user: User) { + @Id var id: Long = 0 + + protected constructor(): this(Company(""), User(Company(""), "", "")) +} + +object CompanyDao: SimpleDao(Company::class.java) + +object UserDao: SimpleDao(User::class.java) + +object MTMDao: SimpleDao(ManyToMany::class.java) { + + fun users(comp: Company): List { + return transaction> { + UserDao.from("join manytomany where manytomany.user = usr.id and manytomany.company = ?", comp.id) + val dao = UserDao() + + dao.from("join manytomany where manytomany.user = usr.id and manytomany.company = ?", comp.id) + } + } + + fun companies(user: User): List { + return transaction> { + CompanyDao.from("join manytomany where manytomany.company = company.id and manytomany.user = ?", user.id) + } + } +} + +fun createConnection(): Connection { + Class.forName("org.h2.Driver") + + val connection = DriverManager.getConnection("jdbc:h2:mem:TestQueries", "sa", "") + connection.autoCommit = false + + // result + return connection +} + +class MyConnectionProvider : ConnectionProvider() { + + override fun getConnection() = createConnection() + + override fun getDefinition(): DdlMapping.DatabaseDefinition { + return DdlMapping.DatabaseDefinition.H2 + } +} + +class TestQueries { + @Before fun setUp() { + val db = SimpleDatabase.define(ConnectionPool(MyConnectionProvider())) + + db.setExecuteDDLUpdates(true); + } + + @Test fun testWhere() { + + transaction { + val company = Company("company") + + val rien = User(company, "Rien", "info@somewhere.com") + val piet = User(company, "Piet", "piet@somewhere.com") + + UserDao.insert(info) + UserDao.upsert(piet) + + info.name = "Iiiinfo" + UserDao.update(info) + + piet.email = "pietje@somewhere.com" + UserDao.upsert(piet) + + MTMDao.insert(ManyToMany(company, info)) + MTMDao.insert(ManyToMany(company, piet)) + MTMDao.insert(ManyToMany(Company("Other company"), info)) + } + + transaction { + val user = UserDao.find("name = ?", "Iiiinfo") + + if (user != null) { + user.company.name = "Better Company!" + + CompanyDao.update(user.company) + + val companies = MTMDao.companies(user) + + for (company in companies) { + println("Company from ${user.name} -> ${company.name}") + } + } + } + + transaction { + val found = UserDao.where("name = ?", "Iiiinfo") + + assertTrue(found.size == 1) + + assertTrue(UserDao.all().size == 2) + + assertTrue(UserDao.count("name = ?", "Piet") == 1) + + for(company in CompanyDao.all()) { + println("Company: #${company.id} - ${company.name}") + + for(user in company.users()) { + println("Company user: #${user.id} - ${user.name} - ${user.email} - ${user.company.name}") + } + } + + for(user in UserDao.all()) { + println("Found: #${user.id} - ${user.name} - ${user.email} - ${user.company.name}") + } + + var rs = query(query = "SELECT * FROM company") + + while(rs.next()) { + print("Company: ") + print(rs.getLong(1)) + print(" - ") + println(rs.getString(2)) + } + + rs = query(query = "SELECT * FROM usr") + + while(rs.next()) { + print("User: ") + print(rs.getLong(1)) + print(" - ") + print(rs.getLong(2)) + print(" - ") + print(rs.getString(3)) + print(" - ") + println(rs.getString(4)) + } + + rs = query(query = "SELECT * FROM manytomany") + + while(rs.next()) { + print("MTM: ") + print(rs.getLong(1)) + print(" - ") + print(rs.getLong(2)) + print(" - ") + println(rs.getLong(3)) + } + } + } + +} diff --git a/src/test/kotlin/nl/astraeus/database/example/MinimalExample.kt b/src/test/kotlin/nl/astraeus/database/example/MinimalExample.kt new file mode 100644 index 0000000..35fcfba --- /dev/null +++ b/src/test/kotlin/nl/astraeus/database/example/MinimalExample.kt @@ -0,0 +1,92 @@ +package nl.astraeus.database.example + +import nl.astraeus.database.SimpleDao +import nl.astraeus.database.SimpleDatabase +import nl.astraeus.database.annotations.* +import nl.astraeus.database.jdbc.ConnectionProvider +import nl.astraeus.database.transaction +import java.sql.Connection +import java.sql.DriverManager +import java.sql.SQLException + +/** + * User: rnentjes + * Date: 11-12-16 + * Time: 16:43 + */ +@Table(name="persons") +@Cache(maxSize = 6) +class Person( + @Id val id: Long = 0, + + @Length(value = 200) + @Default("'new name'") + var name: String, + + @Default("21") + var age: Int, + + @Length(precision = 10, scale = 2) + var balance: Double, + + var address: String +) { + // no-arg constructor required + constructor(): this(0, "", 0, 0.0, "") + + constructor(name: String, age: Int, address: String): this(0, name, age, 0.0, address) +} + +fun main(args: Array) { + // define the default database, all it needs it a way to get a connection + val db = SimpleDatabase.define(object : ConnectionProvider() { + @Throws(SQLException::class, ClassNotFoundException::class) + override fun getConnection(): Connection { + Class.forName("org.h2.Driver") + + val connection = DriverManager.getConnection("jdbc:h2:mem:Example;DB_CLOSE_DELAY=-1", "sa", "") + connection.autoCommit = false + + return connection + } + }) + + // automatically create database tables and columns if needed + db.setExecuteDDLUpdates(true) + + // use default dao (extends it if you need more) + val personDao = SimpleDao(Person::class.java) + + // execute multiple dao actions in transaction + personDao.execute({ dao -> + dao.insert(Person("John", 40, "Road")) + dao.insert(Person("Jan", 32, "Straat")) + dao.insert(Person("Ronald", 31, "Wherever")) + dao.insert(Person("Piet", 26, "Weg")) + dao.insert(Person("Klaas", 10, "Pad")) + }) + + // find persons, read actions don't need a transaction + var persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } + + // start transaction because of the update + db.begin() + + transaction { + val person = personDao.find("name = ? and age = ?", "John", 40) + + person.name = "Johnny" + + personDao.update(person) + } + + persons = personDao.where("name like ?", "J%") + + for (person in persons) { + System.out.println("Person: " + person.name) + } +} diff --git a/test/nl/astraeus/database/TestQueries.kt b/test/nl/astraeus/database/TestQueries.kt deleted file mode 100644 index 157996a..0000000 --- a/test/nl/astraeus/database/TestQueries.kt +++ /dev/null @@ -1,189 +0,0 @@ -package nl.astraeus.database - -import nl.astraeus.database.annotations.Column -import nl.astraeus.database.annotations.Id -import nl.astraeus.database.annotations.Table -import org.junit.Assert.* -import org.junit.Before -import org.junit.Test -import java.sql.Connection -import java.sql.DriverManager - -/** - * User: rnentjes - * Date: 18-10-15 - * Time: 17:00 - */ - -@Table -class Company(var name: String) { - @Id var id: Long = 0 - - protected constructor(): this("") - - fun users(): List { - return transaction> { - UserDao.where("company = ?", id) - } - } -} - -@Table(name = "usr") -class User( - var company: Company, - var name: String, - var email: String) { - @Id var id: Long = 0 - - protected constructor(): this(Company(""), "", "") -} - -// needs manual index to prevent double entries -@Table -class ManyToMany(var company: Company, @Column(name = "usr") var user: User) { - @Id var id: Long = 0 - - protected constructor(): this(Company(""), User(Company(""), "", "")) -} - -object CompanyDao: Dao(Company::class.java) - -object UserDao: Dao(User::class.java) - -object MTMDao: Dao(ManyToMany::class.java) { - - fun users(comp: Company): List { - return transaction> { - UserDao.from("join manytomany where manytomany.user = usr.id and manytomany.company = ?", comp.id) - } - } - - fun companies(user: User): List { - return transaction> { - CompanyDao.from("join manytomany where manytomany.company = company.id and manytomany.user = ?", user.id) - } - } -} - -fun createConnection(): Connection { - Class.forName("org.h2.Driver") - - val connection = DriverManager.getConnection("jdbc:h2:mem:TestQueries", "sa", "") - connection.autoCommit = false - - // result - return connection -} - -class TestQueries { - @Before fun setUp() { - DdlMapping.get().setExecuteDDLUpdates(true) - - setConnectionProvider(::createConnection) - - setConnectionProvider { - Class.forName("org.h2.Driver") - - val connection = DriverManager.getConnection("jdbc:h2:mem:TestQueries", "sa", "") - connection.autoCommit = false - - // result - connection - } - } - - @Test fun testWhere() { - - transaction { - val company = Company("company") - - val rien = User(company, "Rien", "info@somewhere.com") - val piet = User(company, "Piet", "piet@somewhere.com") - - UserDao.insert(rien) - UserDao.upsert(piet) - - rien.name = "Rrrrien" - UserDao.update(rien) - - piet.email = "pietje@somewhere.com" - UserDao.upsert(piet) - - MTMDao.insert(ManyToMany(company, rien)) - MTMDao.insert(ManyToMany(company, piet)) - MTMDao.insert(ManyToMany(Company("Other company"), rien)) - } - - transaction { - val user = UserDao.find("name = ?", "Rrrrien") - - if (user != null) { - user.company.name = "Better Company!" - - CompanyDao.update(user.company) - - val companies = MTMDao.companies(user) - - for (company in companies) { - println("Company from ${user.name} -> ${company.name}") - } - } - } - - transaction { - var found = UserDao.where("name = ?", "Rrrrien") - - assertTrue(found.size == 1) - - assertTrue(UserDao.all().size == 2) - - assertTrue(UserDao.count("name = ?", "Piet") == 1) - - for(company in CompanyDao.all()) { - println("Company: #${company.id} - ${company.name}") - - for(user in company.users()) { - println("Company user: #${user.id} - ${user.name} - ${user.email} - ${user.company.name}") - } - } - - for(user in UserDao.all()) { - println("Found: #${user.id} - ${user.name} - ${user.email} - ${user.company.name}") - } - - var rs = query("SELECT * FROM company") - - while(rs.next()) { - print("Company: ") - print(rs.getLong(1)) - print(" - ") - println(rs.getString(2)) - } - - rs = query("SELECT * FROM usr") - - while(rs.next()) { - print("User: ") - print(rs.getLong(1)) - print(" - ") - print(rs.getLong(2)) - print(" - ") - print(rs.getString(3)) - print(" - ") - println(rs.getString(4)) - } - - rs = query("SELECT * FROM manytomany") - - while(rs.next()) { - print("MTM: ") - print(rs.getLong(1)) - print(" - ") - print(rs.getLong(2)) - print(" - ") - println(rs.getLong(3)) - } - } - } - -}