Defining the DAO implementations
The following DAO implementations will inherit the core CRUD operations from GenericDaoImpl
and add their own class-specific methods as defined in the implemented interface. Each method will use the @Transactional
annotation to define the appropriate transactional behavior.
The CompanyDaoImpl class
The full listing for our CompanyDaoImpl
class is as follows:
package com.gieman.tttracker.dao;
import com.gieman.tttracker.domain.Company;
import java.util.List;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Repository("companyDao")
@Transactional
public class CompanyDaoImpl extends GenericDaoImpl<Company, Integer>
implements CompanyDao {
public CompanyDaoImpl() {
super(Company.class);
}
@Override
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public List<Company>...