How to update count particular query whenever post method call?

By siva

I’m using spring and hibernate for backend.whenever request comes from client side.client send particular table foreign key.based on that id update foreign key table count.


public List<UserAnswer> getUserAnswerOnId(Long hitCounter,Long id) {
        Long userId=id;
        Cookie cookie = new Cookie("hitCounter", hitCounter.toString());
        String count=cookie.getValue();
        String getUserAnswer = "from UserAnswer WHERE userId =:userId order by answerDate Desc";
        Query query = sessionFactory.getCurrentSession().createQuery(getUserAnswer);
        query.setParameter("userId", userId);
        List<UserAnswer> forumList= query.list();
        return forumList;

Source: Stack Overflow


Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273