我按照这个写法注入的dao,但是在执行的时候报空指针,是不是注入的方式不对?
@IocBean(args = {"refer:dao"})
public class UserTest extends TestBase {
@Inject("refer:$ioc")
protected Ioc ioc;
@Test
public void test4() {
Dao dao = ioc.get(Dao.class);
Sql sqlcount = Sqls.create("select t.area_id, count(t.area_id) as travel from t_visitor_locus t group by t.area_id order by travel desc ");
sqlcount.setCallback(Sqls.callback.entity());
sqlcount.setEntity(dao.getEntity(Record.class));
dao.execute(sqlcount);
Record countRecord=(Record) sqlcount.getResult();
long count=(long) countRecord.get("area_id");
}
}