本文整理汇总了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;
}
示例2: processDefaultExcludeListeners
import org.netbeans.jpa.modeler.spec.EmptyType; //导入依赖的package包/类
protected void processDefaultExcludeListeners(
EmptyType parsedEmptyType) {
if (parsedEmptyType != null) {
classDef.setDefaultExcludeListener(true);
}
}
示例3: processExcludeSuperclassListeners
import org.netbeans.jpa.modeler.spec.EmptyType; //导入依赖的package包/类
protected void processExcludeSuperclassListeners(
EmptyType parsedEmptyType) {
if (parsedEmptyType != null) {
classDef.setExcludeSuperClassListener(true);
}
}
示例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;
}
示例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;
}
示例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);
}