本文整理汇总了Java中org.netbeans.jpa.modeler.spec.ElementCollection.getLob方法的典型用法代码示例。如果您正苦于以下问题:Java ElementCollection.getLob方法的具体用法?Java ElementCollection.getLob怎么用?Java ElementCollection.getLob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.jpa.modeler.spec.ElementCollection
的用法示例。
在下文中一共展示了ElementCollection.getLob方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processElementCollection
import org.netbeans.jpa.modeler.spec.ElementCollection; //导入方法依赖的package包/类
protected void processElementCollection(List<ElementCollection> parsedElementCollections) {
if (parsedElementCollections == null) {
return;
}
for (ElementCollection parsedElementCollection : parsedElementCollections) {
CollectionTableSnippet collectionTable = getCollectionTable(parsedElementCollection.getCollectionTable());
FetchType parsedFetchType = parsedElementCollection.getFetch();
ElementCollectionSnippet elementCollection = new ElementCollectionSnippet();
elementCollection.setCollectionType(parsedElementCollection.getCollectionType());
elementCollection.setCollectionImplType(parsedElementCollection.getCollectionImplType());
elementCollection.setMapKeySnippet(updateMapKeyAttributeSnippet(parsedElementCollection));
elementCollection.setTargetClass(parsedElementCollection.getAttributeType());
if (parsedElementCollection.getConnectedClass() != null) {
elementCollection.setTargetClassPackage(parsedElementCollection.getConnectedClass().getAbsolutePackage(rootPackageName));
}
if (parsedFetchType != null) {
elementCollection.setFetchType(parsedFetchType.value());
}
Lob parsedLob = parsedElementCollection.getLob();
VariableDefSnippet variableDef = getVariableDef(parsedElementCollection);
variableDef.setElementCollection(elementCollection);
variableDef.setCollectionTable(collectionTable);
if (parsedElementCollection.getOrderBy() != null) {
variableDef.setOrderBy(new OrderBySnippet(parsedElementCollection.getOrderBy()));
} else if (parsedElementCollection.getOrderColumn() != null) {
variableDef.setOrderColumn(new OrderColumnSnippet(parsedElementCollection.getOrderColumn()));
}
if (parsedLob != null) {
variableDef.setLob(true);
}
if (parsedElementCollection.getConnectedClass() == null) {//if not embeddable
EnumType parsedEnumType = parsedElementCollection.getEnumerated();
EnumeratedSnippet enumerated = null;
if (parsedEnumType != null) {
enumerated = new EnumeratedSnippet();
enumerated.setValue(parsedEnumType);
}
TemporalType parsedTemporalType = parsedElementCollection.getTemporal();
TemporalSnippet temporal = null;
if (parsedTemporalType != null) {
temporal = new TemporalSnippet();
temporal.setValue(parsedTemporalType);
}
variableDef.setEnumerated(enumerated);
variableDef.setTemporal(temporal);
variableDef.setColumnDef(getColumnDef(parsedElementCollection.getColumn()));
} else {
processInternalAttributeOverride(variableDef, parsedElementCollection.getAttributeOverride());
processInternalAssociationOverride(variableDef, parsedElementCollection.getAssociationOverride());
}
List<Convert> converts = new ArrayList<>();
converts.addAll(parsedElementCollection.getMapKeyConverts());
converts.addAll(parsedElementCollection.getConverts());
variableDef.setConverts(processConverts(converts));
}
}
示例2: setValue
import org.netbeans.jpa.modeler.spec.ElementCollection; //导入方法依赖的package包/类
@Override
public void setValue(Attribute attribute) {
this.attribute = attribute;
initTypeComboBox();
if (mapKey) {
MapKeyHandler mapKeyHandler = (MapKeyHandler) attribute;
if (mapKeyHandler.getMapKeyEntity()!= null) {
type_ComboBox.setSelectedItem(ENTITY);
} else if (mapKeyHandler.getMapKeyEmbeddable()!= null) {
type_ComboBox.setSelectedItem(EMBEDDABLE);
} else if (mapKeyHandler.getMapKeyEnumerated() != null) {
selectEnumType(mapKeyHandler.getMapKeyEnumerated());
} else if (mapKeyHandler.getMapKeyTemporal() != null) {
selectedTemporalType(mapKeyHandler.getMapKeyTemporal());
} else {
type_ComboBox.setSelectedItem(DEFAULT);
}
} else if (attribute instanceof Basic) {
Basic basic = (Basic) attribute;
if (basic.getLob() != null) {
type_ComboBox.setSelectedItem(LOB);
} else if (basic.getEnumerated() != null) {
selectEnumType(basic.getEnumerated());
} else if (basic.getTemporal() != null) {
selectedTemporalType(basic.getTemporal());
} else {
type_ComboBox.setSelectedItem(DEFAULT);
}
} else if (attribute instanceof ElementCollection) {
ElementCollection elementCollection = (ElementCollection) attribute;
if (elementCollection.getLob() != null) {
type_ComboBox.setSelectedItem(LOB);
} else if (elementCollection.getEnumerated() != null) {
selectEnumType(elementCollection.getEnumerated());
} else if (elementCollection.getTemporal() != null) {
selectedTemporalType(elementCollection.getTemporal());
} else {
type_ComboBox.setSelectedItem(DEFAULT);
}
} else if (attribute instanceof Id) {
selectedTemporalType(((Id) attribute).getTemporal());
} else if (attribute instanceof Version) {
selectedTemporalType(((Version) attribute).getTemporal());
} else if (attribute instanceof Transient) {
} else {
throw new UnsupportedOperationException("Not supported yet.");
}
type_ComboBoxActionPerformed(null);
initDataTypeComboBox();
if (mapKey) {
MapKeyHandler relationAttribute = (MapKeyHandler) attribute;
if (relationAttribute.getMapKeyEntity() != null) {
dataType_ComboBox.setSelectedItem(new ComboBoxValue<>(relationAttribute.getMapKeyEntity(), relationAttribute.getMapKeyEntity().getClazz()));
} else if (relationAttribute.getMapKeyEmbeddable() != null) {
dataType_ComboBox.setSelectedItem(new ComboBoxValue<>(relationAttribute.getMapKeyEmbeddable(), relationAttribute.getMapKeyEmbeddable().getClazz()));
} else if (relationAttribute.getMapKeyAttributeType() != null) {
dataType_ComboBox.setSelectedItem(relationAttribute.getMapKeyAttributeType());
}
} else {
dataType_ComboBox.setSelectedItem(((BaseAttribute) attribute).getAttributeType());
}
}
示例3: processElementCollection
import org.netbeans.jpa.modeler.spec.ElementCollection; //导入方法依赖的package包/类
protected void processElementCollection(List<ElementCollection> parsedElementCollections) {
if (parsedElementCollections == null) {
return;
}
for (ElementCollection parsedElementCollection : parsedElementCollections) {
ColumnDefSnippet columnDef = getColumnDef(parsedElementCollection.getColumn());
EnumType enumType = parsedElementCollection.getEnumerated();
CollectionTableSnippet collectionTable = getCollectionTable(parsedElementCollection.getCollectionTable());
EnumeratedSnippet enumerated = null;
if (enumType != null) {
enumerated = new EnumeratedSnippet();
if (enumType.equals(EnumType.ORDINAL)) {
enumerated.setValue(EnumeratedSnippet.TYPE_ORDINAL);
} else {
enumerated.setValue(EnumeratedSnippet.TYPE_STRING);
}
}
FetchType parsedFetchType = parsedElementCollection.getFetch();
ElementCollectionSnippet elementCollection = new ElementCollectionSnippet();
elementCollection.setCollectionType(parsedElementCollection.getCollectionType());
elementCollection.setTargetClass(parsedElementCollection.getTargetClass());
if (parsedFetchType != null) {
elementCollection.setFetchType(parsedFetchType.value());
}
TemporalType parsedTemporal = parsedElementCollection.getTemporal();
Lob parsedLob = parsedElementCollection.getLob();
VariableDefSnippet variableDef = getVariableDef(parsedElementCollection.getName());
variableDef.setElementCollection(elementCollection);
variableDef.setCollectionTable(collectionTable);
variableDef.setColumnDef(columnDef);
variableDef.setEnumerated(enumerated);
if (parsedTemporal != null) {
variableDef.setTemporal(true);
variableDef.setTemporalType(
TEMPORAL_TYPE_PREFIX + parsedTemporal.value());
}
if (parsedLob != null) {
variableDef.setLob(true);
}
List<AttributeOverride> attributedOverrrides
= parsedElementCollection.getAttributeOverride();
if (attributedOverrrides != null
&& !attributedOverrrides.isEmpty()
&& classDef.getAttributeOverrides() == null) {
classDef.setAttributeOverrides(new AttributeOverridesSnippet());
}
for (AttributeOverride parsedAttributeOverride : attributedOverrrides) {
AttributeOverrideSnippet attributeOverride = new AttributeOverrideSnippet();
ColumnDefSnippet columnDefAttributeOverride = getColumnDef(
parsedAttributeOverride.getColumn());
attributeOverride.setColumnDef(columnDefAttributeOverride);
attributeOverride.setName(parsedAttributeOverride.getName());
classDef.getAttributeOverrides().addAttributeOverrides(
attributeOverride);
}
}
}