Select all from a table hibernate

后端 未结 4 573
余生分开走
余生分开走 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:28

    I just had a similar problem, and it appears to have been solved by providing the full path to the object you are trying to query. So, when I made it look like this: session.createQuery("from com.mystuff.something.or.other.MyEntity") it worked.

提交回复
热议问题