I have the service MyStaticService
which is doing some calculations using a DAO.
How can I inject the MyDao
object into the class field?
I've tried to implement the setter with @Autowired
but when I call doCalculations(..)
the DAO is null
. What am I doing wrong?
public class MyStaticService
{
private static MyDao dao;
public static int doCalculations(..){
dao.doSmth()
// omitted
}
}