java class cast Exception Error
<p>I'm developing my website in struts, hibernate and jsp. I had called a function which is in my DAO page from my action page like this:</p>

<pre><code>private List&lt;Order&gt; salesDetails = new ArrayList();
salesDetails = doctorDao.getInstance().getDoctorSalesDetails(SessionObj.getId(),activityGraph);
</code></pre>

<p>and in my dao function I write the code like this</p>

<pre><code>public List getDoctorSalesDetails(int id,int activityGraph){
    List&lt;Order&gt; doctorSalesDetails=new ArrayList();        
    try{
       SessionFactory sessionFactory =
                (SessionFactory) ServletActionContext.getServletContext().getAttribute(HibernateListener.KEY_NAME);
        Session Hibernatesession = sessionFactory.openSession();
        Hibernatesession.beginTransaction();
        doctorSalesDetails =    Hibernatesession.createSQLQuery("SELECT total_amount,created_at FROM `order` WHERE created_at &gt; DATE_SUB(curdate(),INTERVAL "+activityGraph+" DAY) AND doctor_id = "+id+" GROUP BY created_at").list();
        Hibernatesession.getTransaction().commit();
    }catch(Exception e){
        e.printStackTrace();
    }
    return doctorSalesDetails;
}
</code></pre>

<p>The query result is successfully working here. The problem is when I access the the return variable from my action page like this:</p>

<pre><code>    try{
       for( Order o:  salesDetails) {
           System.out.println("Total amount="+o.getCreatedAt());
       }
    }catch(Exception e){
        e.printStackTrace();
    }
</code></pre>

<p>it causes following error :</p>

<pre><code>java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.myDrDirect.hbmobj.Order
    at com.myDrDirect.doctor.action.DoctorDashBoardActivity.getDashBoardActivityDetails(DoctorDashBoardActivity.java:36)
</code></pre>

<p>What might be the issue?</p>
