How to Iterate through List of Object arrays

前端 未结 3 1569
[愿得一人]
[愿得一人] 2020-12-16 18:38

So right now I have a program containing a piece of code that looks like this...

Criteria crit = session.createCriteria(Product.class);
ProjectionList projLi         


        
3条回答
  •  独厮守ぢ
    2020-12-16 19:32

    In this case you will have a list whose elements is an array of the following: [maxPrice,minPrice,count].

    ....
    List results = crit.list();
    
    for (Object[] result : results) {
        Integer maxPrice = (Integer)result[0];
        Integer minPrice = (Integer)result[1];
        Long count = (Long)result[2];
    }
    

提交回复
热议问题