本文整理汇总了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;
}
}
}
示例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();
}
}
示例3: isIdClassType
@Override
public boolean isIdClassType() {
return compositePrimaryKeyType == CompositePrimaryKeyType.IDCLASS
|| (compositePrimaryKeyType == CompositePrimaryKeyType.DEFAULT && !CodePanel.isEmbeddedIdDefaultType());
}
示例4: isEmbeddedIdType
@Override
public boolean isEmbeddedIdType() {
return compositePrimaryKeyType == CompositePrimaryKeyType.EMBEDDEDID
|| (compositePrimaryKeyType == CompositePrimaryKeyType.DEFAULT && CodePanel.isEmbeddedIdDefaultType());
}
示例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);
}