Я пробую весенний ботинок. В видео говорится, что Bean for EntityManager < /code> Spring создает автоматически, и в видео у парня нет проблем. Не найдено бобов «EntityManager».
import javax.persistence.EntityManager;
@Repository
public class EmployeeDAOImpl implements EmployeeDAO {
@Autowired
private EntityManager entityManager;//Could not autowire. No beans of 'EntityManager' type found.
@Override
public List getAllEmployees() {
Session session = entityManager.unwrap(Session.class);
Query query = session.createQuery("from Employee ", Employee.class);
List allEmployees = query.getResultList();
return allEmployees;
}
Подробнее здесь: https://stackoverflow.com/questions/729 ... type-found