是用这个方法Session session =getSessionFactory().getCurrentSession();
Criteria criteria=session.createCriteria(Reply.class).add(Restrictions.eq("messageid", reply.getMessage().getId()));
return criteria.list();  但是报错:
  org.hibernate.QueryException: could not resolve property: message_id of: com.entity.ReplySSH