I have a model for service to use. But the autowired annotation returns null value. However this autowire works well in service. Is there any to do in the Module class?
public class Module{
private int id;
private String name;
private ArrayList<Function> functions;
@Autowired
private SysModuleLgDao sysModuleLgDao;
public Module() {
sysModuleLgDao.doSth();
}
}
This is my repo class:
@Repository
public interface SysModuleLgDao extends JpaRepository<SysModuleLgEntity, Long> {
public List<SysModuleLgEntity> findByModuleLgIdAndLanguageId(long moduleLgId,long languageId);
}