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


Java ModelAliasAll类代码示例

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


ModelAliasAll类属于org.ofbiz.entity.model.ModelViewEntity包,在下文中一共展示了ModelAliasAll类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getViewElement

import org.ofbiz.entity.model.ModelViewEntity.ModelAliasAll; //导入依赖的package包/类
public Element getViewElement(Document doc, String entityName) {
    Element viewElement = doc.createElement("view-entity");
    viewElement.setAttribute("entity-name", entityName);

    for (ModelMemberEntity member: memberModelMemberEntities.values()) {
        Element memberElement = doc.createElement("member-entity");
        memberElement.setAttribute("entity-alias", member.getEntityAlias());
        memberElement.setAttribute("entity-name", member.getEntityName());
        viewElement.appendChild(memberElement);
    }
    for (ModelAliasAll aliasAll: aliasAlls) {
        Element aliasAllElement = doc.createElement("alias-all");
        aliasAllElement.setAttribute("entity-alias", aliasAll.getEntityAlias());
        if (UtilValidate.isNotEmpty(aliasAll.getPrefix())) aliasAllElement.setAttribute("prefix", aliasAll.getPrefix());
        if (aliasAll.getGroupBy()) aliasAllElement.setAttribute("group-by", "true");
        if (UtilValidate.isNotEmpty(aliasAll.getFunction())) aliasAllElement.setAttribute("function", aliasAll.getFunction());
        for (String excludeField: aliasAll) {
            Element excludeElement = doc.createElement("exclude");
            excludeElement.setAttribute("field", excludeField);
            aliasAllElement.appendChild(excludeElement);
        }
        viewElement.appendChild(aliasAllElement);
    }
    for (ModelAlias alias: aliases) {
        Element aliasElement = doc.createElement("alias");
        aliasElement.setAttribute("entity-alias", alias.getEntityAlias());
        aliasElement.setAttribute("name", alias.getName());
        if (!alias.getName().equals(alias.getField())) aliasElement.setAttribute("field", alias.getField());
        String colAlias = ModelUtil.dbNameToVarName(alias.getColAlias());
        if (!alias.getName().equals(colAlias)) aliasElement.setAttribute("col-alias", colAlias);
        if (alias.getIsPk() != null) aliasElement.setAttribute("prim-key", alias.getIsPk().toString());
        if (alias.getGroupBy()) aliasElement.setAttribute("group-by", "true");
        if (UtilValidate.isNotEmpty(alias.getFunction())) aliasElement.setAttribute("function", alias.getFunction());
        // TODO: description, complex-alias
        viewElement.appendChild(aliasElement);
    }
    for (ModelViewLink viewLink: viewLinks) {
        Element viewLinkElement = doc.createElement("view-link");
        viewLinkElement.setAttribute("entity-alias", viewLink.getEntityAlias());
        if (viewLink.isRelOptional()) viewLinkElement.setAttribute("rel-optional", "true");
        viewLinkElement.setAttribute("rel-entity-alias", viewLink.getRelEntityAlias());
        for (ModelKeyMap keyMap: viewLink) {
            Element keyMapElement = doc.createElement("key-map");
            keyMapElement.setAttribute("field-name", keyMap.getFieldName());
            if (!keyMap.getFieldName().equals(keyMap.getRelFieldName())) keyMapElement.setAttribute("rel-field-name", keyMap.getRelFieldName());
            viewLinkElement.appendChild(keyMapElement);
        }
        // TODO: conditions
        viewElement.appendChild(viewLinkElement);
    }
    for (ModelRelation relation: relations) {
        viewElement.appendChild(relation.toXmlElement(doc));
    }
    return viewElement;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:56,代码来源:DynamicViewEntity.java

示例2: addAliasAll

import org.ofbiz.entity.model.ModelViewEntity.ModelAliasAll; //导入依赖的package包/类
public void addAliasAll(String entityAlias, String prefix, Collection<String> excludes) {
    ModelAliasAll aliasAll = new ModelAliasAll(entityAlias, prefix, false, null, null, excludes);
    this.aliasAlls.add(aliasAll);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:5,代码来源:DynamicViewEntity.java

示例3: addAllAliasAllsToList

import org.ofbiz.entity.model.ModelViewEntity.ModelAliasAll; //导入依赖的package包/类
public void addAllAliasAllsToList(List<ModelAliasAll> addList) {
    addList.addAll(this.aliasAlls);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:4,代码来源:DynamicViewEntity.java


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