Add it to your project as Maven dependency:

<dependency> <groupId>com.ohmdb</groupId> <artifactId>ohmdb-all</artifactId> <version>1.0.0</version> </dependency>

Add this code to your project and run it:

import com.ohmdb.api.*; class Person { public String name; public int age; } public class Main { public static void main(String[] args) { Db db = Ohm.db("ohm.db"); Table<Person> persons = db.table(Person.class); Person $p = persons.queryHelper(); Person p1 = new Person(); p1.name = "Niko"; p1.age = 30; long id = persons.insert(p1); Person p2 = persons.get(id); persons.createIndexOn($p.age); Person[] adults = persons.where($p.age).gte(18).get(); db.shutdown(); } }