Depeche is a database mapper. What do I mean by that? It enables you to work with databases using data structures. Queries are Lists of records, and records are Maps of field names to field values. It strives to be very easy to use and prevent mistakes.
Here are some of the features:
Currently, Depeche requires Java 6 and SLF4J.
Depeche is not an ORM because it doesn't go all the way to objects (beans). However it could be used as part of an ORM. Also, the way it works can help with certain tasks, such as displaying the result of a query or generating a form.
With an ORM, you would normally go from the database through some kind of data structures, to objects, and then use reflection to iterate over objects and their properties as if working with data structures. With Depeche, the "objects" part is eliminated and you can work directly with the data structures.
Because I haven't found one that I really like. Besides, I thought it would be fun to implement my own library.
Several reasons: "dépêche" means "hurry" in French, and this library can hopefully help develop applications quickly; Depeche is inspired from Django, so I thought it would be nice to keep the musical theme, and Depeche Mode is one of my favorite bands.
Provider p = new PGProvider("localhost", "sample", "user", "pass");
for (Record rec : p.query("person").filter("first_name", "John").order("last_name")) {
System.out.println(rec);
}
Possible result:
{id=4, first_name=John, last_name=Brown, sex=M}
{id=2, first_name=John, last_name=Smith, sex=M}