So I have this following code:
Query query = session.createQuery(\"from Weather\");
List list = query.list();
WeatherModel w
On complex projects I prefer not to hard-code the entity name in a String literal:
Session session = sessionFactory.getCurrentSession();
CriteriaBuilder criteriaBuilder = session.getCriteriaBuilder();
CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(WeatherModel.class);
Root root = criteriaQuery.from(WeatherModel.class);
criteriaQuery.select(root);
Query query = session.createQuery(criteriaQuery);
List weatherModelList = query.getResultList();