Based on a discussion here I thought I would post my ORM library for Java. Have a look at Persism. http://persism.sourceforge.net
Persism is a simple no-nonsense, auto-configuration, auto-discovery, convention over configuration Object Relational Mapping library. Persism uses POJOs for data objects and does not need any XML for configuration. Annotations are only used as a fall-back in cases where the library can't discover the mapping on it's own. Persism is pretty smart so you usually don't need to bother with annotations at all.
Persism has no
external dependencies however it will use logging if available and it's only about 40k.
Persism has only 2 classes: Query
for reading data and Command
for updates/inserts and deletes.
The library works around the Connection object. Example of a query:
Query query = new Query(connection);
List<Player> list = query.readList(Player.class,"select * from PLAYERS where name = ?", "Fred");
Player fred = query.read(Player.class,"select * from PLAYERS where name = ?", "Fred");
Player fred = new Player();
Notice that the class is Player and the table is PLAYERS. Persism understands that and maps this for you without annotations. Heck, the library will also map things like Category -> CATEGORIES and PlayerAttributes - > [Player Attributes]. Plural table names and tables with spaces in the names would all map fine without annotating anything.
Command is similar:
Command command = new Command(connection);
Player player = new Player();
I've been using this library myself in various production applications. I marked it beta for now because I need some feedback on it before I finalize the API and also I added support for several different databases.
Current databases supported:
MSSQL (JTDS and MSSQL driver)
Thanks everyone! Let me know what you think!