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


Java EmptyType类代码示例

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


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

示例1: getCascadeTypes

import org.netbeans.jpa.modeler.spec.EmptyType; //导入依赖的package包/类
protected List<String> getCascadeTypes(CascadeType cascadeType) {

        if (cascadeType == null) {
            return Collections.EMPTY_LIST;
        }

        List<String> cascadeTypes = new ArrayList<>();

        EmptyType cascadeAll = cascadeType.getCascadeAll();
        EmptyType cascadeMerge = cascadeType.getCascadeMerge();
        EmptyType cascadePersist = cascadeType.getCascadePersist();
        EmptyType cascadeRefresh = cascadeType.getCascadeRefresh();
        EmptyType cascadeRemove = cascadeType.getCascadeRemove();

        if (cascadeAll != null) {
            cascadeTypes.add(ManyToManySnippet.CASCADE_ALL);
        }

        if (cascadeMerge != null) {
            cascadeTypes.add(ManyToManySnippet.CASCADE_MERGE);
        }

        if (cascadePersist != null) {
            cascadeTypes.add(ManyToManySnippet.CASCADE_PERSIST);
        }

        if (cascadeRefresh != null) {
            cascadeTypes.add(ManyToManySnippet.CASCADE_REFRESH);
        }

        if (cascadeRemove != null) {
            cascadeTypes.add(ManyToManySnippet.CASCADE_REMOVE);
        }

        return cascadeTypes;
    }
 
开发者ID:jeddict,项目名称:jeddict,代码行数:37,代码来源:ClassGenerator.java

示例2: processDefaultExcludeListeners

import org.netbeans.jpa.modeler.spec.EmptyType; //导入依赖的package包/类
protected void processDefaultExcludeListeners(
        EmptyType parsedEmptyType) {

    if (parsedEmptyType != null) {
        classDef.setDefaultExcludeListener(true);
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:8,代码来源:ClassGenerator.java

示例3: processExcludeSuperclassListeners

import org.netbeans.jpa.modeler.spec.EmptyType; //导入依赖的package包/类
protected void processExcludeSuperclassListeners(
        EmptyType parsedEmptyType) {

    if (parsedEmptyType != null) {
        classDef.setExcludeSuperClassListener(true);
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:8,代码来源:ClassGenerator.java

示例4: getValue

import org.netbeans.jpa.modeler.spec.EmptyType; //导入依赖的package包/类
@Override
public CascadeType getValue() {
    cascadeType = new CascadeType();
    if (all_CheckBox.isSelected()) {
        cascadeType.setCascadeAll(new EmptyType());
    } else if (detach_CheckBox.isSelected() || merge_CheckBox.isSelected()
            || persist_CheckBox.isSelected() || refresh_CheckBox.isSelected()
            || remove_CheckBox.isSelected()) {
        if (detach_CheckBox.isSelected()) {
            cascadeType.setCascadeDetach(new EmptyType());
        }
        if (merge_CheckBox.isSelected()) {
            cascadeType.setCascadeMerge(new EmptyType());
        }
        if (persist_CheckBox.isSelected()) {
            cascadeType.setCascadePersist(new EmptyType());
        }
        if (refresh_CheckBox.isSelected()) {
            cascadeType.setCascadeRefresh(new EmptyType());
        }
        if (remove_CheckBox.isSelected()) {
            cascadeType.setCascadeRemove(new EmptyType());
        }
    } else {
        cascadeType = null;
    }
    return cascadeType;
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:29,代码来源:CascadeTypePanel.java

示例5: getCascadeTypes

import org.netbeans.jpa.modeler.spec.EmptyType; //导入依赖的package包/类
protected List<String> getCascadeTypes(
        CascadeType cascadeType) {

    if (cascadeType == null) {
        return Collections.EMPTY_LIST;
    }

    List<String> cascadeTypes = new ArrayList<String>();

    EmptyType cascadeAll = cascadeType.getCascadeAll();
    EmptyType cascadeMerge = cascadeType.getCascadeMerge();
    EmptyType cascadePersist = cascadeType.getCascadePersist();
    EmptyType cascadeRefresh = cascadeType.getCascadeRefresh();
    EmptyType cascadeRemove = cascadeType.getCascadeRemove();

    if (cascadeAll != null) {
        cascadeTypes.add(ManyToManySnippet.CASCADE_ALL);
    }

    if (cascadeMerge != null) {
        cascadeTypes.add(ManyToManySnippet.CASCADE_MERGE);
    }

    if (cascadePersist != null) {
        cascadeTypes.add(ManyToManySnippet.CASCADE_PERSIST);
    }

    if (cascadeRefresh != null) {
        cascadeTypes.add(ManyToManySnippet.CASCADE_REFRESH);
    }

    if (cascadeRemove != null) {
        cascadeTypes.add(ManyToManySnippet.CASCADE_REMOVE);
    }

    return cascadeTypes;
}
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:38,代码来源:ClassGenerator.java

示例6: loadAttribute

import org.netbeans.jpa.modeler.spec.EmptyType; //导入依赖的package包/类
protected void loadAttribute(EntityMappings entityMappings, Element element, VariableElement variableElement, ExecutableElement getterElement,AnnotationMirror relationAnnotationMirror) {
        super.loadAttribute(element, variableElement, getterElement);
        this.joinTable = JoinTable.load(element);
        if (StringUtils.isNotBlank((String) JavaSourceParserUtil.findAnnotationValue(relationAnnotationMirror, "mappedBy"))) {
            setOwner(false);
        } else {
            setOwner(true);
        }
        List cascadeList = (List) JavaSourceParserUtil.findAnnotationValue(relationAnnotationMirror, "cascade");
        if (cascadeList != null) {
            CascadeType cascadeType = new CascadeType();
            this.cascade = cascadeType;
            for (Object cascadeObj : cascadeList) {
                switch (cascadeObj.toString()) {
                    case "javax.persistence.CascadeType.ALL":
                        cascadeType.setCascadeAll(new EmptyType());
                        break;
                    case "javax.persistence.CascadeType.PERSIST":
                        cascadeType.setCascadePersist(new EmptyType());
                        break;
                    case "javax.persistence.CascadeType.MERGE":
                        cascadeType.setCascadeMerge(new EmptyType());
                        break;
                    case "javax.persistence.CascadeType.REMOVE":
                        cascadeType.setCascadeRemove(new EmptyType());
                        break;
                    case "javax.persistence.CascadeType.REFRESH":
                        cascadeType.setCascadeRefresh(new EmptyType());
                        break;
                    case "javax.persistence.CascadeType.DETACH":
                        cascadeType.setCascadeDetach(new EmptyType());
                        break;
                    default:
                        throw new IllegalStateException("Unknown Cascade Type : " + cascadeObj.toString());
                }
            }
        }

//        DeclaredType declaredType = (DeclaredType) JavaSourceParserUtil.findAnnotationValue(relationAnnotationMirror, "targetEntity");
//        if (declaredType == null) { // Issue Fix #5925 Start
////            declaredType = (DeclaredType) variableElement.asType();
//            String variable = variableElement.asType().toString();
//            if (variableElement.asType() instanceof ErrorType) { //variable => "<any>"
//                throw new TypeNotPresentException(this.name + " type not found", null);
//            }
//            if (variable.charAt(variable.length() - 1) != '>') { //instanceof SingleRelationAttribute
//                this.targetEntity = variable.substring(variable.lastIndexOf('.') + 1); // com.jpa.Entity1
//            } else { //or instanceof MultiRelationAttribute  //java.util.Set<com.jpa.Entity1>
//                //Detect map or collection => Collection.class.isAssignableFrom(Class.forName(((DeclaredType) variableElement.asType()).asElement().toString()))) 
//                variable = ((DeclaredType) variableElement.asType()).getTypeArguments().get(0).toString();//TODO 0
//                this.targetEntity = variable.substring(variable.lastIndexOf('.') + 1);
//            }
//
//        } else {
//            this.targetEntity = declaredType.asElement().getSimpleName().toString();
//        }
        this.fetch = FetchType.load(element, relationAnnotationMirror);
        this.access = AccessType.load(element);
    }
 
开发者ID:jeddict,项目名称:jCode,代码行数:60,代码来源:RelationAttribute.java


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