Ibator Generated Java DAO Classes

Ibator generates DAO classes of several types. For each table in the configuration, Ibator generates a Java Interface that describes DAO methods, and a Java Class that implements the generated interface. Generating DAO objects is optional, and is controlled by the <daoGenerator> configuration element. Ibator can generate DAOs of the following types:

Every field and method generated by Ibator includes the non-standard JavaDoc tag @ibatorgenerated. On subsequent runs of Ibator, every field and method that includes this JavaDoc tag will be deleted and replaced. Any other field or method in the class will be untouched by Ibator. With this in mind, you can add other fields and methods to the classes without fear of losing them in subsequent runs of Ibator - simply DO NOT include the @ibatorgenerated JavaDoc tag on anything that you add to the class.

Note: in the following descriptions, the term "BLOB" is used to refer to any column with a data type of BLOB, CLOB, LONGVARCHAR, or LONGVARBINARY.

Methods Common to All DAO Types

Depending on the specifics of the table, and the configuration options, the DAO generator will generate these methods:

Ibator attempts to make it easier to deal with tables that contain BLOBs by generating different objects and methods so that you can use the BLOB fields, or ignore them, depending on the situation.

See the Example Class Usage page for an example of using the selectByExample method.

IBATIS DAOs

iBATIS DAOs depend on the iBATIS DAO framework (an optional part of iBATIS - now deprecated). They extend the SqlMapDaoTemplate class and are constructed with an instance of the DAOManager object, and call methods in their super class to execute the different statements.

Ibator does not update the "dao.xml" file for you - you must add the appropriate entries manually.

The iBATIS DAO framework is a very elementary IoC container and can be useful if you are not already using something like Spring or PicoContainer to manage dependencies. However, the framework is now deprecated and we suggest that you move to Spring.

SPRING DAOs

SPRING DAOs depend on the Spring framework. They extend Spring's SqlMapClientDaoSupport class, and are constructed by the Spring container.

GENERIC-CI DAOs

GENERIC-CI DAOs call methods in iBATIS' SqlMapClient interface directly. An instance of the interface is supplied through constructor injection.

GENERIC-SI DAOs

GENERIC-SI DAOs call methods in iBATIS' SqlMapClient interface directly. An instance of the interface is supplied through setter injection.