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


Java CompositePrimaryKeyType.DEFAULT属性代码示例

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


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

示例1: manageCompositePrimaryKeyType

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,代码行数:20,代码来源:IdentifiableClass.java

示例2: onCompositePrimaryKeyTypeChange

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,代码行数:10,代码来源:PrimaryKeyContainerWidget.java

示例3: isIdClassType

@Override
public boolean isIdClassType() {
    return compositePrimaryKeyType == CompositePrimaryKeyType.IDCLASS
            || (compositePrimaryKeyType == CompositePrimaryKeyType.DEFAULT && !CodePanel.isEmbeddedIdDefaultType());
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:5,代码来源:IdentifiableClass.java

示例4: isEmbeddedIdType

@Override
public boolean isEmbeddedIdType() {
    return compositePrimaryKeyType == CompositePrimaryKeyType.EMBEDDEDID
            || (compositePrimaryKeyType == CompositePrimaryKeyType.DEFAULT && CodePanel.isEmbeddedIdDefaultType());
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:5,代码来源:IdentifiableClass.java

示例5: getCompositePrimaryKeyProperty

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,代码行数:43,代码来源:PrimaryKeyContainerWidget.java


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