diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
new file mode 100644
index 0000000..6f39cae
--- /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..6f39cae
--- /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..8a869d9
--- /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..6f39cae
--- /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..8a869d9
--- /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_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..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +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..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_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..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
new file mode 100644
index 0000000..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
new file mode 100644
index 0000000..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +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..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
new file mode 100644
index 0000000..12bea8a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.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..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
new file mode 100644
index 0000000..12bea8a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
new file mode 100644
index 0000000..23c0838
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.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..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
new file mode 100644
index 0000000..12bea8a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
new file mode 100644
index 0000000..23c0838
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
new file mode 100644
index 0000000..fe3028a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.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..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
new file mode 100644
index 0000000..12bea8a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
new file mode 100644
index 0000000..23c0838
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
new file mode 100644
index 0000000..fe3028a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_main.iml b/.idea/modules/simple-database_main.iml
index 83181d4..fd1993b 100644
--- a/.idea/modules/simple-database_main.iml
+++ b/.idea/modules/simple-database_main.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -9,5 +9,7 @@
+
+
\ No newline at end of file
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
new file mode 100644
index 0000000..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
new file mode 100644
index 0000000..12bea8a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
new file mode 100644
index 0000000..23c0838
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
new file mode 100644
index 0000000..fe3028a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_main.iml b/.idea/modules/simple-database_main.iml
index 83181d4..fd1993b 100644
--- a/.idea/modules/simple-database_main.iml
+++ b/.idea/modules/simple-database_main.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -9,5 +9,7 @@
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_test.iml b/.idea/modules/simple-database_test.iml
index d2e9351..5a5857a 100644
--- a/.idea/modules/simple-database_test.iml
+++ b/.idea/modules/simple-database_test.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -11,8 +11,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..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
new file mode 100644
index 0000000..12bea8a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
new file mode 100644
index 0000000..23c0838
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
new file mode 100644
index 0000000..fe3028a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_main.iml b/.idea/modules/simple-database_main.iml
index 83181d4..fd1993b 100644
--- a/.idea/modules/simple-database_main.iml
+++ b/.idea/modules/simple-database_main.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -9,5 +9,7 @@
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_test.iml b/.idea/modules/simple-database_test.iml
index d2e9351..5a5857a 100644
--- a/.idea/modules/simple-database_test.iml
+++ b/.idea/modules/simple-database_test.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -11,8 +11,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 564d0a7..1d47741 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,8 +1,28 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -14,6 +34,13 @@
+
+
+
@@ -25,7 +52,6 @@
-
@@ -39,84 +65,44 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -840,29 +1057,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -935,27 +1129,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1018,29 +1191,12 @@
-
-
-
-
-
-
-
-
-
- project
-
-
-
-
-
-
-
@@ -1048,28 +1204,30 @@
+
+ project
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
@@ -1080,6 +1238,9 @@
+
+
+
@@ -1107,7 +1268,10 @@
-
+
+
+
+
1445189967799
@@ -1270,24 +1434,28 @@
1481472845176
-
+
+ 1481474559550
+
+
+
+ 1481474559550
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
@@ -1295,6 +1463,9 @@
+
+
+
@@ -1306,7 +1477,7 @@
-
+
@@ -1318,46 +1489,49 @@
-
-
+
-
+
+
+
+
+
-
-
+
+
+
+
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
@@ -1387,11 +1561,12 @@
-
+
+
-
+
@@ -1400,135 +1575,218 @@
-
+
-
-
-
-
-
+
+
-
-
+
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
+
+
-
+
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1936,12 +2067,11 @@
- simple-database_main|simple-database
+ simple-database_test|simple-database
-
@@ -1961,7 +2091,7 @@
- Gradle: com.h2database:h2:1.4.193
+ Gradle: com.h2database:h2:1.4.196
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
new file mode 100644
index 0000000..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
new file mode 100644
index 0000000..12bea8a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
new file mode 100644
index 0000000..23c0838
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
new file mode 100644
index 0000000..fe3028a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_main.iml b/.idea/modules/simple-database_main.iml
index 83181d4..fd1993b 100644
--- a/.idea/modules/simple-database_main.iml
+++ b/.idea/modules/simple-database_main.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -9,5 +9,7 @@
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_test.iml b/.idea/modules/simple-database_test.iml
index d2e9351..5a5857a 100644
--- a/.idea/modules/simple-database_test.iml
+++ b/.idea/modules/simple-database_test.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -11,8 +11,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 564d0a7..1d47741 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,8 +1,28 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -14,6 +34,13 @@
+
+
+
+
+
@@ -25,7 +52,6 @@
-
@@ -39,84 +65,44 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -126,40 +112,143 @@
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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database
+ simple-database_test|simple-database
-
@@ -1961,7 +2091,7 @@
- Gradle: com.h2database:h2:1.4.193
+ Gradle: com.h2database:h2:1.4.196
diff --git a/build.gradle b/build.gradle
index a40b20a..560feec 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,19 +19,19 @@
targetCompatibility = 1.7
repositories {
- mavenLocal()
+ mavenCentral()
maven {
- url "https://nexus.astraeus.nl/nexus/content/groups/public"
+ url "http://nexus.astraeus.nl/nexus/content/groups/public"
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
- testCompile "org.slf4j:slf4j-simple:1.7.21"
+ testCompile "org.slf4j:slf4j-simple:1.7.23"
testCompile "com.h2database:h2:1.4.+"
- testCompile "nl.astraeus.jdbc:simple-jdbc-stats:1.5.3"
+ testCompile "nl.astraeus:simple-jdbc-stats:1.6.0"
- compile "nl.astraeus.template:very-simple-templates:1.3"
+ compile "nl.astraeus:very-simple-templates:1.4"
compile "org.slf4j:slf4j-api:1.7.21"
}
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
new file mode 100644
index 0000000..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
new file mode 100644
index 0000000..12bea8a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
new file mode 100644
index 0000000..23c0838
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
new file mode 100644
index 0000000..fe3028a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_main.iml b/.idea/modules/simple-database_main.iml
index 83181d4..fd1993b 100644
--- a/.idea/modules/simple-database_main.iml
+++ b/.idea/modules/simple-database_main.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -9,5 +9,7 @@
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_test.iml b/.idea/modules/simple-database_test.iml
index d2e9351..5a5857a 100644
--- a/.idea/modules/simple-database_test.iml
+++ b/.idea/modules/simple-database_test.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -11,8 +11,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 564d0a7..1d47741 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,8 +1,28 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -14,6 +34,13 @@
+
+
+
+
+
@@ -25,7 +52,6 @@
-
@@ -39,84 +65,44 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -840,29 +1057,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -935,27 +1129,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1018,29 +1191,12 @@
-
-
-
-
-
-
-
-
-
- project
-
-
-
-
-
-
-
@@ -1048,28 +1204,30 @@
+
+ project
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
@@ -1080,6 +1238,9 @@
+
+
+
@@ -1107,7 +1268,10 @@
-
+
+
+
+
1445189967799
@@ -1270,24 +1434,28 @@
1481472845176
-
+
+ 1481474559550
+
+
+
+ 1481474559550
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
@@ -1295,6 +1463,9 @@
+
+
+
@@ -1306,7 +1477,7 @@
-
+
@@ -1318,46 +1489,49 @@
-
-
+
-
+
+
+
+
+
-
-
+
+
+
+
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
@@ -1387,11 +1561,12 @@
-
+
+
-
+
@@ -1400,135 +1575,218 @@
-
+
-
-
-
-
-
+
+
-
-
+
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1936,12 +2067,11 @@
- simple-database_main|simple-database
+ simple-database_test|simple-database
-
@@ -1961,7 +2091,7 @@
- Gradle: com.h2database:h2:1.4.193
+ Gradle: com.h2database:h2:1.4.196
diff --git a/build.gradle b/build.gradle
index a40b20a..560feec 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,19 +19,19 @@
targetCompatibility = 1.7
repositories {
- mavenLocal()
+ mavenCentral()
maven {
- url "https://nexus.astraeus.nl/nexus/content/groups/public"
+ url "http://nexus.astraeus.nl/nexus/content/groups/public"
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
- testCompile "org.slf4j:slf4j-simple:1.7.21"
+ testCompile "org.slf4j:slf4j-simple:1.7.23"
testCompile "com.h2database:h2:1.4.+"
- testCompile "nl.astraeus.jdbc:simple-jdbc-stats:1.5.3"
+ testCompile "nl.astraeus:simple-jdbc-stats:1.6.0"
- compile "nl.astraeus.template:very-simple-templates:1.3"
+ compile "nl.astraeus:very-simple-templates:1.4"
compile "org.slf4j:slf4j-api:1.7.21"
}
diff --git a/src/nl/astraeus/database/DdlMapping.java b/src/nl/astraeus/database/DdlMapping.java
index 6e535c7..54b1522 100644
--- a/src/nl/astraeus/database/DdlMapping.java
+++ b/src/nl/astraeus/database/DdlMapping.java
@@ -1,17 +1,16 @@
package nl.astraeus.database;
+import nl.astraeus.template.EscapeMode;
+import nl.astraeus.template.SimpleTemplate;
+import nl.astraeus.util.Util;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
-import nl.astraeus.template.EscapeMode;
-import nl.astraeus.template.SimpleTemplate;
-import nl.astraeus.util.Util;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
/**
* Date: 11/19/13
* Time: 10:46 PM
@@ -156,6 +155,10 @@
return getDdlTemplateForType(Object.class);
}
+ public SimpleTemplate getClobType() {
+ return getDdlTemplateForType(StringBuilder.class);
+ }
+
public SimpleTemplate getIdType() {
return getDdlTemplateForType(Long.class);
}
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
new file mode 100644
index 0000000..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
new file mode 100644
index 0000000..12bea8a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
new file mode 100644
index 0000000..23c0838
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
new file mode 100644
index 0000000..fe3028a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_main.iml b/.idea/modules/simple-database_main.iml
index 83181d4..fd1993b 100644
--- a/.idea/modules/simple-database_main.iml
+++ b/.idea/modules/simple-database_main.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -9,5 +9,7 @@
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_test.iml b/.idea/modules/simple-database_test.iml
index d2e9351..5a5857a 100644
--- a/.idea/modules/simple-database_test.iml
+++ b/.idea/modules/simple-database_test.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -11,8 +11,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 564d0a7..1d47741 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,8 +1,28 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -14,6 +34,13 @@
+
+
+
+
+
@@ -25,7 +52,6 @@
-
@@ -39,84 +65,44 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -840,29 +1057,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -935,27 +1129,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1018,29 +1191,12 @@
-
-
-
-
-
-
-
-
-
- project
-
-
-
-
-
-
-
@@ -1048,28 +1204,30 @@
+
+ project
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
@@ -1080,6 +1238,9 @@
+
+
+
@@ -1107,7 +1268,10 @@
-
+
+
+
+
1445189967799
@@ -1270,24 +1434,28 @@
1481472845176
-
+
+ 1481474559550
+
+
+
+ 1481474559550
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
@@ -1295,6 +1463,9 @@
+
+
+
@@ -1306,7 +1477,7 @@
-
+
@@ -1318,46 +1489,49 @@
-
-
+
-
+
+
+
+
+
-
-
+
+
+
+
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
@@ -1387,11 +1561,12 @@
-
+
+
-
+
@@ -1400,135 +1575,218 @@
-
+
-
-
-
-
-
+
+
-
-
+
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
+
+
-
+
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1936,12 +2067,11 @@
- simple-database_main|simple-database
+ simple-database_test|simple-database
-
@@ -1961,7 +2091,7 @@
- Gradle: com.h2database:h2:1.4.193
+ Gradle: com.h2database:h2:1.4.196
diff --git a/build.gradle b/build.gradle
index a40b20a..560feec 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,19 +19,19 @@
targetCompatibility = 1.7
repositories {
- mavenLocal()
+ mavenCentral()
maven {
- url "https://nexus.astraeus.nl/nexus/content/groups/public"
+ url "http://nexus.astraeus.nl/nexus/content/groups/public"
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
- testCompile "org.slf4j:slf4j-simple:1.7.21"
+ testCompile "org.slf4j:slf4j-simple:1.7.23"
testCompile "com.h2database:h2:1.4.+"
- testCompile "nl.astraeus.jdbc:simple-jdbc-stats:1.5.3"
+ testCompile "nl.astraeus:simple-jdbc-stats:1.6.0"
- compile "nl.astraeus.template:very-simple-templates:1.3"
+ compile "nl.astraeus:very-simple-templates:1.4"
compile "org.slf4j:slf4j-api:1.7.21"
}
diff --git a/src/nl/astraeus/database/DdlMapping.java b/src/nl/astraeus/database/DdlMapping.java
index 6e535c7..54b1522 100644
--- a/src/nl/astraeus/database/DdlMapping.java
+++ b/src/nl/astraeus/database/DdlMapping.java
@@ -1,17 +1,16 @@
package nl.astraeus.database;
+import nl.astraeus.template.EscapeMode;
+import nl.astraeus.template.SimpleTemplate;
+import nl.astraeus.util.Util;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
-import nl.astraeus.template.EscapeMode;
-import nl.astraeus.template.SimpleTemplate;
-import nl.astraeus.util.Util;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
/**
* Date: 11/19/13
* Time: 10:46 PM
@@ -156,6 +155,10 @@
return getDdlTemplateForType(Object.class);
}
+ public SimpleTemplate getClobType() {
+ return getDdlTemplateForType(StringBuilder.class);
+ }
+
public SimpleTemplate getIdType() {
return getDdlTemplateForType(Long.class);
}
diff --git a/src/nl/astraeus/database/FieldMetaData.java b/src/nl/astraeus/database/FieldMetaData.java
index 508303c..501a651 100644
--- a/src/nl/astraeus/database/FieldMetaData.java
+++ b/src/nl/astraeus/database/FieldMetaData.java
@@ -1,23 +1,7 @@
package nl.astraeus.database;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.lang.reflect.Field;
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Timestamp;
-import java.sql.Types;
-import java.util.HashMap;
-import java.util.Map;
-
import nl.astraeus.database.annotations.Blob;
+import nl.astraeus.database.annotations.Clob;
import nl.astraeus.database.annotations.Collection;
import nl.astraeus.database.annotations.Column;
import nl.astraeus.database.annotations.Default;
@@ -29,10 +13,27 @@
import nl.astraeus.database.annotations.Table;
import nl.astraeus.template.SimpleTemplate;
import nl.astraeus.util.Util;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.sql.Types;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* Date: 11/14/13
* Time: 8:59 PM
@@ -45,7 +46,8 @@
COLLECTION,
SERIALIZED,
REFERENCE,
- BLOB
+ BLOB,
+ CLOB
}
private SimpleDatabase db;
@@ -134,6 +136,7 @@
String type;
Blob blob = field.getAnnotation(Blob.class);
+ Clob clob = field.getAnnotation(Clob.class);
Serialized serialized = field.getAnnotation(Serialized.class);
Collection collection = field.getAnnotation(Collection.class);
@@ -142,6 +145,14 @@
type = ddlMapping.getBlobType().render(model);
sqlType = Types.BLOB;
this.type = ColumnType.BLOB;
+ } else if (clob != null) {
+ if (!field.getType().equals(String.class)) {
+ throw new IllegalStateException("Clob is only allowed on String objects.");
+ }
+ // CLOB
+ type = ddlMapping.getClobType().render(model);
+ sqlType = Types.CLOB;
+ this.type = ColumnType.CLOB;
} else if (serialized != null) {
// BLOB
type = ddlMapping.getBlobType().render(model);
@@ -246,13 +257,15 @@
statement.setNull(index, Types.BIGINT);
break;
case BLOB:
+ case CLOB:
case COLLECTION:
case SERIALIZED:
statement.setNull(index, Types.BLOB);
break;
-
}
} else {
+ byte [] bytes;
+
switch(type) {
case BASIC:
switch(sqlType) {
@@ -322,7 +335,7 @@
out.writeObject(value);
- byte [] bytes = objectStreamBuffer.toByteArray();
+ bytes = objectStreamBuffer.toByteArray();
statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
} catch (IOException e) {
@@ -330,10 +343,19 @@
}
break;
case BLOB:
- byte [] bytes = (byte[])value;
+ bytes = (byte[])value;
statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
break;
+ case CLOB:
+ try {
+ bytes = ((String)value).getBytes("UTF-8");
+
+ statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
+ } catch (UnsupportedEncodingException e) {
+ throw new IllegalStateException(e);
+ }
+ break;
}
}
}
@@ -434,13 +456,32 @@
try (InputStream in = rs.getBinaryStream(index);
ByteArrayOutputStream out = new ByteArrayOutputStream()) {
- byte [] buffer = new byte[8196];
- int nr;
- while((nr = in.read(buffer)) > 0) {
- out.write(buffer, 0, nr);
- }
+ if (in != null) {
+ byte[] buffer = new byte[8196];
+ int nr;
+ while ((nr = in.read(buffer)) > 0) {
+ out.write(buffer, 0, nr);
+ }
- set(obj, out.toByteArray());
+ set(obj, out.toByteArray());
+ }
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ break;
+ case CLOB:
+ try (InputStream in = rs.getBinaryStream(index);
+ ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+
+ if (in != null) {
+ byte[] buffer = new byte[8196];
+ int nr;
+ while ((nr = in.read(buffer)) > 0) {
+ out.write(buffer, 0, nr);
+ }
+
+ set(obj, new String(out.toByteArray(), "UTF-8"));
+ }
} catch (IOException e) {
throw new IllegalStateException(e);
}
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
new file mode 100644
index 0000000..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
new file mode 100644
index 0000000..12bea8a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
new file mode 100644
index 0000000..23c0838
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
new file mode 100644
index 0000000..fe3028a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_main.iml b/.idea/modules/simple-database_main.iml
index 83181d4..fd1993b 100644
--- a/.idea/modules/simple-database_main.iml
+++ b/.idea/modules/simple-database_main.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -9,5 +9,7 @@
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_test.iml b/.idea/modules/simple-database_test.iml
index d2e9351..5a5857a 100644
--- a/.idea/modules/simple-database_test.iml
+++ b/.idea/modules/simple-database_test.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -11,8 +11,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 564d0a7..1d47741 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,8 +1,28 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -14,6 +34,13 @@
+
+
+
+
+
@@ -25,7 +52,6 @@
-
@@ -39,84 +65,44 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -840,29 +1057,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -935,27 +1129,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1018,29 +1191,12 @@
-
-
-
-
-
-
-
-
-
- project
-
-
-
-
-
-
-
@@ -1048,28 +1204,30 @@
+
+ project
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
@@ -1080,6 +1238,9 @@
+
+
+
@@ -1107,7 +1268,10 @@
-
+
+
+
+
1445189967799
@@ -1270,24 +1434,28 @@
1481472845176
-
+
+ 1481474559550
+
+
+
+ 1481474559550
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
@@ -1295,6 +1463,9 @@
+
+
+
@@ -1306,7 +1477,7 @@
-
+
@@ -1318,46 +1489,49 @@
-
-
+
-
+
+
+
+
+
-
-
+
+
+
+
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
@@ -1387,11 +1561,12 @@
-
+
+
-
+
@@ -1400,135 +1575,218 @@
-
+
-
-
-
-
-
+
+
-
-
+
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
+
+
-
+
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1936,12 +2067,11 @@
- simple-database_main|simple-database
+ simple-database_test|simple-database
-
@@ -1961,7 +2091,7 @@
- Gradle: com.h2database:h2:1.4.193
+ Gradle: com.h2database:h2:1.4.196
diff --git a/build.gradle b/build.gradle
index a40b20a..560feec 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,19 +19,19 @@
targetCompatibility = 1.7
repositories {
- mavenLocal()
+ mavenCentral()
maven {
- url "https://nexus.astraeus.nl/nexus/content/groups/public"
+ url "http://nexus.astraeus.nl/nexus/content/groups/public"
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
- testCompile "org.slf4j:slf4j-simple:1.7.21"
+ testCompile "org.slf4j:slf4j-simple:1.7.23"
testCompile "com.h2database:h2:1.4.+"
- testCompile "nl.astraeus.jdbc:simple-jdbc-stats:1.5.3"
+ testCompile "nl.astraeus:simple-jdbc-stats:1.6.0"
- compile "nl.astraeus.template:very-simple-templates:1.3"
+ compile "nl.astraeus:very-simple-templates:1.4"
compile "org.slf4j:slf4j-api:1.7.21"
}
diff --git a/src/nl/astraeus/database/DdlMapping.java b/src/nl/astraeus/database/DdlMapping.java
index 6e535c7..54b1522 100644
--- a/src/nl/astraeus/database/DdlMapping.java
+++ b/src/nl/astraeus/database/DdlMapping.java
@@ -1,17 +1,16 @@
package nl.astraeus.database;
+import nl.astraeus.template.EscapeMode;
+import nl.astraeus.template.SimpleTemplate;
+import nl.astraeus.util.Util;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
-import nl.astraeus.template.EscapeMode;
-import nl.astraeus.template.SimpleTemplate;
-import nl.astraeus.util.Util;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
/**
* Date: 11/19/13
* Time: 10:46 PM
@@ -156,6 +155,10 @@
return getDdlTemplateForType(Object.class);
}
+ public SimpleTemplate getClobType() {
+ return getDdlTemplateForType(StringBuilder.class);
+ }
+
public SimpleTemplate getIdType() {
return getDdlTemplateForType(Long.class);
}
diff --git a/src/nl/astraeus/database/FieldMetaData.java b/src/nl/astraeus/database/FieldMetaData.java
index 508303c..501a651 100644
--- a/src/nl/astraeus/database/FieldMetaData.java
+++ b/src/nl/astraeus/database/FieldMetaData.java
@@ -1,23 +1,7 @@
package nl.astraeus.database;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.lang.reflect.Field;
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Timestamp;
-import java.sql.Types;
-import java.util.HashMap;
-import java.util.Map;
-
import nl.astraeus.database.annotations.Blob;
+import nl.astraeus.database.annotations.Clob;
import nl.astraeus.database.annotations.Collection;
import nl.astraeus.database.annotations.Column;
import nl.astraeus.database.annotations.Default;
@@ -29,10 +13,27 @@
import nl.astraeus.database.annotations.Table;
import nl.astraeus.template.SimpleTemplate;
import nl.astraeus.util.Util;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.sql.Types;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* Date: 11/14/13
* Time: 8:59 PM
@@ -45,7 +46,8 @@
COLLECTION,
SERIALIZED,
REFERENCE,
- BLOB
+ BLOB,
+ CLOB
}
private SimpleDatabase db;
@@ -134,6 +136,7 @@
String type;
Blob blob = field.getAnnotation(Blob.class);
+ Clob clob = field.getAnnotation(Clob.class);
Serialized serialized = field.getAnnotation(Serialized.class);
Collection collection = field.getAnnotation(Collection.class);
@@ -142,6 +145,14 @@
type = ddlMapping.getBlobType().render(model);
sqlType = Types.BLOB;
this.type = ColumnType.BLOB;
+ } else if (clob != null) {
+ if (!field.getType().equals(String.class)) {
+ throw new IllegalStateException("Clob is only allowed on String objects.");
+ }
+ // CLOB
+ type = ddlMapping.getClobType().render(model);
+ sqlType = Types.CLOB;
+ this.type = ColumnType.CLOB;
} else if (serialized != null) {
// BLOB
type = ddlMapping.getBlobType().render(model);
@@ -246,13 +257,15 @@
statement.setNull(index, Types.BIGINT);
break;
case BLOB:
+ case CLOB:
case COLLECTION:
case SERIALIZED:
statement.setNull(index, Types.BLOB);
break;
-
}
} else {
+ byte [] bytes;
+
switch(type) {
case BASIC:
switch(sqlType) {
@@ -322,7 +335,7 @@
out.writeObject(value);
- byte [] bytes = objectStreamBuffer.toByteArray();
+ bytes = objectStreamBuffer.toByteArray();
statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
} catch (IOException e) {
@@ -330,10 +343,19 @@
}
break;
case BLOB:
- byte [] bytes = (byte[])value;
+ bytes = (byte[])value;
statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
break;
+ case CLOB:
+ try {
+ bytes = ((String)value).getBytes("UTF-8");
+
+ statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
+ } catch (UnsupportedEncodingException e) {
+ throw new IllegalStateException(e);
+ }
+ break;
}
}
}
@@ -434,13 +456,32 @@
try (InputStream in = rs.getBinaryStream(index);
ByteArrayOutputStream out = new ByteArrayOutputStream()) {
- byte [] buffer = new byte[8196];
- int nr;
- while((nr = in.read(buffer)) > 0) {
- out.write(buffer, 0, nr);
- }
+ if (in != null) {
+ byte[] buffer = new byte[8196];
+ int nr;
+ while ((nr = in.read(buffer)) > 0) {
+ out.write(buffer, 0, nr);
+ }
- set(obj, out.toByteArray());
+ set(obj, out.toByteArray());
+ }
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ break;
+ case CLOB:
+ try (InputStream in = rs.getBinaryStream(index);
+ ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+
+ if (in != null) {
+ byte[] buffer = new byte[8196];
+ int nr;
+ while ((nr = in.read(buffer)) > 0) {
+ out.write(buffer, 0, nr);
+ }
+
+ set(obj, new String(out.toByteArray(), "UTF-8"));
+ }
} catch (IOException e) {
throw new IllegalStateException(e);
}
diff --git a/src/nl/astraeus/database/annotations/Clob.java b/src/nl/astraeus/database/annotations/Clob.java
new file mode 100644
index 0000000..78de9b9
--- /dev/null
+++ b/src/nl/astraeus/database/annotations/Clob.java
@@ -0,0 +1,16 @@
+package nl.astraeus.database.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Date: 11/13/13
+ * Time: 10:03 PM
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target( { ElementType.FIELD } )
+public @interface Clob {
+
+}
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
new file mode 100644
index 0000000..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
new file mode 100644
index 0000000..12bea8a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
new file mode 100644
index 0000000..23c0838
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
new file mode 100644
index 0000000..fe3028a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_main.iml b/.idea/modules/simple-database_main.iml
index 83181d4..fd1993b 100644
--- a/.idea/modules/simple-database_main.iml
+++ b/.idea/modules/simple-database_main.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -9,5 +9,7 @@
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_test.iml b/.idea/modules/simple-database_test.iml
index d2e9351..5a5857a 100644
--- a/.idea/modules/simple-database_test.iml
+++ b/.idea/modules/simple-database_test.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -11,8 +11,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 564d0a7..1d47741 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,8 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+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -776,14 +847,160 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -840,29 +1057,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -935,27 +1129,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1018,29 +1191,12 @@
-
-
-
-
-
-
-
-
-
- project
-
-
-
-
-
-
-
@@ -1048,28 +1204,30 @@
+
+ project
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
@@ -1080,6 +1238,9 @@
+
+
+
@@ -1107,7 +1268,10 @@
-
+
+
+
+
1445189967799
@@ -1270,24 +1434,28 @@
1481472845176
-
+
+ 1481474559550
+
+
+
+ 1481474559550
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
@@ -1295,6 +1463,9 @@
+
+
+
@@ -1306,7 +1477,7 @@
-
+
@@ -1318,46 +1489,49 @@
-
-
+
-
+
+
+
+
+
-
-
+
+
+
+
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
@@ -1387,11 +1561,12 @@
-
+
+
-
+
@@ -1400,135 +1575,218 @@
-
+
-
-
-
-
-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
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1936,12 +2067,11 @@
- simple-database_main|simple-database
+ simple-database_test|simple-database
-
@@ -1961,7 +2091,7 @@
- Gradle: com.h2database:h2:1.4.193
+ Gradle: com.h2database:h2:1.4.196
diff --git a/build.gradle b/build.gradle
index a40b20a..560feec 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,19 +19,19 @@
targetCompatibility = 1.7
repositories {
- mavenLocal()
+ mavenCentral()
maven {
- url "https://nexus.astraeus.nl/nexus/content/groups/public"
+ url "http://nexus.astraeus.nl/nexus/content/groups/public"
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
- testCompile "org.slf4j:slf4j-simple:1.7.21"
+ testCompile "org.slf4j:slf4j-simple:1.7.23"
testCompile "com.h2database:h2:1.4.+"
- testCompile "nl.astraeus.jdbc:simple-jdbc-stats:1.5.3"
+ testCompile "nl.astraeus:simple-jdbc-stats:1.6.0"
- compile "nl.astraeus.template:very-simple-templates:1.3"
+ compile "nl.astraeus:very-simple-templates:1.4"
compile "org.slf4j:slf4j-api:1.7.21"
}
diff --git a/src/nl/astraeus/database/DdlMapping.java b/src/nl/astraeus/database/DdlMapping.java
index 6e535c7..54b1522 100644
--- a/src/nl/astraeus/database/DdlMapping.java
+++ b/src/nl/astraeus/database/DdlMapping.java
@@ -1,17 +1,16 @@
package nl.astraeus.database;
+import nl.astraeus.template.EscapeMode;
+import nl.astraeus.template.SimpleTemplate;
+import nl.astraeus.util.Util;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
-import nl.astraeus.template.EscapeMode;
-import nl.astraeus.template.SimpleTemplate;
-import nl.astraeus.util.Util;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
/**
* Date: 11/19/13
* Time: 10:46 PM
@@ -156,6 +155,10 @@
return getDdlTemplateForType(Object.class);
}
+ public SimpleTemplate getClobType() {
+ return getDdlTemplateForType(StringBuilder.class);
+ }
+
public SimpleTemplate getIdType() {
return getDdlTemplateForType(Long.class);
}
diff --git a/src/nl/astraeus/database/FieldMetaData.java b/src/nl/astraeus/database/FieldMetaData.java
index 508303c..501a651 100644
--- a/src/nl/astraeus/database/FieldMetaData.java
+++ b/src/nl/astraeus/database/FieldMetaData.java
@@ -1,23 +1,7 @@
package nl.astraeus.database;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.lang.reflect.Field;
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Timestamp;
-import java.sql.Types;
-import java.util.HashMap;
-import java.util.Map;
-
import nl.astraeus.database.annotations.Blob;
+import nl.astraeus.database.annotations.Clob;
import nl.astraeus.database.annotations.Collection;
import nl.astraeus.database.annotations.Column;
import nl.astraeus.database.annotations.Default;
@@ -29,10 +13,27 @@
import nl.astraeus.database.annotations.Table;
import nl.astraeus.template.SimpleTemplate;
import nl.astraeus.util.Util;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.sql.Types;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* Date: 11/14/13
* Time: 8:59 PM
@@ -45,7 +46,8 @@
COLLECTION,
SERIALIZED,
REFERENCE,
- BLOB
+ BLOB,
+ CLOB
}
private SimpleDatabase db;
@@ -134,6 +136,7 @@
String type;
Blob blob = field.getAnnotation(Blob.class);
+ Clob clob = field.getAnnotation(Clob.class);
Serialized serialized = field.getAnnotation(Serialized.class);
Collection collection = field.getAnnotation(Collection.class);
@@ -142,6 +145,14 @@
type = ddlMapping.getBlobType().render(model);
sqlType = Types.BLOB;
this.type = ColumnType.BLOB;
+ } else if (clob != null) {
+ if (!field.getType().equals(String.class)) {
+ throw new IllegalStateException("Clob is only allowed on String objects.");
+ }
+ // CLOB
+ type = ddlMapping.getClobType().render(model);
+ sqlType = Types.CLOB;
+ this.type = ColumnType.CLOB;
} else if (serialized != null) {
// BLOB
type = ddlMapping.getBlobType().render(model);
@@ -246,13 +257,15 @@
statement.setNull(index, Types.BIGINT);
break;
case BLOB:
+ case CLOB:
case COLLECTION:
case SERIALIZED:
statement.setNull(index, Types.BLOB);
break;
-
}
} else {
+ byte [] bytes;
+
switch(type) {
case BASIC:
switch(sqlType) {
@@ -322,7 +335,7 @@
out.writeObject(value);
- byte [] bytes = objectStreamBuffer.toByteArray();
+ bytes = objectStreamBuffer.toByteArray();
statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
} catch (IOException e) {
@@ -330,10 +343,19 @@
}
break;
case BLOB:
- byte [] bytes = (byte[])value;
+ bytes = (byte[])value;
statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
break;
+ case CLOB:
+ try {
+ bytes = ((String)value).getBytes("UTF-8");
+
+ statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
+ } catch (UnsupportedEncodingException e) {
+ throw new IllegalStateException(e);
+ }
+ break;
}
}
}
@@ -434,13 +456,32 @@
try (InputStream in = rs.getBinaryStream(index);
ByteArrayOutputStream out = new ByteArrayOutputStream()) {
- byte [] buffer = new byte[8196];
- int nr;
- while((nr = in.read(buffer)) > 0) {
- out.write(buffer, 0, nr);
- }
+ if (in != null) {
+ byte[] buffer = new byte[8196];
+ int nr;
+ while ((nr = in.read(buffer)) > 0) {
+ out.write(buffer, 0, nr);
+ }
- set(obj, out.toByteArray());
+ set(obj, out.toByteArray());
+ }
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ break;
+ case CLOB:
+ try (InputStream in = rs.getBinaryStream(index);
+ ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+
+ if (in != null) {
+ byte[] buffer = new byte[8196];
+ int nr;
+ while ((nr = in.read(buffer)) > 0) {
+ out.write(buffer, 0, nr);
+ }
+
+ set(obj, new String(out.toByteArray(), "UTF-8"));
+ }
} catch (IOException e) {
throw new IllegalStateException(e);
}
diff --git a/src/nl/astraeus/database/annotations/Clob.java b/src/nl/astraeus/database/annotations/Clob.java
new file mode 100644
index 0000000..78de9b9
--- /dev/null
+++ b/src/nl/astraeus/database/annotations/Clob.java
@@ -0,0 +1,16 @@
+package nl.astraeus.database.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Date: 11/13/13
+ * Time: 10:03 PM
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target( { ElementType.FIELD } )
+public @interface Clob {
+
+}
diff --git a/src/nl/astraeus/database/sql/h2/types.sql b/src/nl/astraeus/database/sql/h2/types.sql
index 8e3695e..e662b45 100644
--- a/src/nl/astraeus/database/sql/h2/types.sql
+++ b/src/nl/astraeus/database/sql/h2/types.sql
@@ -8,4 +8,5 @@
java.lang.Float=DECIMAL(${precision}, ${scale})
java.math.BigDecimal=DECIMAL(${precision}, ${scale})
java.util.Date=TIMESTAMP
-java.lang.Object=BLOB
\ No newline at end of file
+java.lang.Object=BLOB
+java.lang.StringBuilder=CLOB
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
new file mode 100644
index 0000000..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
new file mode 100644
index 0000000..12bea8a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
new file mode 100644
index 0000000..23c0838
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
new file mode 100644
index 0000000..fe3028a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_main.iml b/.idea/modules/simple-database_main.iml
index 83181d4..fd1993b 100644
--- a/.idea/modules/simple-database_main.iml
+++ b/.idea/modules/simple-database_main.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -9,5 +9,7 @@
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_test.iml b/.idea/modules/simple-database_test.iml
index d2e9351..5a5857a 100644
--- a/.idea/modules/simple-database_test.iml
+++ b/.idea/modules/simple-database_test.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -11,8 +11,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 564d0a7..1d47741 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,8 +1,28 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -14,6 +34,13 @@
+
+
+
+
+
@@ -25,7 +52,6 @@
-
@@ -39,84 +65,44 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -126,40 +112,143 @@
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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
-
-
-
-
-
-
-
-
-
-
@@ -935,27 +1129,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1018,29 +1191,12 @@
-
-
-
-
-
-
-
-
-
- project
-
-
-
-
-
-
-
@@ -1048,28 +1204,30 @@
+
+ project
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
@@ -1080,6 +1238,9 @@
+
+
+
@@ -1107,7 +1268,10 @@
-
+
+
+
+
1445189967799
@@ -1270,24 +1434,28 @@
1481472845176
-
+
+ 1481474559550
+
+
+
+ 1481474559550
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
@@ -1295,6 +1463,9 @@
+
+
+
@@ -1306,7 +1477,7 @@
-
+
@@ -1318,46 +1489,49 @@
-
-
+
-
+
+
+
+
+
-
-
+
+
+
+
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
@@ -1387,11 +1561,12 @@
-
+
+
-
+
@@ -1400,135 +1575,218 @@
-
+
-
-
-
-
-
+
+
-
-
+
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
+
+
-
+
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
@@ -1936,12 +2067,11 @@
- simple-database_main|simple-database
+ simple-database_test|simple-database
-
@@ -1961,7 +2091,7 @@
- Gradle: com.h2database:h2:1.4.193
+ Gradle: com.h2database:h2:1.4.196
diff --git a/build.gradle b/build.gradle
index a40b20a..560feec 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,19 +19,19 @@
targetCompatibility = 1.7
repositories {
- mavenLocal()
+ mavenCentral()
maven {
- url "https://nexus.astraeus.nl/nexus/content/groups/public"
+ url "http://nexus.astraeus.nl/nexus/content/groups/public"
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
- testCompile "org.slf4j:slf4j-simple:1.7.21"
+ testCompile "org.slf4j:slf4j-simple:1.7.23"
testCompile "com.h2database:h2:1.4.+"
- testCompile "nl.astraeus.jdbc:simple-jdbc-stats:1.5.3"
+ testCompile "nl.astraeus:simple-jdbc-stats:1.6.0"
- compile "nl.astraeus.template:very-simple-templates:1.3"
+ compile "nl.astraeus:very-simple-templates:1.4"
compile "org.slf4j:slf4j-api:1.7.21"
}
diff --git a/src/nl/astraeus/database/DdlMapping.java b/src/nl/astraeus/database/DdlMapping.java
index 6e535c7..54b1522 100644
--- a/src/nl/astraeus/database/DdlMapping.java
+++ b/src/nl/astraeus/database/DdlMapping.java
@@ -1,17 +1,16 @@
package nl.astraeus.database;
+import nl.astraeus.template.EscapeMode;
+import nl.astraeus.template.SimpleTemplate;
+import nl.astraeus.util.Util;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
-import nl.astraeus.template.EscapeMode;
-import nl.astraeus.template.SimpleTemplate;
-import nl.astraeus.util.Util;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
/**
* Date: 11/19/13
* Time: 10:46 PM
@@ -156,6 +155,10 @@
return getDdlTemplateForType(Object.class);
}
+ public SimpleTemplate getClobType() {
+ return getDdlTemplateForType(StringBuilder.class);
+ }
+
public SimpleTemplate getIdType() {
return getDdlTemplateForType(Long.class);
}
diff --git a/src/nl/astraeus/database/FieldMetaData.java b/src/nl/astraeus/database/FieldMetaData.java
index 508303c..501a651 100644
--- a/src/nl/astraeus/database/FieldMetaData.java
+++ b/src/nl/astraeus/database/FieldMetaData.java
@@ -1,23 +1,7 @@
package nl.astraeus.database;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.lang.reflect.Field;
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Timestamp;
-import java.sql.Types;
-import java.util.HashMap;
-import java.util.Map;
-
import nl.astraeus.database.annotations.Blob;
+import nl.astraeus.database.annotations.Clob;
import nl.astraeus.database.annotations.Collection;
import nl.astraeus.database.annotations.Column;
import nl.astraeus.database.annotations.Default;
@@ -29,10 +13,27 @@
import nl.astraeus.database.annotations.Table;
import nl.astraeus.template.SimpleTemplate;
import nl.astraeus.util.Util;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.sql.Types;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* Date: 11/14/13
* Time: 8:59 PM
@@ -45,7 +46,8 @@
COLLECTION,
SERIALIZED,
REFERENCE,
- BLOB
+ BLOB,
+ CLOB
}
private SimpleDatabase db;
@@ -134,6 +136,7 @@
String type;
Blob blob = field.getAnnotation(Blob.class);
+ Clob clob = field.getAnnotation(Clob.class);
Serialized serialized = field.getAnnotation(Serialized.class);
Collection collection = field.getAnnotation(Collection.class);
@@ -142,6 +145,14 @@
type = ddlMapping.getBlobType().render(model);
sqlType = Types.BLOB;
this.type = ColumnType.BLOB;
+ } else if (clob != null) {
+ if (!field.getType().equals(String.class)) {
+ throw new IllegalStateException("Clob is only allowed on String objects.");
+ }
+ // CLOB
+ type = ddlMapping.getClobType().render(model);
+ sqlType = Types.CLOB;
+ this.type = ColumnType.CLOB;
} else if (serialized != null) {
// BLOB
type = ddlMapping.getBlobType().render(model);
@@ -246,13 +257,15 @@
statement.setNull(index, Types.BIGINT);
break;
case BLOB:
+ case CLOB:
case COLLECTION:
case SERIALIZED:
statement.setNull(index, Types.BLOB);
break;
-
}
} else {
+ byte [] bytes;
+
switch(type) {
case BASIC:
switch(sqlType) {
@@ -322,7 +335,7 @@
out.writeObject(value);
- byte [] bytes = objectStreamBuffer.toByteArray();
+ bytes = objectStreamBuffer.toByteArray();
statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
} catch (IOException e) {
@@ -330,10 +343,19 @@
}
break;
case BLOB:
- byte [] bytes = (byte[])value;
+ bytes = (byte[])value;
statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
break;
+ case CLOB:
+ try {
+ bytes = ((String)value).getBytes("UTF-8");
+
+ statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
+ } catch (UnsupportedEncodingException e) {
+ throw new IllegalStateException(e);
+ }
+ break;
}
}
}
@@ -434,13 +456,32 @@
try (InputStream in = rs.getBinaryStream(index);
ByteArrayOutputStream out = new ByteArrayOutputStream()) {
- byte [] buffer = new byte[8196];
- int nr;
- while((nr = in.read(buffer)) > 0) {
- out.write(buffer, 0, nr);
- }
+ if (in != null) {
+ byte[] buffer = new byte[8196];
+ int nr;
+ while ((nr = in.read(buffer)) > 0) {
+ out.write(buffer, 0, nr);
+ }
- set(obj, out.toByteArray());
+ set(obj, out.toByteArray());
+ }
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ break;
+ case CLOB:
+ try (InputStream in = rs.getBinaryStream(index);
+ ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+
+ if (in != null) {
+ byte[] buffer = new byte[8196];
+ int nr;
+ while ((nr = in.read(buffer)) > 0) {
+ out.write(buffer, 0, nr);
+ }
+
+ set(obj, new String(out.toByteArray(), "UTF-8"));
+ }
} catch (IOException e) {
throw new IllegalStateException(e);
}
diff --git a/src/nl/astraeus/database/annotations/Clob.java b/src/nl/astraeus/database/annotations/Clob.java
new file mode 100644
index 0000000..78de9b9
--- /dev/null
+++ b/src/nl/astraeus/database/annotations/Clob.java
@@ -0,0 +1,16 @@
+package nl.astraeus.database.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Date: 11/13/13
+ * Time: 10:03 PM
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target( { ElementType.FIELD } )
+public @interface Clob {
+
+}
diff --git a/src/nl/astraeus/database/sql/h2/types.sql b/src/nl/astraeus/database/sql/h2/types.sql
index 8e3695e..e662b45 100644
--- a/src/nl/astraeus/database/sql/h2/types.sql
+++ b/src/nl/astraeus/database/sql/h2/types.sql
@@ -8,4 +8,5 @@
java.lang.Float=DECIMAL(${precision}, ${scale})
java.math.BigDecimal=DECIMAL(${precision}, ${scale})
java.util.Date=TIMESTAMP
-java.lang.Object=BLOB
\ No newline at end of file
+java.lang.Object=BLOB
+java.lang.StringBuilder=CLOB
diff --git a/test/nl/astraeus/database/TestInsert.java b/test/nl/astraeus/database/TestInsert.java
index 2ca9857..805ede6 100644
--- a/test/nl/astraeus/database/TestInsert.java
+++ b/test/nl/astraeus/database/TestInsert.java
@@ -1,13 +1,12 @@
package nl.astraeus.database;
-import java.util.List;
-
import nl.astraeus.database.test.model.Person;
-
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
+import java.util.List;
+
/**
* Date: 11/16/13
* Time: 12:27 AM
@@ -30,12 +29,21 @@
dao.insert(new Person("Jan", 32, "Straat"));
dao.insert(new Person("Piet", 26, "Weg"));
dao.insert(new Person("Klaas", 10, "Pad"));
+
+ Person p = new Person("Klaas 2", 50, "bla");
+
+ p.setNewColumnTest("Very long test we hope...");
+ dao.insert(p);
}
});
List persons = dao.all();
- Assert.assertTrue(persons.size() == 4);
+ Assert.assertTrue(persons.size() == 5);
+
+ Person p = dao.find("name = ?", "Klaas 2");
+
+ Assert.assertEquals("Very long test we hope...", p.getNewColumnTest());
}
}
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
new file mode 100644
index 0000000..6f39cae
--- /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..8a869d9
--- /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_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__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml
index 720213c..dc26b34 100644
--- a/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ b/.idea/libraries/Gradle__junit_junit_4_11.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.xml
new file mode 100644
index 0000000..632c571
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_simple_jdbc_stats_1_6_0.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.xml b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
new file mode 100644
index 0000000..9a00155
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_template_very_simple_templates_1_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
new file mode 100644
index 0000000..873c2c0
--- /dev/null
+++ b/.idea/libraries/Gradle__nl_astraeus_web_simple_web_0_3.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
index b9f5b31..8262f72 100644
--- a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
@@ -1,9 +1,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
new file mode 100644
index 0000000..12bea8a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_21.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
new file mode 100644
index 0000000..23c0838
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
new file mode 100644
index 0000000..fe3028a
--- /dev/null
+++ b/.idea/libraries/Gradle__org_slf4j_slf4j_simple_1_7_23.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_main.iml b/.idea/modules/simple-database_main.iml
index 83181d4..fd1993b 100644
--- a/.idea/modules/simple-database_main.iml
+++ b/.idea/modules/simple-database_main.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -9,5 +9,7 @@
+
+
\ No newline at end of file
diff --git a/.idea/modules/simple-database_test.iml b/.idea/modules/simple-database_test.iml
index d2e9351..5a5857a 100644
--- a/.idea/modules/simple-database_test.iml
+++ b/.idea/modules/simple-database_test.iml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -11,8 +11,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 564d0a7..1d47741 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,8 +1,28 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -14,6 +34,13 @@
+
+
+
+
+
@@ -25,7 +52,6 @@
-
@@ -39,84 +65,44 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -126,40 +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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -840,29 +1057,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -935,27 +1129,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1018,29 +1191,12 @@
-
-
-
-
-
-
-
-
-
- project
-
-
-
-
-
-
-
@@ -1048,28 +1204,30 @@
+
+ project
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
@@ -1080,6 +1238,9 @@
+
+
+
@@ -1107,7 +1268,10 @@
-
+
+
+
+
1445189967799
@@ -1270,24 +1434,28 @@
1481472845176
-
+
+ 1481474559550
+
+
+
+ 1481474559550
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
@@ -1295,6 +1463,9 @@
+
+
+
@@ -1306,7 +1477,7 @@
-
+
@@ -1318,46 +1489,49 @@
-
-
+
-
+
+
+
+
+
-
-
+
+
+
+
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
@@ -1387,11 +1561,12 @@
-
+
+
-
+
@@ -1400,135 +1575,218 @@
-
+
-
-
-
-
-
+
+
-
-
+
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
+
+
-
+
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1936,12 +2067,11 @@
- simple-database_main|simple-database
+ simple-database_test|simple-database
-
@@ -1961,7 +2091,7 @@
- Gradle: com.h2database:h2:1.4.193
+ Gradle: com.h2database:h2:1.4.196
diff --git a/build.gradle b/build.gradle
index a40b20a..560feec 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,19 +19,19 @@
targetCompatibility = 1.7
repositories {
- mavenLocal()
+ mavenCentral()
maven {
- url "https://nexus.astraeus.nl/nexus/content/groups/public"
+ url "http://nexus.astraeus.nl/nexus/content/groups/public"
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
- testCompile "org.slf4j:slf4j-simple:1.7.21"
+ testCompile "org.slf4j:slf4j-simple:1.7.23"
testCompile "com.h2database:h2:1.4.+"
- testCompile "nl.astraeus.jdbc:simple-jdbc-stats:1.5.3"
+ testCompile "nl.astraeus:simple-jdbc-stats:1.6.0"
- compile "nl.astraeus.template:very-simple-templates:1.3"
+ compile "nl.astraeus:very-simple-templates:1.4"
compile "org.slf4j:slf4j-api:1.7.21"
}
diff --git a/src/nl/astraeus/database/DdlMapping.java b/src/nl/astraeus/database/DdlMapping.java
index 6e535c7..54b1522 100644
--- a/src/nl/astraeus/database/DdlMapping.java
+++ b/src/nl/astraeus/database/DdlMapping.java
@@ -1,17 +1,16 @@
package nl.astraeus.database;
+import nl.astraeus.template.EscapeMode;
+import nl.astraeus.template.SimpleTemplate;
+import nl.astraeus.util.Util;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
-import nl.astraeus.template.EscapeMode;
-import nl.astraeus.template.SimpleTemplate;
-import nl.astraeus.util.Util;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
/**
* Date: 11/19/13
* Time: 10:46 PM
@@ -156,6 +155,10 @@
return getDdlTemplateForType(Object.class);
}
+ public SimpleTemplate getClobType() {
+ return getDdlTemplateForType(StringBuilder.class);
+ }
+
public SimpleTemplate getIdType() {
return getDdlTemplateForType(Long.class);
}
diff --git a/src/nl/astraeus/database/FieldMetaData.java b/src/nl/astraeus/database/FieldMetaData.java
index 508303c..501a651 100644
--- a/src/nl/astraeus/database/FieldMetaData.java
+++ b/src/nl/astraeus/database/FieldMetaData.java
@@ -1,23 +1,7 @@
package nl.astraeus.database;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.lang.reflect.Field;
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Timestamp;
-import java.sql.Types;
-import java.util.HashMap;
-import java.util.Map;
-
import nl.astraeus.database.annotations.Blob;
+import nl.astraeus.database.annotations.Clob;
import nl.astraeus.database.annotations.Collection;
import nl.astraeus.database.annotations.Column;
import nl.astraeus.database.annotations.Default;
@@ -29,10 +13,27 @@
import nl.astraeus.database.annotations.Table;
import nl.astraeus.template.SimpleTemplate;
import nl.astraeus.util.Util;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.sql.Types;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* Date: 11/14/13
* Time: 8:59 PM
@@ -45,7 +46,8 @@
COLLECTION,
SERIALIZED,
REFERENCE,
- BLOB
+ BLOB,
+ CLOB
}
private SimpleDatabase db;
@@ -134,6 +136,7 @@
String type;
Blob blob = field.getAnnotation(Blob.class);
+ Clob clob = field.getAnnotation(Clob.class);
Serialized serialized = field.getAnnotation(Serialized.class);
Collection collection = field.getAnnotation(Collection.class);
@@ -142,6 +145,14 @@
type = ddlMapping.getBlobType().render(model);
sqlType = Types.BLOB;
this.type = ColumnType.BLOB;
+ } else if (clob != null) {
+ if (!field.getType().equals(String.class)) {
+ throw new IllegalStateException("Clob is only allowed on String objects.");
+ }
+ // CLOB
+ type = ddlMapping.getClobType().render(model);
+ sqlType = Types.CLOB;
+ this.type = ColumnType.CLOB;
} else if (serialized != null) {
// BLOB
type = ddlMapping.getBlobType().render(model);
@@ -246,13 +257,15 @@
statement.setNull(index, Types.BIGINT);
break;
case BLOB:
+ case CLOB:
case COLLECTION:
case SERIALIZED:
statement.setNull(index, Types.BLOB);
break;
-
}
} else {
+ byte [] bytes;
+
switch(type) {
case BASIC:
switch(sqlType) {
@@ -322,7 +335,7 @@
out.writeObject(value);
- byte [] bytes = objectStreamBuffer.toByteArray();
+ bytes = objectStreamBuffer.toByteArray();
statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
} catch (IOException e) {
@@ -330,10 +343,19 @@
}
break;
case BLOB:
- byte [] bytes = (byte[])value;
+ bytes = (byte[])value;
statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
break;
+ case CLOB:
+ try {
+ bytes = ((String)value).getBytes("UTF-8");
+
+ statement.setBinaryStream(index, new ByteArrayInputStream(bytes), bytes.length);
+ } catch (UnsupportedEncodingException e) {
+ throw new IllegalStateException(e);
+ }
+ break;
}
}
}
@@ -434,13 +456,32 @@
try (InputStream in = rs.getBinaryStream(index);
ByteArrayOutputStream out = new ByteArrayOutputStream()) {
- byte [] buffer = new byte[8196];
- int nr;
- while((nr = in.read(buffer)) > 0) {
- out.write(buffer, 0, nr);
- }
+ if (in != null) {
+ byte[] buffer = new byte[8196];
+ int nr;
+ while ((nr = in.read(buffer)) > 0) {
+ out.write(buffer, 0, nr);
+ }
- set(obj, out.toByteArray());
+ set(obj, out.toByteArray());
+ }
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ break;
+ case CLOB:
+ try (InputStream in = rs.getBinaryStream(index);
+ ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+
+ if (in != null) {
+ byte[] buffer = new byte[8196];
+ int nr;
+ while ((nr = in.read(buffer)) > 0) {
+ out.write(buffer, 0, nr);
+ }
+
+ set(obj, new String(out.toByteArray(), "UTF-8"));
+ }
} catch (IOException e) {
throw new IllegalStateException(e);
}
diff --git a/src/nl/astraeus/database/annotations/Clob.java b/src/nl/astraeus/database/annotations/Clob.java
new file mode 100644
index 0000000..78de9b9
--- /dev/null
+++ b/src/nl/astraeus/database/annotations/Clob.java
@@ -0,0 +1,16 @@
+package nl.astraeus.database.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Date: 11/13/13
+ * Time: 10:03 PM
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target( { ElementType.FIELD } )
+public @interface Clob {
+
+}
diff --git a/src/nl/astraeus/database/sql/h2/types.sql b/src/nl/astraeus/database/sql/h2/types.sql
index 8e3695e..e662b45 100644
--- a/src/nl/astraeus/database/sql/h2/types.sql
+++ b/src/nl/astraeus/database/sql/h2/types.sql
@@ -8,4 +8,5 @@
java.lang.Float=DECIMAL(${precision}, ${scale})
java.math.BigDecimal=DECIMAL(${precision}, ${scale})
java.util.Date=TIMESTAMP
-java.lang.Object=BLOB
\ No newline at end of file
+java.lang.Object=BLOB
+java.lang.StringBuilder=CLOB
diff --git a/test/nl/astraeus/database/TestInsert.java b/test/nl/astraeus/database/TestInsert.java
index 2ca9857..805ede6 100644
--- a/test/nl/astraeus/database/TestInsert.java
+++ b/test/nl/astraeus/database/TestInsert.java
@@ -1,13 +1,12 @@
package nl.astraeus.database;
-import java.util.List;
-
import nl.astraeus.database.test.model.Person;
-
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
+import java.util.List;
+
/**
* Date: 11/16/13
* Time: 12:27 AM
@@ -30,12 +29,21 @@
dao.insert(new Person("Jan", 32, "Straat"));
dao.insert(new Person("Piet", 26, "Weg"));
dao.insert(new Person("Klaas", 10, "Pad"));
+
+ Person p = new Person("Klaas 2", 50, "bla");
+
+ p.setNewColumnTest("Very long test we hope...");
+ dao.insert(p);
}
});
List persons = dao.all();
- Assert.assertTrue(persons.size() == 4);
+ Assert.assertTrue(persons.size() == 5);
+
+ Person p = dao.find("name = ?", "Klaas 2");
+
+ Assert.assertEquals("Very long test we hope...", p.getNewColumnTest());
}
}
diff --git a/test/nl/astraeus/database/test/model/Person.java b/test/nl/astraeus/database/test/model/Person.java
index b698acc..3b9bf80 100644
--- a/test/nl/astraeus/database/test/model/Person.java
+++ b/test/nl/astraeus/database/test/model/Person.java
@@ -1,11 +1,11 @@
package nl.astraeus.database.test.model;
import nl.astraeus.database.annotations.Cache;
+import nl.astraeus.database.annotations.Clob;
import nl.astraeus.database.annotations.Default;
import nl.astraeus.database.annotations.Id;
import nl.astraeus.database.annotations.Length;
import nl.astraeus.database.annotations.Table;
-
import org.junit.Ignore;
/**
@@ -32,6 +32,7 @@
private Company company;
+ @Clob
private String newColumnTest;
// needed for retrieval from db
@@ -80,4 +81,12 @@
public void setCompany(Company company) {
this.company = company;
}
+
+ public String getNewColumnTest() {
+ return newColumnTest;
+ }
+
+ public void setNewColumnTest(String newColumnTest) {
+ this.newColumnTest = newColumnTest;
+ }
}