-
Notifications
You must be signed in to change notification settings - Fork 0
Data Access Layer
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.
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.
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).