当前位置: 首页>>代码示例>>Java>>正文


Java PathBuilder.get方法代码示例

本文整理汇总了Java中com.mysema.query.types.path.PathBuilder.get方法的典型用法代码示例。如果您正苦于以下问题:Java PathBuilder.get方法的具体用法?Java PathBuilder.get怎么用?Java PathBuilder.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.mysema.query.types.path.PathBuilder的用法示例。


在下文中一共展示了PathBuilder.get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepareQueryAssociationMap

import com.mysema.query.types.path.PathBuilder; //导入方法依赖的package包/类
/**
 * Prepares associationMap for findByCriteria
 * 
 * @param entity
 * @param filterByAssociations
 * @param datatablesCriterias
 * @param findInAllColumns
 * @param query
 * @param associationMap
 * @return
 */
public static <T> JPAQuery prepareQueryAssociationMap(
        PathBuilder<T> entity,
        Map<String, List<String>> filterByAssociations,
        DatatablesCriterias datatablesCriterias, boolean findInAllColumns,
        JPAQuery query, Map<String, PathBuilder<?>> associationMap) {
    LOGGER.debug("Preparing associationMap and joins for entity {}...",
            entity.getType());
    for (ColumnDef column : datatablesCriterias.getColumnDefs()) {

        // true if the search must include this column
        boolean findInColumn = StringUtils.isNotEmpty(column.getSearch());

        // If no joins given for this column, don't add the JOIN to query
        // to improve performance
        String associationName = unescapeDot(column.getName());
        if (!filterByAssociations.containsKey(associationName)) {
            continue;
        }

        // If column is not sortable and is not filterable, don't add the
        // JOIN to query to improve performance
        if (!column.isSortable() && !column.isFilterable()) {
            continue;
        }

        // If column is not sortable and no search value provided,
        // don't add the JOIN to query to improve performance
        if (!column.isSortable() && !findInColumn && !findInAllColumns) {
            continue;
        }

        // Here the column is sortable or it is filterable and column search
        // value or all-column search value is provided
        PathBuilder<?> associationPath = entity.get(associationName);
        query = query.join(associationPath);

        // Store join path for later use in where
        associationMap.put(associationName, associationPath);
        LOGGER.trace("Added join {} -> {} as {}...", entity.getType(),
                associationPath, associationName);
    }
    return query;
}
 
开发者ID:gvSIGAssociation,项目名称:gvnix1,代码行数:55,代码来源:DatatablesUtils.java

示例2: prepareQueryAssociationMap

import com.mysema.query.types.path.PathBuilder; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public <T> JPAQuery prepareQueryAssociationMap(PathBuilder<T> entity,
        Map<String, List<String>> filterByAssociations,
        DatatablesCriterias datatablesCriterias, boolean findInAllColumns,
        JPAQuery query, Map<String, PathBuilder<?>> associationMap) {
    LOGGER.debug("Preparing associationMap and joins for entity {}...",
            entity.getType());
    for (ColumnDef column : datatablesCriterias.getColumnDefs()) {

        // true if the search must include this column
        boolean findInColumn = StringUtils.isNotEmpty(column.getSearch());

        // If no joins given for this column, don't add the JOIN to query
        // to improve performance
        String associationName = unescapeDot(column.getName());
        if (!filterByAssociations.containsKey(associationName)) {
            continue;
        }

        // If column is not sortable and is not filterable, don't add the
        // JOIN to query to improve performance
        if (!column.isSortable() && !column.isFilterable()) {
            continue;
        }

        // If column is not sortable and no search value provided,
        // don't add the JOIN to query to improve performance
        if (!column.isSortable() && !findInColumn && !findInAllColumns) {
            continue;
        }

        // Here the column is sortable or it is filterable and column search
        // value or all-column search value is provided
        PathBuilder<?> associationPath = entity.get(associationName);
        query = query.join(associationPath);

        // Store join path for later use in where
        associationMap.put(associationName, associationPath);
        LOGGER.trace("Added join {} -> {} as {}...", entity.getType(),
                associationPath, associationName);
    }
    return query;
}
 
开发者ID:gvSIGAssociation,项目名称:gvnix1,代码行数:47,代码来源:DatatablesUtilsBeanImpl.java


注:本文中的com.mysema.query.types.path.PathBuilder.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。