Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

lambico Build Status

With Lambico you can add DAOs to your entities just writing only their interfaces, with no implementation.

For example:

public interface PersonDao extends GenericDao<Person, Long> {

You don't need to write anything else, your DAO will be instrumented at runtime with all the methods you can expect: read, create, delete, store, findAll, etc.

If you need your specific query methods, you can simply add them to your interface. For example:

public interface PersonDao extends GenericDao<Person, Long> {
  List<Person> findByFirstName(String firstName);

The findByFirstName method will be instrumented exactly as you expect, querying the Person entity for all instances having the firstName property equal to the passed parameter.

For more information, read the Lambico Reference Guide.

A complete example

For evaluating Lambico, You can try and examine a simple but complete example. At present the example is provided:

  1. from the examples source code repository (it's a Maven project)
  2. from the download area, as a Maven project
  3. from the download area, as an Eclipse project

Get the type of project you prefer, build it, and execute the class.

Trying the example with Maven

  1. Checkout the example from the repository, or get it from the download area;
  2. go to the main directory of the project (where there is the pom.xml file);
  3. Build the project, typing: mvn package
  4. Run the application, typing: java -jar target/consoleSpringHibernate-1.0-SNAPSHOT-executeMe.jar

Trying the example with Eclipse

  1. Get the example from the download area;
  2. Import the project in the Eclipse workspace;
  3. Run the class as a Java application.

What will the example do?

The example will populate an in-memory HSQLDB database with the data of some books. Then it will query the database for all books written by the "Lambico team", and it will print the result on the screen.

Following the main class of the example:


import java.util.List;
import javax.annotation.Resource;

import org.lambico.example.consolespringhibernate.dao.BookDao;
import org.lambico.example.consolespringhibernate.po.Book;
import org.lambico.example.consolespringhibernate.util.ApplicationContextHolder;

public class UseBookDAO {

    private BookDao bookDao;

    public UseBookDAO() {

    public static void main(String[] args) {
        UseBookDAO app = new UseBookDAO();
        Book myBook = new Book("Lambico Team", "Lambico: easy persistence");

        Book myBook2 = new Book("Mario Rossi", "My life");
        Book myBook3 = new Book("Lambico Team", "Lambico: tips & trick");
        Book myBook4 = new Book("The Hitchhiker's Guide to the Galaxy",
                "Douglas Adams", 320);


        System.out.println("Searching for Lambico Team's books...");
        List<Book> myBooks = app.bookDao.findByAuthor("Lambico Team");
        System.out.println(myBooks.size()+" result(s) found!");
        for (Book book : myBooks) {

The expected output is:

... (some log lines)

Searching for Lambico Team's books...
2 result(s) found!
Book{numPages=0 ; author=Lambico Team ; title=Lambico: easy persistence ; borrower=null}
Book{numPages=0 ; author=Lambico Team ; title=Lambico: tips & trick ; borrower=null}


Distill your data






No packages published