Hql ArrayList returning more than one type of class : this is not a "problem" because everything is working correctly, but it is really mind–boggling that it is working correctly and i can't find the answer.
    
So i have some simple hibernate HQL Query:
    
     - List<Comment> commentList = session.createQuery("select c, u from Comment as c, User as u where c.postRef.id = :post_id").setParameter("post_id", postId).getResultList();
    
    
     
When it runs, and i look at the debugger it returns the commentList that looks like this:  
    
     - commentList - "ArrayList<E>",
       - elementData - Object[10]
         - [0] - Object[2]
             - [0] Comment
             - [1] User
         - [1] - null
         - [2] - null ... ( etc, to the end it's null)
    
    
And i just cannot understand it, how is it possible that in this ArrayList<E> there are two types of objects? Both Comment And User in one ArrayList, i can assume that this is creating ArrayList of objects or something, but then how is this possible that it returns ArrayList<Object> properly to List<Comment> without throwing any exception? And then my Method is also of return type "public List<Comment>", and i return this exact commentList, and everything works perfectly fine.
    
Appreciate any help