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


Java Basic类代码示例

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


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

示例1: getBasicConnectedClass

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
public Set<String> getBasicConnectedClass(Set<String> javaClasses) {
    List<String> basicClasses = getBasic().stream()
            .map(Basic::getDataTypeLabel)
            .filter(dataType -> {
                if (StringUtils.isNotEmpty(dataType)) {
                    dataType = isArray(dataType) ? getArrayType(dataType) : dataType;
                    Type type = getType(dataType);
                    if (type == OTHER) {
                        return !JavaIdentifiers.getPackageName(dataType).startsWith("java");
                    }
                }
                return false;
            })
            .distinct()
            .collect(Collectors.toList());
    javaClasses.addAll(basicClasses);
    return javaClasses;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:19,代码来源:PersistenceAttributes.java

示例2: getSuperBasic

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
@Override
public List<Basic> getSuperBasic(){
    List<Basic> superVersion = new ArrayList();
    JavaClass currentClass = getJavaClass();
    do {
        if(currentClass instanceof ManagedClass){
           ManagedClass<IPersistenceAttributes> managedClass = (ManagedClass)currentClass;
           superVersion.addAll(managedClass.getAttributes().getBasic());
        }
        currentClass = currentClass.getSuperclass();
    } while(currentClass != null);
    return superVersion;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:14,代码来源:PersistenceAttributes.java

示例3: getBasic

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
@Override
public Optional<Basic> getBasic(String id) {
    if (basic != null) {
        return basic.stream().filter(a -> a.getId().equals(id)).findFirst();
    }
    return null;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:8,代码来源:PersistenceAttributes.java

示例4: getInstance

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
public static BasicSpecAccessor getInstance(Basic basic, boolean inherit) {
    BasicSpecAccessor accessor = new BasicSpecAccessor(basic);
    accessor.inherit = inherit;

    accessor.setAttributeType(basic.getAttributeType());
    
    AccessorUtil.setEnumerated(accessor, basic.getEnumerated());
    AccessorUtil.setLob(accessor, basic.getLob(), basic.getAttributeType(), false);
    AccessorUtil.setTemporal(accessor, basic.getTemporal());
    
    accessor.setConverts(Collections.singletonList(basic.getConvert().getAccessor()));
    accessor.setName(basic.getName());
    accessor.setColumn(basic.getColumn().getAccessor());
    return accessor;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:16,代码来源:BasicSpecAccessor.java

示例5: initTypeComboBox

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
private void initTypeComboBox() {
    TitledBorder titledBorder = (TitledBorder) jLayeredPane1.getBorder();
    List<String> type = new ArrayList<>();
    type.add(DEFAULT);
    if (mapKey) {
        type.add(ENUMERATED);
        type.add(TEMPORAL);
        type.add(ENTITY);
        type.add(EMBEDDABLE);
        titledBorder.setTitle("MapKey Attribute");
    } else if (attribute instanceof PersistenceBaseAttribute) {
        type.add(TEMPORAL);
        if (attribute instanceof Basic) {
            type.add(ENUMERATED);
            type.add(LOB);
            titledBorder.setTitle("Basic Attribute");
        } else if (attribute instanceof Id) {
            titledBorder.setTitle("Id Attribute");
        } else if (attribute instanceof Version) {
            titledBorder.setTitle("Version Attribute");
        }
    } else if (attribute instanceof ElementCollection) {
        type.add(ENUMERATED);
        type.add(LOB);
        type.add(TEMPORAL);
        titledBorder.setTitle("ElementCollection<Basic> Attribute");
    } else if (attribute instanceof Transient) {
        titledBorder.setTitle("Transient Attribute");
    }

    type_ComboBox.removeAllItems();
    type_ComboBox.setModel(new DefaultComboBoxModel(type.toArray(new String[0])));
    //ElementCollection[Basic Type Value] => Lob,Enumerated,Temporal
    //Id => Temporal
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:36,代码来源:FieldTypePanel.java

示例6: initTypeComboBox

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
private void initTypeComboBox() {
        TitledBorder titledBorder = (TitledBorder) jLayeredPane1.getBorder();
        List<String> type = new ArrayList<String>();
        type.add("Default");
        if (baseAttribute instanceof Basic) {
            type.add("Enumerated");
            type.add("Lob");
            type.add("Temporal");
            titledBorder.setTitle("Basic Attribute");
        } else if (baseAttribute instanceof ElementCollection) {
            type.add("Enumerated");
            type.add("Lob");
            type.add("Temporal");
            titledBorder.setTitle("ElementCollection<Basic> Attribute");
        } else if (baseAttribute instanceof Id) {
            type.add("Temporal");
            titledBorder.setTitle("Id Attribute");
        } else if (baseAttribute instanceof Version) {
//            type.add("Temporal");
            titledBorder.setTitle("Version Attribute");
        } else if (baseAttribute instanceof Transient) {
            titledBorder.setTitle("Transient Attribute");
        }

        type_ComboBox.removeAllItems();
        type_ComboBox.setModel(new DefaultComboBoxModel(type.toArray(new String[0])));

        //ElementCollection[Basic Type Value] => Lob,Enumerated,Temporal
        //Id => Temporal
    }
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:31,代码来源:FieldTypePanel.java

示例7: addBasic

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
@Override
public void addBasic(Basic basic) {
    this.getBasic().add(basic);
    notifyListeners(basic, "addAttribute", null, null);
    basic.setAttributes(this);
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:7,代码来源:PersistenceAttributes.java

示例8: removeBasic

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
@Override
public void removeBasic(Basic basic) {
    this.getBasic().remove(basic);
    notifyListeners(basic, "removeAttribute", null, null);
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:6,代码来源:PersistenceAttributes.java

示例9: isAttributeExist

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
@Override
public boolean isAttributeExist(String name) {
    if (super.isAttributeExist(name)) {
        return true;
    }
    
    if (basic != null) {
        for (Basic basic_TMP : basic) {
            if (basic_TMP.getName() != null && basic_TMP.getName().equals(name)) {
                return true;
            }
        }
    }
    if (_transient != null) {
        for (Transient transient_TMP : _transient) {
            if (transient_TMP.getName() != null && transient_TMP.getName().equals(name)) {
                return true;
            }
        }
    }
    if (elementCollection != null) {
        for (ElementCollection elementCollection_TMP : elementCollection) {
            if (elementCollection_TMP.getName() != null && elementCollection_TMP.getName().equals(name)) {
                return true;
            }
        }
    }
    if (embedded != null) {
        for (Embedded embedded_TMP : embedded) {
            if (embedded_TMP.getName() != null && embedded_TMP.getName().equals(name)) {
                return true;
            }
        }
    }

    if (oneToOne != null) {
        for (OneToOne oneToOne_TMP : oneToOne) {
            if (oneToOne_TMP.getName() != null && oneToOne_TMP.getName().equals(name)) {
                return true;
            }
        }
    }
    if (oneToMany != null) {
        for (OneToMany oneToMany_TMP : oneToMany) {
            if (oneToMany_TMP.getName() != null && oneToMany_TMP.getName().equals(name)) {
                return true;
            }
        }
    }
    if (manyToOne != null) {
        for (ManyToOne manyToOne_TMP : manyToOne) {
            if (manyToOne_TMP.getName() != null && manyToOne_TMP.getName().equals(name)) {
                return true;
            }
        }
    }
    if (manyToMany != null) {
        for (ManyToMany manyToMany_TMP : manyToMany) {
            if (manyToMany_TMP.getName() != null && manyToMany_TMP.getName().equals(name)) {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:67,代码来源:PersistenceAttributes.java

示例10: findAllAttribute

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
@Override
public List<Attribute> findAllAttribute(String name,boolean includeParentClassAttibute) {
    List<Attribute> attributes = super.findAllAttribute(name,includeParentClassAttibute);

    if (basic != null) {
        for (Basic basic_TMP : basic) {
            if (basic_TMP.getName() != null && basic_TMP.getName().equals(name)) {
                attributes.add(basic_TMP);
            }
        }
    }
    if (elementCollection != null) {
        for (ElementCollection elementCollection_TMP : elementCollection) {
            if (elementCollection_TMP.getName() != null && elementCollection_TMP.getName().equals(name)) {
                attributes.add(elementCollection_TMP);
            }
        }
    }

    if (_transient != null) {
        for (Transient transient_TMP : _transient) {
            if (transient_TMP.getName() != null && transient_TMP.getName().equals(name)) {
                attributes.add(transient_TMP);
            }
        }
    }
    if (oneToOne != null) {
        for (OneToOne oneToOne_TMP : oneToOne) {
            if (oneToOne_TMP.getName() != null && oneToOne_TMP.getName().equals(name)) {
                attributes.add(oneToOne_TMP);
            }
        }
    }
    if (oneToMany != null) {
        for (OneToMany oneToMany_TMP : oneToMany) {
            if (oneToMany_TMP.getName() != null && oneToMany_TMP.getName().equals(name)) {
                attributes.add(oneToMany_TMP);
            }
        }
    }
    if (manyToOne != null) {
        for (ManyToOne manyToOne_TMP : manyToOne) {
            if (manyToOne_TMP.getName() != null && manyToOne_TMP.getName().equals(name)) {
                attributes.add(manyToOne_TMP);
            }
        }
    }
    if (manyToMany != null) {
        for (ManyToMany manyToMany_TMP : manyToMany) {
            if (manyToMany_TMP.getName() != null && manyToMany_TMP.getName().equals(name)) {
                attributes.add(manyToMany_TMP);
            }
        }
    }
    if (embedded != null) {
        for (Embedded embedded_TMP : embedded) {
            if (embedded_TMP.getName() != null && embedded_TMP.getName().equals(name)) {
                attributes.add(embedded_TMP);
            }
        }
    }

    return attributes;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:65,代码来源:PersistenceAttributes.java

示例11: setBasic

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
/**
 * @param basic the basic to set
 */
public void setBasic(List<Basic> basic) {
    this.basic = basic;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:7,代码来源:PersistenceAttributes.java

示例12: BasicSpecAccessor

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
private BasicSpecAccessor(Basic basic) {
    this.basic = basic;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:4,代码来源:BasicSpecAccessor.java

示例13: processBasic

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
protected void processBasic(List<Basic> parsedBasics) {
    if (parsedBasics == null) {
        return;
    }
    for (Basic parsedBasic : parsedBasics) {
        ColumnDefSnippet columnDef = getColumnDef(parsedBasic.getColumn());

        EnumType parsedEnumType = parsedBasic.getEnumerated();
        EnumeratedSnippet enumerated = null;
        if (parsedEnumType != null) {
            enumerated = new EnumeratedSnippet();
            enumerated.setValue(parsedEnumType);
        }

        TemporalType parsedTemporalType = parsedBasic.getTemporal();
        TemporalSnippet temporal = null;
        if (parsedTemporalType != null) {
            temporal = new TemporalSnippet();
            temporal.setValue(parsedTemporalType);
        }

        FetchType parsedFetchType = parsedBasic.getFetch();
        BasicSnippet basic = new BasicSnippet();

        if (parsedFetchType != null) {
            basic.setFetchType(parsedFetchType.value());
        }
        if (parsedBasic.getOptional() != null) {
            basic.setOptional(parsedBasic.getOptional());
        }

        Lob parsedLob = parsedBasic.getLob();

        VariableDefSnippet variableDef = getVariableDef(parsedBasic);

        variableDef.setBasic(basic);
        variableDef.setColumnDef(columnDef);
        variableDef.setEnumerated(enumerated);
        variableDef.setTemporal(temporal);
        variableDef.setType(parsedBasic.getAttributeType());
        variableDef.setFunctionalType(parsedBasic.isOptionalReturnType());
        variableDef.setConverts(processConverts(Collections.singletonList(parsedBasic.getConvert())));
        variableDef.setLob(parsedLob != null);
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:46,代码来源:ClassGenerator.java

示例14: createKeys

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
@Override
protected boolean createKeys(List<AttributeWidget> attributeWidgets) {

    PersistenceClassWidget<? extends ManagedClass> classWidget = null;

    if (parentNode instanceof EGRootNode) {
        classWidget = ((EGRootNode) parentNode).getRootWidget();
    } else if (parentNode instanceof EGInternalNode) {
        classWidget = ((EGInternalNode) parentNode).getParentWidget();
    }

    if (classWidget != null) {
        for (AttributeWidget attributeWidget : classWidget.getAllSortedAttributeWidgets()) {
            if (attributeWidget instanceof IdAttributeWidget || attributeWidget instanceof EmbeddedIdAttributeWidget || attributeWidget instanceof EmbeddedAttributeWidget || attributeWidget instanceof VersionAttributeWidget) {
                attributeWidgets.add(attributeWidget);
            } else if (attributeWidget instanceof TransientAttributeWidget) {
                // skip
            } else { //check for all remaining
                Attribute attribute = (Attribute) attributeWidget.getBaseElementSpec();

                NamedAttributeNode namedAttributeNode = null;
                if (parentNode instanceof EGRootNode) {
                    namedAttributeNode = parentNode.getBaseElementSpec().findNamedAttributeNode(attribute.getName());
                } else if (parentNode instanceof EGInternalNode && ((EGInternalNode) parentNode).getSubgraph() != null) {//if sub graph not exist for relation node
                    namedAttributeNode = ((EGInternalNode) parentNode).getSubgraph().findNamedAttributeNode(attribute.getName());
                }

                if (namedAttributeNode != null) {
                    attributeWidgets.add(attributeWidget);
                } else if (loadGraph && attribute instanceof FetchTypeHandler) {
                    FetchType fetch = ((FetchTypeHandler) attribute).getFetch();
                    if (fetch != null) {
                        if (fetch == FetchType.EAGER) {
                            attributeWidgets.add(attributeWidget);
                        }
                    } else if (attribute instanceof Basic || attribute instanceof OneToOne || attribute instanceof ManyToOne) {
                        attributeWidgets.add(attributeWidget);
                    }

                }
            }
        }
    }

    return true;
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:47,代码来源:ExecutionEGChildFactory.java

示例15: loadAttributes

import org.netbeans.jpa.modeler.spec.Basic; //导入依赖的package包/类
private void loadAttributes() {
        ManagedClass attributeClass = null;
        String prefix;
        if(mapKey){
            prefix = "key";
            if (convertContainer instanceof MapKeyHandler) {//ElementCollection,MultiRelationAttribute
                MapKeyHandler elementCollection = (MapKeyHandler) convertContainer;
//                if (elementCollection.getMapKeyAttribute() != null) {//MapKeyType.EXT
//                    if (elementCollection.getMapKeyAttribute() instanceof Embedded) {
//                        attributeClass = ((Embedded) elementCollection.getMapKeyAttribute()).getConnectedClass();
//                    }
//                } else 
                if (elementCollection.getMapKeyEmbeddable() != null) {//MapKeyType.NEW
                    attributeClass = elementCollection.getMapKeyEmbeddable();
                } else if (elementCollection.getMapKeyEntity() != null) {//MapKeyType.NEW
                    attributeClass = elementCollection.getMapKeyEntity();
                }
            } 
        } else {
            prefix = EMPTY;
            if (convertContainer instanceof org.netbeans.jpa.modeler.spec.Entity) {
                attributeClass = (ManagedClass) ((org.netbeans.jpa.modeler.spec.Entity) convertContainer).getSuperclass();
            } else if (convertContainer instanceof Embedded) {
                attributeClass = ((Embedded) convertContainer).getConnectedClass();
            } else if (convertContainer instanceof ElementCollection) {
                attributeClass = ((ElementCollection) convertContainer).getConnectedClass();
            }
        }
        
        attribute_ComboBox.removeAllItems();
        attribute_Label.setEnabled(attributeClass != null);
        attribute_ComboBox.setEnabled(attributeClass != null);
        
        if (attributeClass != null) {
            List<String> items = new ArrayList<>();
            List<Attribute> attributes = attributeClass.getAttributes().getAllAttribute(true);
            items.addAll(attributes
                        .stream()
                        .filter(attr -> attr instanceof Basic)
                        .map(attr -> (Basic)attr)
                        .filter(basic -> basic.getTemporal() == null)
                        .filter(basic -> basic.getEnumerated() == null)
                        .map(Basic::getName)
                        .map(attrName -> prefix.isEmpty() ? attrName : (prefix + '.' + attrName))
                        .collect(toList()));
                items.addAll(attributes
                        .stream()
                        .filter(attr -> attr instanceof ElementCollection)
                        .map(attr -> (ElementCollection)attr)
                        .filter(ec -> ec.getTemporal() == null)
                        .filter(ec -> ec.getEnumerated() == null)
                        .map(ElementCollection::getName)
                        .map(attrName -> prefix.isEmpty() ? attrName : (prefix + '.' + attrName))
                        .collect(toList()));
                
//            if ((attributeClass instanceof org.netbeans.jpa.modeler.spec.Entity) || (attributeClass instanceof MappedSuperclass)) {
              if (attributeClass instanceof Embeddable) {
                items.addAll(attributes
                        .stream()
                        .filter(attr -> attr instanceof Embedded)
                        .map(attr -> (Embedded)attr)
                        .map(emb -> getPaths(prefix, emb, attr -> ((attr instanceof Basic) || (attr instanceof ElementCollection))))
                        .collect(ArrayList<String>::new, ArrayList::addAll, ArrayList::addAll));
            }
            items.stream().forEach(attribute_ComboBox::addItem);
        }
    }
 
开发者ID:jeddict,项目名称:jeddict,代码行数:68,代码来源:OverrideConvertPanel.java


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