Package org.hibernate.criterion

Examples of org.hibernate.criterion.DetachedCriteria.createAlias()


            final TypeSearchResult itemType) {

        final DetachedCriteria criteria = DetachedCriteria
                .forClass(TweetPollSavedPublishedStatus.class);
        if (itemType.equals(TypeSearchResult.TWEETPOLL)) {
            criteria.createAlias("tweetPoll", "tweetPoll");
            criteria.add(Restrictions.eq("tweetPoll", tweetPoll));

        } else if (itemType.equals(TypeSearchResult.SURVEY)) {
            criteria.createAlias("survey", "survey");
            criteria.add(Restrictions.eq("survey", survey));
View Full Code Here


        if (itemType.equals(TypeSearchResult.TWEETPOLL)) {
            criteria.createAlias("tweetPoll", "tweetPoll");
            criteria.add(Restrictions.eq("tweetPoll", tweetPoll));

        } else if (itemType.equals(TypeSearchResult.SURVEY)) {
            criteria.createAlias("survey", "survey");
            criteria.add(Restrictions.eq("survey", survey));

        } else if (itemType.equals(TypeSearchResult.POLL)) {
            criteria.add(Restrictions.eq("poll", poll));
View Full Code Here

    @SuppressWarnings("unchecked")
    public List getListAnswersByTweetPollAndDateRange(
            final TweetPoll tweetPoll) {
        final DetachedCriteria criteria = DetachedCriteria
                .forClass(TweetPollSwitch.class);
        criteria.createAlias("tweetPoll","tweetPoll");
        criteria.add(Restrictions.eq("tweetPoll", tweetPoll));
        return getHibernateTemplate().findByCriteria(criteria);
    }

View Full Code Here

            final Integer max, final Integer period, final String keyword) {
        final SearchPeriods searchPeriods = SearchPeriods
                .getPeriodString(period.toString());
        final DetachedCriteria criteria = DetachedCriteria
                .forClass(TweetPoll.class);
        criteria.createAlias("question", "question");
        criteria.add(Restrictions.like("question.question", keyword,
                MatchMode.ANYWHERE));

        criteria.add(Restrictions.eq("completed", isComplete));
        criteria.add(Restrictions.eq("scheduleTweetPoll", scheduled));
View Full Code Here

      final TypeSearchResult typeSearch, final Integer maxResults,
      final Integer start, final CommentOptions commentOptions, final SearchPeriods period) {
    final DetachedCriteria criteria = DetachedCriteria
        .forClass(Comment.class);
    if (typeSearch.equals(TypeSearchResult.TWEETPOLL)) {
      criteria.createAlias("tweetPoll", "tweetPoll");
      criteria.add(Restrictions.eq("tweetPoll.tweetPollId", id));
    } else if (typeSearch.equals(TypeSearchResult.POLL)) {
      criteria.createAlias("poll", "poll");
      criteria.add(Restrictions.eq("poll.pollId", id));
    } else if (typeSearch.equals(TypeSearchResult.SURVEY)) {
View Full Code Here

        .forClass(Comment.class);
    if (typeSearch.equals(TypeSearchResult.TWEETPOLL)) {
      criteria.createAlias("tweetPoll", "tweetPoll");
      criteria.add(Restrictions.eq("tweetPoll.tweetPollId", id));
    } else if (typeSearch.equals(TypeSearchResult.POLL)) {
      criteria.createAlias("poll", "poll");
      criteria.add(Restrictions.eq("poll.pollId", id));
    } else if (typeSearch.equals(TypeSearchResult.SURVEY)) {
      criteria.createAlias("survey", "survey");
      criteria.add(Restrictions.eq("survey.sid", id));
    } else {
View Full Code Here

      criteria.add(Restrictions.eq("tweetPoll.tweetPollId", id));
    } else if (typeSearch.equals(TypeSearchResult.POLL)) {
      criteria.createAlias("poll", "poll");
      criteria.add(Restrictions.eq("poll.pollId", id));
    } else if (typeSearch.equals(TypeSearchResult.SURVEY)) {
      criteria.createAlias("survey", "survey");
      criteria.add(Restrictions.eq("survey.sid", id));
    } else {
      log.error(" Search result type undefined " + typeSearch.toString());
    }
View Full Code Here

   */
    public Long getTotalCommentsbyItem(final Long id, final TypeSearchResult itemType, final CommentOptions commentOptions, final SearchPeriods period){
          final DetachedCriteria criteria = DetachedCriteria.forClass(Comment.class);
          criteria.setProjection(Projections.rowCount());
          if (itemType.equals(TypeSearchResult.TWEETPOLL)) {
              criteria.createAlias("tweetPoll", "tweetPoll");
              criteria.add(Restrictions.eq("tweetPoll.tweetPollId", id));
          } else if (itemType.equals(TypeSearchResult.POLL)) {
              criteria.createAlias("poll", "poll");
              criteria.add(Restrictions.eq("poll.pollId", id));
          } else if (itemType.equals(TypeSearchResult.SURVEY)) {
View Full Code Here

          criteria.setProjection(Projections.rowCount());
          if (itemType.equals(TypeSearchResult.TWEETPOLL)) {
              criteria.createAlias("tweetPoll", "tweetPoll");
              criteria.add(Restrictions.eq("tweetPoll.tweetPollId", id));
          } else if (itemType.equals(TypeSearchResult.POLL)) {
              criteria.createAlias("poll", "poll");
              criteria.add(Restrictions.eq("poll.pollId", id));
          } else if (itemType.equals(TypeSearchResult.SURVEY)) {
              criteria.createAlias("survey", "survey");
              criteria.add(Restrictions.eq("survey.sid", id));
          } else {
View Full Code Here

              criteria.add(Restrictions.eq("tweetPoll.tweetPollId", id));
          } else if (itemType.equals(TypeSearchResult.POLL)) {
              criteria.createAlias("poll", "poll");
              criteria.add(Restrictions.eq("poll.pollId", id));
          } else if (itemType.equals(TypeSearchResult.SURVEY)) {
              criteria.createAlias("survey", "survey");
              criteria.add(Restrictions.eq("survey.sid", id));
          } else {
              log.error(" Search result type undefined " + itemType);
          }
          if(!commentOptions.equals(CommentOptions.ALL)){
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.