休止状態のプロジェクトであるデータベースからクエリを実行しようとしています
public class FeedInputParamsDaoImpl implements IFeedInputParamsDao {
@Autowired
private SessionFactory sessionFactory;
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
private int BATCH_SIZE = 50;
public Session getSession() {
/*null pointer exception*/Session session = sessionFactory.openSession();
return session;
}
@Override
public List<FeedInputParams> getAllFeedInputParamslist (int feedKey) {
String queryString = "from FeedInputParams as feedInputParams where feedInputParams.feedKey > ?";
Session session = getSession();
Query query = session.createQuery(queryString);
query.setParameter(0, feedKey);
List<FeedInputParams> feedInputParamsList = query.list();
return feedInputParamsList;
}
}
そして、このgetAllFeedInputParamslist (int feedKey)がメソッドから呼び出されます
public void readFile()
throws Exception {
FeedInputParamsDaoImpl feedInputParamsDaoImpl=new FeedInputParamsDaoImpl();
List<FeedInputParams> feedInputParamsList=feedInputParamsDaoImpl.getAllFeedInputParamslist(0);
System.out.println("feedInputParamsList...."+feedInputParamsList);
}
nullポインタ例外が発生しています
java.lang.NullPointerException at com.vxl.appanalytix.dao.impl.FeedInputParamsDaoImpl.getSession(FeedInputParamsDaoImpl.java:28)
at com.vxl.appanalytix.dao.impl.FeedInputParamsDaoImpl.getAllFeedInputParamslist(FeedInputParamsD0Impl.java:44)
at