Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Data Access Layer

fschoeppl edited this page Apr 25, 2012 · 2 revisions

The Data Access Layer provides interfaces to realize CRUD operations on the model classes ([Model Layer] (wiki/model-layer)). It uses the data access object pattern which will be described in the next section.

Interface

The project org.backmeup.dal contains the interface DataAccessLayer which provides operations to create data access objects for the different model classes.

The interface BaseDao models the CRUD-contract. For each model class a derived interface will be created. E. g. the class User gets an interface UserDao which contains database-methods concerning the user class only.

Implementation

The project org.backmeup.dal.jpa.impl contains the JPA specific implementation of the Data Access Layer. The class BaseDaoImplimplements the BaseDao interface in a generic way and provides the EntityManager for derived classes. The UserDaoImpl e.g. implements the UserDao interface and extends the BaseDaoImpl class. New DAOs should always extend the BaseDaoImpl and implement their specific DAO-interface. Note: Transactions will be handled within the [business logic layer] (wiki/business-logic-layer).

Clone this wiki locally