Right now I'm having a problem injecting a entityFactoryManager into my jpadaosupport extended class.
My configuration is below:
<bean id="productDao" class="springapp.repository.JdbcProductDao">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
The above configuration for this bean works fine however when I try to use annotations to configure the bean my application doesn't work
My JdbcProductDao.java file is below
@Repository("productDao")
@Transactional
public class JdbcProductDao extends JpaDaoSupport implements ProductDao {
@SuppressWarnings("unchecked")
@Override
public List<Product> getProductList() {
// TODO Auto-generated method stub
return getJpaTemplate().getEntityManagerFactory().createEntityManager()
.createQuery("from Product").getResultList();
}
@Override
public void persist(Product product) {
// TODO Auto-generated method stub
}
@Override
public void saveProduct(Product prod) {
// TODO Auto-generated method stub
getJpaTemplate().merge(prod);
}
@Autowired
@Required
public void setJpaEntityManagerFactory(
@Qualifier("entityManagerFactory") EntityManagerFactory entityManagerFactory) {
super.setEntityManagerFactory(entityManagerFactory);
}
}
However it seems as though the EntityManagerFactory is not injected properly because none of my database transactions are seen
Could anybody offer any insight?