AutoDAO goal is to make creation of Java DAO classes as simple as possible.
You design DAO interface, write necessary HQL, mark it with annotations and you are done. There is no need to write unnecessary code or complex XML configuration. One line in Spring config file and you are ready to use your DAO interfaces through injection.
public interface BookDao { @Finder(query="from Book where title = ?") Book getByTitle(String title); @Finder(query="from Book where title like :titlePart and author = :author") List<Book> findByAuthorAndTitlePart(@Named("titlePart") String titlePart, @Named("author") String author); }
Read Quickstart or User Guide.
AutoDAO is available from central Maven repository:
<dependency> <groupId>net.sf.autodao</groupId> <artifactId>autodao</artifactId> <version>0.12.2</version> </dependency>
Use download section.
AutoDAO snapshots are available via Maven snapshot repository.
Support for AutoDAO project is provided via mailing lists
Please file issues to AutoDAO issue tracker
This project was inspired by Don't repeat the DAO! article by Per Mellqvist.