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


Java CompositePrimaryKeyType类代码示例

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


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

示例1: manageCompositePrimaryKeyType

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
private void manageCompositePrimaryKeyType() {
    if (null != compositePrimaryKeyType) {
        CompositePrimaryKeyType type = compositePrimaryKeyType == CompositePrimaryKeyType.DEFAULT ? (CodePanel.isEmbeddedIdDefaultType() ? CompositePrimaryKeyType.EMBEDDEDID : CompositePrimaryKeyType.IDCLASS) : compositePrimaryKeyType;
        switch (type) {
            case EMBEDDEDID:
                this.idClass = null;
                break;
            case IDCLASS:
                if (this.idClass != null) {
                    this.idClass.setClazz(compositePrimaryKeyClass);
                } else {
                    this.idClass = new IdClass(compositePrimaryKeyClass);
                }
                break;
            default:
                this.idClass = null;
                compositePrimaryKeyClass = null;
        }
    }
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:21,代码来源:IdentifiableClass.java

示例2: manageCompositePrimaryKeyClass

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
public void manageCompositePrimaryKeyClass() {
    if (compositePrimaryKeyClass == null || compositePrimaryKeyClass.trim().isEmpty()) {
        compositePrimaryKeyClass = this.getClazz() + "PK";
    }
    if (this.getCompositePrimaryKeyType() == CompositePrimaryKeyType.EMBEDDEDID) {
        this.getAttributes().getEmbeddedId().setAttributeType(compositePrimaryKeyClass);
        this.idClass = null;
    } else if (this.getCompositePrimaryKeyType() == CompositePrimaryKeyType.IDCLASS) {
        this.idClass = new IdClass(compositePrimaryKeyClass);
    } else {
        this.idClass = null;
        compositePrimaryKeyClass = null;
        if (getCompositePrimaryKeyType() == null) {
            setCompositePrimaryKeyType(CompositePrimaryKeyType.NONE);
        }
    }
}
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:18,代码来源:Entity.java

示例3: isCompositePKPropertyAllow

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
public boolean isCompositePKPropertyAllow() {
    if (this.getBaseElementSpec() instanceof PrimaryKeyContainer) {
        PrimaryKeyContainer primaryKeyContainerSpec = (PrimaryKeyContainer) this.getBaseElementSpec();
        String inheritenceState = this.getInheritenceState();
        boolean visible = false;
        if (this instanceof EntityWidget) {
            visible = getIdAttributeWidgets().size() > 1 && ("ROOT".equals(inheritenceState) || "SINGLETON".equals(inheritenceState));
        } else if (this instanceof MappedSuperclassWidget) {
            visible = getIdAttributeWidgets().size() > 1;
        }
        if (visible) {
            if ((primaryKeyContainerSpec.getCompositePrimaryKeyClass() == null || primaryKeyContainerSpec.getCompositePrimaryKeyClass().trim().isEmpty())
                    && (primaryKeyContainerSpec.getCompositePrimaryKeyType() == CompositePrimaryKeyType.EMBEDDEDID || primaryKeyContainerSpec.getCompositePrimaryKeyType() == CompositePrimaryKeyType.IDCLASS)) {
                primaryKeyContainerSpec.manageCompositePrimaryKeyClass();
                getModelerScene().getModelerPanelTopComponent().changePersistenceState(false);
            }
        }
        return visible;
    }
    return false;
}
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:22,代码来源:PersistenceClassWidget.java

示例4: onCompositePrimaryKeyTypeChange

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
public void onCompositePrimaryKeyTypeChange(CompositePrimaryKeyType compositePrimaryKeyType) {
    if ((compositePrimaryKeyType == CompositePrimaryKeyType.EMBEDDEDID
            || (compositePrimaryKeyType == CompositePrimaryKeyType.DEFAULT && CodePanel.isEmbeddedIdDefaultType()))) {
        if (embeddedIdAttributeWidget == null) {
            addNewEmbeddedIdAttribute(getNextAttributeName(this.getName() + "EmbeddedId"));
        }
    } else if (embeddedIdAttributeWidget != null) {
        embeddedIdAttributeWidget.remove();
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:11,代码来源:PrimaryKeyContainerWidget.java

示例5: load

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
public void load(EntityMappings entityMappings, TypeElement element, boolean fieldAccess) {
//        AnnotationMirror annotationMirror = JavaSourceParserUtil.getAnnotation(element, "javax.persistence.MappedSuperclass");
        if (entityMappings.findMappedSuperclass(element.getSimpleName().toString()) == null) {
            TypeElement superClassElement = JavaSourceParserUtil.getSuperclassTypeElement(element);
            if (!superClassElement.getQualifiedName().toString().equals("java.lang.Object")) {
                if (JavaSourceParserUtil.isEntityClass(superClassElement)) {
                    org.netbeans.jpa.modeler.spec.Entity entitySuperclassSpec = new org.netbeans.jpa.modeler.spec.Entity();
                    entitySuperclassSpec.load(entityMappings, superClassElement, fieldAccess);
                    super.setSuperclass(entitySuperclassSpec.getClazz());
                    super.setSuperclassId(entitySuperclassSpec.getId());
                    entityMappings.addEntity(entitySuperclassSpec);
                } else if (JavaSourceParserUtil.isMappedSuperClass(superClassElement)) {
                    org.netbeans.jpa.modeler.spec.MappedSuperclass mappedSuperclassSpec = new org.netbeans.jpa.modeler.spec.MappedSuperclass();
                    mappedSuperclassSpec.load(entityMappings, superClassElement, fieldAccess);
                    super.setSuperclass(mappedSuperclassSpec.getClazz());
                    super.setSuperclassId(mappedSuperclassSpec.getId());
                    entityMappings.addMappedSuperclass(mappedSuperclassSpec);
                } else {
                    //Skip
                }
            }
            this.setId(NBModelerUtil.getAutoGeneratedStringId());
            this.idClass = IdClass.load(element);
            this.getAttributes().load(entityMappings, element, fieldAccess);
            this.clazz = element.getSimpleName().toString();
            this.access = AccessType.load(element);

            if (this.getAttributes().getEmbeddedId() != null) {
                this.setCompositePrimaryKeyClass(this.getAttributes().getEmbeddedId().getAttributeType());
                this.setCompositePrimaryKeyType(CompositePrimaryKeyType.EMBEDDEDID);
            } else if (idClass != null) {
                this.setCompositePrimaryKeyClass(this.getIdClass().getClazz());
                this.setCompositePrimaryKeyType(CompositePrimaryKeyType.IDCLASS);
            } else {
                this.setCompositePrimaryKeyClass(null);
                this.setCompositePrimaryKeyType(null);
            }
        }
    }
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:40,代码来源:MappedSuperclass.java

示例6: marshal

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
@Override
public String marshal(CompositePrimaryKeyType compositePrimaryKeyType) {
   return compositePrimaryKeyType!=null?compositePrimaryKeyType.getType():null;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:5,代码来源:CompositePrimaryKeyAdapter.java

示例7: unmarshal

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
@Override
public CompositePrimaryKeyType unmarshal(String val) {
   return CompositePrimaryKeyType.get(val);
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:5,代码来源:CompositePrimaryKeyAdapter.java

示例8: getCompositePrimaryKeyType

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
/**
 * @return the compositePrimaryKeyType
 */
@Override
public CompositePrimaryKeyType getCompositePrimaryKeyType() {
    return compositePrimaryKeyType;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:8,代码来源:IdentifiableClass.java

示例9: isIdClassType

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
@Override
public boolean isIdClassType() {
    return compositePrimaryKeyType == CompositePrimaryKeyType.IDCLASS
            || (compositePrimaryKeyType == CompositePrimaryKeyType.DEFAULT && !CodePanel.isEmbeddedIdDefaultType());
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:6,代码来源:IdentifiableClass.java

示例10: isEmbeddedIdType

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
@Override
public boolean isEmbeddedIdType() {
    return compositePrimaryKeyType == CompositePrimaryKeyType.EMBEDDEDID
            || (compositePrimaryKeyType == CompositePrimaryKeyType.DEFAULT && CodePanel.isEmbeddedIdDefaultType());
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:6,代码来源:IdentifiableClass.java

示例11: setCompositePrimaryKeyType

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
/**
 * @param compositePrimaryKeyType the compositePrimaryKeyType to set
 */
@Override
public void setCompositePrimaryKeyType(CompositePrimaryKeyType compositePrimaryKeyType) {
    this.compositePrimaryKeyType = compositePrimaryKeyType;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:8,代码来源:IdentifiableClass.java

示例12: getCompositePrimaryKeyProperty

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
private ComboBoxPropertySupport getCompositePrimaryKeyProperty() {
    final JavaClassWidget javaClassWidget = this;
    final PrimaryKeyContainer primaryKeyContainerSpec = (PrimaryKeyContainer) javaClassWidget.getBaseElementSpec();
    ComboBoxListener<CompositePrimaryKeyType> comboBoxListener = new ComboBoxListener<CompositePrimaryKeyType>() {
        @Override
        public void setItem(ComboBoxValue<CompositePrimaryKeyType> value) {
            CompositePrimaryKeyType compositePrimaryKeyType = value.getValue();
            onCompositePrimaryKeyTypeChange(compositePrimaryKeyType);
            primaryKeyContainerSpec.setCompositePrimaryKeyType(compositePrimaryKeyType);
        }

        @Override
        public ComboBoxValue<CompositePrimaryKeyType> getItem() {
            if (primaryKeyContainerSpec.getCompositePrimaryKeyType() == CompositePrimaryKeyType.EMBEDDEDID) {
                return new ComboBoxValue(CompositePrimaryKeyType.EMBEDDEDID, "Embedded Id");
            } else if (primaryKeyContainerSpec.getCompositePrimaryKeyType() == CompositePrimaryKeyType.IDCLASS) {
                return new ComboBoxValue(CompositePrimaryKeyType.IDCLASS, "Id Class");
            } else {
                return new ComboBoxValue(CompositePrimaryKeyType.DEFAULT, String.format("Default (%s)", CodePanel.getDefaultCompositePrimaryKeyType()));
            }
        }

        @Override
        public List<ComboBoxValue<CompositePrimaryKeyType>> getItemList() {
            List<ComboBoxValue<CompositePrimaryKeyType>> values = new ArrayList<>();
            values.add(new ComboBoxValue(CompositePrimaryKeyType.DEFAULT, String.format("Default (%s)", CodePanel.getDefaultCompositePrimaryKeyType())));
            values.add(new ComboBoxValue(CompositePrimaryKeyType.IDCLASS, "Id Class"));
            values.add(new ComboBoxValue(CompositePrimaryKeyType.EMBEDDEDID, "Embedded Id"));
            return values;
        }

        @Override
        public String getDefaultText() {
            return "Id Class";
        }

        @Override
        public ActionHandler getActionHandler() {
            return null;
        }
    };
    return new ComboBoxPropertySupport(this.getModelerScene().getModelerFile(), "compositePrimaryKeyType", "Composite PrimaryKey Type", "", comboBoxListener);
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:44,代码来源:PrimaryKeyContainerWidget.java

示例13: load

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
public void load(EntityMappings entityMappings, TypeElement element, boolean fieldAccess) {
    AnnotationMirror annotationMirror = JavaSourceParserUtil.getAnnotation(element, "javax.persistence.Entity");
    if (entityMappings.findEntity(element.getSimpleName().toString()) == null) {
        TypeElement superClassElement = JavaSourceParserUtil.getSuperclassTypeElement(element);
        if (!superClassElement.getQualifiedName().toString().equals("java.lang.Object")) {
            if (JavaSourceParserUtil.isEntityClass(superClassElement)) {
                org.netbeans.jpa.modeler.spec.Entity entitySuperclassSpec = new org.netbeans.jpa.modeler.spec.Entity();
                entitySuperclassSpec.load(entityMappings, superClassElement, fieldAccess);
                super.setSuperclass(entitySuperclassSpec.getClazz());
                super.setSuperclassId(entitySuperclassSpec.getId());
                entityMappings.addEntity(entitySuperclassSpec);
            } else if (JavaSourceParserUtil.isMappedSuperClass(superClassElement)) {
                org.netbeans.jpa.modeler.spec.MappedSuperclass mappedSuperclassSpec = new org.netbeans.jpa.modeler.spec.MappedSuperclass();
                mappedSuperclassSpec.load(entityMappings, superClassElement, fieldAccess);
                super.setSuperclass(mappedSuperclassSpec.getClazz());
                super.setSuperclassId(mappedSuperclassSpec.getId());
                entityMappings.addMappedSuperclass(mappedSuperclassSpec);
            } else {
                //Skip
            }
        }
        this.setId(NBModelerUtil.getAutoGeneratedStringId());
        this.table = Table.load(element);
        this.idClass = IdClass.load(element);
        this.inheritance = Inheritance.load(element);
        AnnotationMirror annotDiscrValue = JavaSourceParserUtil.findAnnotation(element, "javax.persistence.DiscriminatorValue");
        if (annotDiscrValue != null) {
            Object value = JavaSourceParserUtil.findAnnotationValue(annotationMirror, "value");
            if (value != null) {
                discriminatorValue = value.toString();
            }
        }
        this.discriminatorColumn = DiscriminatorColumn.load(element);
        this.tableGenerator = TableGenerator.load(element);
        this.sequenceGenerator = SequenceGenerator.load(element);
        this.getAttributes().load(entityMappings, element, fieldAccess);
        if (annotationMirror != null) {
            this.name = (String) JavaSourceParserUtil.findAnnotationValue(annotationMirror, "name");
        }
        this.clazz = element.getSimpleName().toString();
        this.access = AccessType.load(element);

        if (this.getAttributes().getEmbeddedId() != null) {
            this.setCompositePrimaryKeyClass(this.getAttributes().getEmbeddedId().getAttributeType());
            this.setCompositePrimaryKeyType(CompositePrimaryKeyType.EMBEDDEDID);
        } else if (idClass != null) {
            this.setCompositePrimaryKeyClass(this.getIdClass().getClazz());
            this.setCompositePrimaryKeyType(CompositePrimaryKeyType.IDCLASS);
        } else {
            this.setCompositePrimaryKeyClass(null);
            this.setCompositePrimaryKeyType(null);
        }

    }
}
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:56,代码来源:Entity.java

示例14: getCompositePrimaryKeyType

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
/**
 * @return the compositePrimaryKeyType
 */
public CompositePrimaryKeyType getCompositePrimaryKeyType() {
    return compositePrimaryKeyType;
}
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:7,代码来源:Entity.java

示例15: setCompositePrimaryKeyType

import org.netbeans.jpa.modeler.spec.extend.CompositePrimaryKeyType; //导入依赖的package包/类
/**
 * @param compositePrimaryKeyType the compositePrimaryKeyType to set
 */
public void setCompositePrimaryKeyType(CompositePrimaryKeyType compositePrimaryKeyType) {
    this.compositePrimaryKeyType = compositePrimaryKeyType;
    manageCompositePrimaryKeyClass();
}
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:8,代码来源:Entity.java


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