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


Java DynamicViewEntity.addAliasAll方法代码示例

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


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

示例1: planSelect

import org.ofbiz.entity.model.DynamicViewEntity; //导入方法依赖的package包/类
@Override
public EntitySelectPlan planSelect(SQLSelect selectStatement) {
    DynamicViewEntity dve = new DynamicViewEntity();
    Unioned unioned = selectStatement.getUnioned();
    if (unioned != null) {
        throw new IllegalArgumentException("union views not yet supported");
    }
    SelectGroup selectGroup = unioned.getGroup();
    Table table = selectGroup.getTable();
    addMember(dve, table.getTableName());
    addJoined(dve, table.getTableName().getAlias(), table.getJoined());
    if (selectGroup.getFieldAlls() != null) {
        for (FieldAll fieldAll: selectGroup.getFieldAlls()) {
            List<String> excludes = new LinkedList<String>();
            for (String exclude: fieldAll) {
                excludes.add(exclude);
            }
            if (excludes.isEmpty()) {
                excludes = null;
            }
            dve.addAliasAll(fieldAll.getAlias(), null, excludes);
        }
    }
    if (selectStatement.getRelations() != null) {
        for (Relation relation: selectStatement.getRelations().values()) {
            dve.addRelation(relation.getType(), relation.getTitle(), relation.getEntityName(), buildKeyMaps(relation));
        }
    }
    List<String> groupBy = selectGroup.getGroupBy();
    if (groupBy == null) {
        groupBy = Collections.emptyList();
    }
    if (selectGroup.getFieldDefs() != null) {
        for (FieldDef fieldDef: selectGroup.getFieldDefs()) {
            addFieldDef(dve, groupBy, fieldDef.getAlias(), fieldDef);
        }
    }
    List<String> orderBy;
    if (selectStatement.getOrderBy() == null) {
        orderBy = null;
    } else {
        orderBy = new LinkedList<String>();
        for (OrderByItem orderByItem: selectStatement.getOrderBy()) {
            orderBy.add(orderByItem.toString());
        }
    }
    return new EntitySelectPlan(dve, plan(selectGroup.getWhereCondition()), plan(selectGroup.getHavingCondition()), orderBy);
}
 
开发者ID:gildaslemoal,项目名称:elpi,代码行数:49,代码来源:EntityPlanner.java


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