Hibernate get List from database

前端 未结 6 1178
盖世英雄少女心
盖世英雄少女心 2021-02-07 22:31

In the following code I am trying to get a List of Products which contains all the products in the database:

public List getAllProducts() throws          


        
6条回答
  •  遇见更好的自我
    2021-02-07 22:41

    List list = session.createCriteria(Products.class).list();
    

    This will give you all the records of products table from database

提交回复
热议问题