aboutsummaryrefslogtreecommitdiffstats

Ormpaloompa — Sort-of-ORM for EduardXVII

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.

It mainly consists of the class Table which can be used as follows.

As simple class could look like this:

class Bird {
     @Column(identity = true)
     public Integer id;

     @Column
     public String name;
}

Then create a Table<Bird> object and use it to interact with the database.

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();