Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-36710

Class Cast Exception When Creating/Opening Question Pool

    XMLWordPrintable

    Details

    • Previous Issue Keys:
      SAM-3150

      Description

      This issue happens in MySql and Oracle

      Class Cast Exception (can´t cast from long to Integer) in QuestionPoolFacadeQueries.java

      counts.put((Long) result[0], (Integer)result[1]);
      

      It might be related with the changes in Hibernate KNL-945, these values come from an Hibernate Query:

      public List getSubPoolSizes(final String agent) {
      	  final HibernateCallback<List> hcb = session -> {
                Query q = session.createQuery("select a.questionPoolId, (select count(*) from QuestionPoolData b where b.parentPoolId=a.questionPoolId) " +
                        "from QuestionPoolData a where a.ownerId = :id");
                q.setCacheable(true);
                q.setString("id", agent);
                return q.list();
            };
      	  return getHibernateTemplate().execute(hcb);
        }
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ern Earle R Nietzel
                  Reporter:
                  alexgj Alejandro González Jiménez
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code