views:

11

answers:

0

Hello, I'd like to make an hibernate query. My old query was like :

  public int getPublicationCountVote(Publication pub,Boolean voteType){
    return HibernateUtil.queryCount(SocialVote.class
        , new String [] {VOTED_PUBLICATION_ID_FIELD, FOR_OR_AGAINST_FIELD}
        , new Object [] { pub.getId() , voteType });
  }

But now, i've changed my SocialVote class, and the voteType doesnt exist anymore. All I have is a rating ( for a vote ) and i'd like to make my query to count all vote for a given publication, where rating is < 0, or >0

I want to make two methods : - getPublicationCountVoteFor - getPublicationCountVoteAgainst

How do i use criterias to make my two new queries ?