Package org.zanata.search

Examples of org.zanata.search.FilterConstraintToQuery


    @SuppressWarnings("unchecked")
    public List<HTextFlow> getNavigationByDocumentId(DocumentId documentId,
            HLocale hLocale, ResultTransformer resultTransformer,
            FilterConstraints filterConstraints) {
        FilterConstraintToQuery constraintToQuery =
                FilterConstraintToQuery.filterInSingleDocument(
                        filterConstraints, documentId);

        String hql = constraintToQuery.toModalNavigationQuery();
        Query query = getSession().createQuery(hql);
        return constraintToQuery.setQueryParameters(query, hLocale)
                .setResultTransformer(resultTransformer).list();
    }
View Full Code Here


     *      org.zanata.search.FilterConstraints)
     */
    public List<HTextFlow> getTextFlowByDocumentIdWithConstraints(
            DocumentId documentId, HLocale hLocale,
            FilterConstraints constraints, int firstResult, int maxResult) {
        FilterConstraintToQuery constraintToQuery =
                FilterConstraintToQuery.filterInSingleDocument(constraints,
                        documentId);
        String queryString = constraintToQuery.toEntityQuery();
        log.debug("\n query {}\n", queryString);

        Query textFlowQuery = getSession().createQuery(queryString);
        constraintToQuery.setQueryParameters(textFlowQuery, hLocale);
        textFlowQuery.setFirstResult(firstResult).setMaxResults(maxResult);
        textFlowQuery.setCacheable(true).setComment(
                "TextFlowDAO.getTextFlowByDocumentIdWithConstraint");

        @SuppressWarnings("unchecked")
View Full Code Here

    }

    public List<HTextFlow> getAllTextFlowByDocumentIdWithConstraints(
            DocumentId documentId, HLocale hLocale,
            FilterConstraints constraints) {
        FilterConstraintToQuery constraintToQuery =
                FilterConstraintToQuery.filterInSingleDocument(constraints,
                        documentId);
        String queryString = constraintToQuery.toEntityQuery();
        log.debug("\n query {}\n", queryString);

        Query textFlowQuery = getSession().createQuery(queryString);
        constraintToQuery.setQueryParameters(textFlowQuery, hLocale);
        textFlowQuery.setCacheable(true).setComment(
                "TextFlowDAO.getAllTextFlowByDocumentIdWithConstraint");

        @SuppressWarnings("unchecked")
        List<HTextFlow> result = textFlowQuery.list();
View Full Code Here

                            iterationSlug);
        }
        List<Long> documentIds =
                Lists.transform(documents, HDocumentToId.FUNCTION);

        FilterConstraintToQuery toQuery =
                FilterConstraintToQuery.filterInMultipleDocuments(constraints,
                        documentIds);
        String hql = toQuery.toEntityQuery();
        log.debug("hql for searching: {}", hql);
        org.hibernate.Query query = session.createQuery(hql);
        toQuery.setQueryParameters(query, hLocale);
        query.setComment("TextFlowSearchServiceImpl.findTextFlowsWithDatabaseSearch");
        @SuppressWarnings("unchecked")
        List<HTextFlow> result = query.list();
        if (constraints.isCaseSensitive()) {
            // Query results are post-filtered because the content table uses
View Full Code Here

TOP

Related Classes of org.zanata.search.FilterConstraintToQuery

Copyright © 2018 www.massapicom. 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.