Select all from a table hibernate

后端 未结 4 625
余生分开走
余生分开走 2021-02-09 02:46

So I have this following code:

Query query = session.createQuery(\"from Weather\");
        List list = query.list();
        WeatherModel w          


        
4条回答
  •  不要未来只要你来
    2021-02-09 03:30

    Weather will be a different entity than WeatherModel. your list will have Weather objects, it can be only cast if it is sub-type of WeatherModel

提交回复
热议问题