aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/overview.adoc
diff options
context:
space:
mode:
authorClemens Fries <ormpaloompa@xenoworld.de>2016-05-19 00:28:53 +0200
committerxeno <xeno@eisberg.nacht>2016-05-19 00:36:56 +0200
commit6138a5ce200d0c1ebc2730fd565bc7bcfdcdc230 (patch)
treeef15e317477f9f3530f1b9f0cfb8810eaebc56ca /src/main/java/overview.adoc
parent5fe09722dbe590d6624f635093baccc6dd8973db (diff)
Fix alternative name handling for columns, plus a lot of documentation.
Diffstat (limited to 'src/main/java/overview.adoc')
-rw-r--r--src/main/java/overview.adoc36
1 files changed, 25 insertions, 11 deletions
diff --git a/src/main/java/overview.adoc b/src/main/java/overview.adoc
index 90a82f6..90642bb 100644
--- a/src/main/java/overview.adoc
+++ b/src/main/java/overview.adoc
@@ -1,18 +1,32 @@
-= Eduard XVII — The loyal MUC servant
+== Ormpaloompa — Sort-of-ORM for EduardXVII
-== Continuous Integration
+Because the friendly MUC chat bot EduardXVII needs to deal in several places
+with simple-structured SQLite tables, I created this tiny object-relational
+mapper. It stinks in several places, but it also gets its job done. Coverage is
+over 85% and should go further north.
-We currently use the CI of Gitlab.com, but it might be warranted to use a
-dedicated runner which could execute the requests much faster. This is work
-for Future Homer.
+It mainly consists of the class `Table` which can be used as follows.
-Currently everything is configured in the file `.gitlab-ci.yml`:
+As simple class could look like this:
-[source,yaml]
+[source,java]
----
-include::../../../.gitlab-ci.yml[]
+class Bird {
+ @Column(identity = true)
+ public Integer id;
+
+ @Column
+ public String name;
+}
----
-NOTE: Replacing `ec.SunEC` is done here because there were problems in the
- Docker container with OpenJDK. Apparently making a HTTPS connection
- to the Gradle repositories would not work. \ No newline at end of file
+Then create a `Table<Bird>` object and use it to interact with the database.
+
+[source,java]
+----
+Table<Bird> t = new Table<>(Bird.class, someDatabaseConnection);
+Bird newBird = new Bird();
+newBird.name = "A new bird";
+Object id = table.insert(newBird);
+Bird storedBird = t.getById(id).get();
+----