I have a problem where a Framework I'm using needs a default constructor, this is calling my Service class:
@Service
public class FuncionarioService {
private FuncionarioDAO dao;
public FuncionarioService(){
}
@Autowired
public FuncionarioService(FuncionarioDAO dao) {
this.dao = dao;
}
When calling the method below, the variable "dao" is coming "null". When using another path that does not use the Framework, everything is normal, the variable comes different from "null".
public List<Funcionario> obterFuncionarios(Hierarquia hierarquia){
List<Funcionario> listaFuncionarios = new ArrayList<Funcionario>();
listaFuncionarios = dao.obterFuncionarios(hierarquia);
return listaFuncionarios;
}