Search in sources :

Example 6 with GroupCriteriaMapper

use of eu.europa.ec.fisheries.ers.service.search.GroupCriteriaMapper in project UVMS-ActivityModule-APP by UnionVMS.

the class FACatchSearchBuilder method createJoinPartOfTheQuery.

protected void createJoinPartOfTheQuery(FishingActivityQuery query, StringBuilder sql, Map<GroupCriteria, GroupCriteriaMapper> groupMAppings, List<GroupCriteria> groupByFieldList) {
    // Below is default JOIN for the query
    sql.append(FA_CATCH_JOIN);
    // Create join part of SQL query
    // Join only required tables based on filter criteria
    createJoinTablesPartForQuery(sql, query);
    // Add joins if not added by activity filtering . Below code will add joins required by FA Catch report joins
    for (GroupCriteria criteria : groupByFieldList) {
        GroupCriteriaMapper mapper = groupMAppings.get(criteria);
        if (sql.indexOf(mapper.getTableJoin()) == -1) {
            appendJoinString(sql, mapper.getTableJoin());
        }
    }
}
Also used : GroupCriteriaMapper(eu.europa.ec.fisheries.ers.service.search.GroupCriteriaMapper) GroupCriteria(eu.europa.ec.fisheries.uvms.activity.model.schemas.GroupCriteria)

Aggregations

GroupCriteriaMapper (eu.europa.ec.fisheries.ers.service.search.GroupCriteriaMapper)6 GroupCriteria (eu.europa.ec.fisheries.uvms.activity.model.schemas.GroupCriteria)6 ServiceException (eu.europa.ec.fisheries.uvms.commons.service.exception.ServiceException)3 NotNull (org.jetbrains.annotations.NotNull)2 FaCatchSummaryCustomProxy (eu.europa.ec.fisheries.ers.fa.dao.proxy.FaCatchSummaryCustomProxy)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 Date (java.util.Date)1