这个错怎么解决啊Cannot cast from Object to boolean

public Boolean doAboutName(final String oldName,final String newName){
  boolean b=(boolean) hibernateTemplate.execute(new HibernateCallback() {
   @Override
   public Object doInHibernate(Session session) throws HibernateException,
     SQLException {
    String hql1 = "update from Email as e set e.recipients='"+newName+"' where e.recipients='"+oldName+"'";
    String hql2 = "update from Email as e set e.emailSender='"+newName+"' where e.emailSender='"+oldName+"'";
    String hql3 = "update from Vocation as v set v.userName='"+newName+"' where v.userName='"+oldName+"'";
    String hql4 = "update from Vocation as v set v.examineName='"+newName+"' where v.examineName='"+oldName+"'";
    Query query1=session.createQuery(hql1);
    query1.executeUpdate();
    Query query2=session.createQuery(hql2);
    query1.executeUpdate();
    Query query3=session.createQuery(hql3);
    query3.executeUpdate();
    Query query4=session.createQuery(hql4);
    query4.executeUpdate();
    return true;
   }
  });
  return b;
  
 }

你可能感兴趣的:(这个错怎么解决啊Cannot cast from Object to boolean)