So I have this following code:
Query query = session.createQuery("from Weather");
List<WeatherModel> list = query.list();
WeatherModel w = (WeatherModel) list.get(0);
I wan't to get all the items from the table Weather, but I keep getting the following error:(line 23 is where I create the query)
java.lang.NullPointerException
at action.WeatherAction.validate(WeatherAction.java:23)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.java:251)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)............
What's the problem?