<< Project Home | Index | Data Access Objects (DAO) | DataBean (ValueObject) | XML database file

Data Access Object

Separates business logic from data access logic.

(DAO) J2EE blueprint pattern link

EJB The generated DAOs are based on table schemes defined by the XML database file. Each of the implementing methods in a DAO issues a single sql statement and acts on a single table row based on a primary key.
Abstract MethodImplementing MethodResult
createinsertinsert a single row based on primary key
loadselectreturns a single DataBean object based on primary key
storeupdateupdates a single row based on primary key
removedeletedelete a single row based on primary key
findByPrimaryKeypkExistsreturns true if a row exists based on primary key

A DAO can easily be extended to act on multiple rows. DAOs can be combined in entity EJBs to provide persistant components. They can also be used by session EJBs for database access.

UML diagram of generated DAO files