Hibernate get List from database

前端 未结 6 1166
盖世英雄少女心
盖世英雄少女心 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:47

    if you using sql query, you should add this line at the last of the query to get the list you want:

    .setResultTransformer(Transformers.aliasToBean(testDTO.class)).list();
    

提交回复
热议问题