Retrieving Hibernate query result as result set instead of list

前端 未结 3 1353
耶瑟儿~
耶瑟儿~ 2021-01-12 22:41

Heya, I m new to hibernate. I have to say it really simplifies everything for the SQL query. However, manipulating the returned result is a headache for me at the moment.

3条回答
  •  半阙折子戏
    2021-01-12 23:37

    Slightly old thread but I cannot resist:

        // Code for iterating over a list of objects
        for(MappedClass mappedCless : list){
            String name = mappedClass.getName();
            String id = mappedClass.getId();
            // further logic
        }
    

提交回复
热议问题