A simple ORM for your Java projects
Failed to load latest commit information.
atomium-core uh? Jul 11, 2013
atomium-guice provides session Jul 11, 2013
atomium-jdbc triggers session's loading Jul 11, 2013
.gitignore restart from scratch Jun 23, 2013
README.md Update README.md Jul 4, 2013
pom.xml adds maven-javadoc-plugin to parent pom.xml Jun 28, 2013


Atomium build_status_img

A simple ORM for your Java projects

How to use

You can download the generated artifacts here, compile yourself or use Maven dependency system.

Compile the artifacts

$ git clone https://github.com/Blackrush/Atomium.git
$ cd Atomium/
$ mvn clean install
$ mkdir build
$ mv ./atomium-*/target/atomium-*-*.jar ./build

You can find the artifacts inside the build/ folder.

Use Maven dependency system inside your project

You need first to clone the Git repository and install the artifacts :

$ git clone https://github.com/Blackrush/Atomium.git
$ cd Atomium/
$ mvn clean install

Then add the dependencies into your pom.xml :

    <version>INSERT LAST VERSION HERE</version>
    <version>INSERT LAST VERSION HERE</version>

This method is temporary, I will as soon as I can deploy the artifacts on Maven Central Repository and you will just have to add the dependencies without clone the repository anymore.

Use Atomium inside your project

Atomium is divided in two parts : the metadata and the database. The metadata part simply holds data of entities and extracts or exports data to the database. The database part handles database's connection and the way the data has to be sent to the database.

Here is a example that uses JDBC drivers :

// the metadata part
MetadataRegistry registry = new SimpleMetadataRegistry();

// the database part
try (DatabaseInterface database = JdbcDatabase.of("jdbc:url", "user", "password", registry)) {
    try (SessionInterface session = database.createSession()) {
        MyEntity instance = session.findOne(MyEntity.class, 1);
        instance.setAttr("Hello World");


Actually, DatabaseInterface simply holds infos to create a connection to the database while SessionInterface is truly the connection to the database and contains all CRUD operations. Furthermore, SessionInterface is responsible of data's cache.

Atomium uses CQEngine to keep the data in memory and retrieve them very efficiently. The way it has been implemented makes it at least 10 times more faster than a naive implementation (more informations on CQEngine wiki).

Integration with Guice

From Guice homepage : Put simply, Guice alleviates the need for factories and the use of new in your Java code. Think of Guice's @Inject as the new new. You will still need to write factories in some cases, but your code will not depend directly on them. Your code will be easier to change, unit test and reuse in other contexts.