Skip to content

clintjhill/annomongo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

=== annomongo ===
Annotated Java for mongoDB

This is a simple library that allows you to create simple Java classes (POJO)
that are annotated in a mongoDB fashion. It provides a database wrapper to
the mongoDB Java driver as well. The query facility is the Finder class with
method chaining to allow for expressive queries.

@Collection
Assigned to a class and allows for the collection to be named or will assume
the name of the class.

@Field
Assigned to a public field and allows for naming or assumes field name.

@Get
Assigned to a method (currently forces a getter) and allows naming or assumes
method name (dropping the "get").

@Put
Assigned to a method (currently forces a setter) and allows naming or assumes
method name (dropping the "set").


== Example ==

import com.h3osoftware.annomongo.*;

@Collection("examples")
public class Example extends AbstractDatabaseObject{

    @Id
    public String id;

    @Field("name")
    public String name;

}

Example ex = new Example();
ex.name = "John Doe";
ex.save();

Finder query = new Finder(Example.class);
Example result = query.where("name").isEqualTo("John Doe").result();


== Things Missing ==

AND and OR conditions in the Finder.
Embedded documents - associations.
Index annotations.
JavaDocs.

About

Annotated Java for mongo DB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages