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


Java Lob类代码示例

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


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

示例1: setLob

import org.netbeans.jpa.modeler.spec.Lob; //导入依赖的package包/类
public static void setLob(DirectAccessor accessor, Lob lob, String attributeType, boolean isCollectionType) {
    if (lob == null || attributeType == null) {
        return;
    }
    if (isArray(attributeType)) {
        String attributeArrayType = AttributeType.getArrayType(attributeType);
        if (attributeArrayType.equals(BYTE) || attributeArrayType.equals(BYTE_WRAPPER)) { //https://github.com/jeddict/jeddict/issues/5 , https://github.com/jeddict/jeddict/issues/6
            if (isCollectionType) {
                ((ElementCollectionAccessor) accessor).setTargetClassName(Blob.class.getName());
            } else {
                accessor.setAttributeType(Blob.class.getName());
            }
        } else if (attributeArrayType.equals(CHAR) || attributeArrayType.equals(CHAR_WRAPPER)) {
            if (isCollectionType) {
                ((ElementCollectionAccessor) accessor).setTargetClassName(Clob.class.getName());
            } else {
                accessor.setAttributeType(Clob.class.getName());
            }
        }
    }

    accessor.setLob(new LobMetadata());

}
 
开发者ID:jeddict,项目名称:jCode,代码行数:25,代码来源:AccessorUtil.java

示例2: processBasic

import org.netbeans.jpa.modeler.spec.Lob; //导入依赖的package包/类
protected void processBasic(List<Basic> parsedBasics) {
    if (parsedBasics == null) {
        return;
    }
    for (Basic parsedBasic : parsedBasics) {
        ColumnDefSnippet columnDef = getColumnDef(parsedBasic.getColumn());

        EnumType parsedEnumType = parsedBasic.getEnumerated();
        EnumeratedSnippet enumerated = null;
        if (parsedEnumType != null) {
            enumerated = new EnumeratedSnippet();
            enumerated.setValue(parsedEnumType);
        }

        TemporalType parsedTemporalType = parsedBasic.getTemporal();
        TemporalSnippet temporal = null;
        if (parsedTemporalType != null) {
            temporal = new TemporalSnippet();
            temporal.setValue(parsedTemporalType);
        }

        FetchType parsedFetchType = parsedBasic.getFetch();
        BasicSnippet basic = new BasicSnippet();

        if (parsedFetchType != null) {
            basic.setFetchType(parsedFetchType.value());
        }
        if (parsedBasic.getOptional() != null) {
            basic.setOptional(parsedBasic.getOptional());
        }

        Lob parsedLob = parsedBasic.getLob();

        VariableDefSnippet variableDef = getVariableDef(parsedBasic);

        variableDef.setBasic(basic);
        variableDef.setColumnDef(columnDef);
        variableDef.setEnumerated(enumerated);
        variableDef.setTemporal(temporal);
        variableDef.setType(parsedBasic.getAttributeType());
        variableDef.setFunctionalType(parsedBasic.isOptionalReturnType());
        variableDef.setConverts(processConverts(Collections.singletonList(parsedBasic.getConvert())));
        variableDef.setLob(parsedLob != null);
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:46,代码来源:ClassGenerator.java

示例3: processElementCollection

import org.netbeans.jpa.modeler.spec.Lob; //导入依赖的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));
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:66,代码来源:ClassGenerator.java

示例4: processBasic

import org.netbeans.jpa.modeler.spec.Lob; //导入依赖的package包/类
protected void processBasic(List<Basic> parsedBasics) {
    if (parsedBasics == null) {
        return;
    }
    for (Basic parsedBasic : parsedBasics) {
        ColumnDefSnippet columnDef = getColumnDef(parsedBasic.getColumn());

        EnumType parsedEnumType = parsedBasic.getEnumerated();

        EnumeratedSnippet enumerated = null;

        if (parsedEnumType != null) {
            enumerated = new EnumeratedSnippet();

            if (parsedEnumType.equals(EnumType.ORDINAL)) {
                enumerated.setValue(EnumeratedSnippet.TYPE_ORDINAL);
            } else {
                enumerated.setValue(EnumeratedSnippet.TYPE_STRING);
            }
        }

        FetchType parsedFetchType = parsedBasic.getFetch();
        BasicSnippet basic = new BasicSnippet();

        if (parsedFetchType != null) {
            basic.setFetchType(parsedFetchType.value());
        }
        if (parsedBasic.getOptional() != null) {
            basic.setOptional(parsedBasic.getOptional());
        }

        TemporalType parsedTemporal = parsedBasic.getTemporal();
        Lob parsedLob = parsedBasic.getLob();

        VariableDefSnippet variableDef = getVariableDef(parsedBasic.getName());

        variableDef.setBasic(basic);
        variableDef.setColumnDef(columnDef);
        variableDef.setEnumerated(enumerated);
        variableDef.setType(parsedBasic.getAttributeType());

        if (parsedTemporal != null) {
            variableDef.setTemporal(true);
            variableDef.setTemporalType(
                    TEMPORAL_TYPE_PREFIX + parsedTemporal.value());
        }

        if (parsedLob != null) {
            variableDef.setLob(true);
        }
    }
}
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:53,代码来源:ClassGenerator.java

示例5: processElementCollection

import org.netbeans.jpa.modeler.spec.Lob; //导入依赖的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);
        }
    }
}
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:71,代码来源:ClassGenerator.java

示例6: getValue

import org.netbeans.jpa.modeler.spec.Lob; //导入依赖的package包/类
@Override
    public BaseAttribute getValue() {
        if (baseAttribute instanceof Basic) {
            Basic basic = (Basic) baseAttribute;
            basic.setLob(null);
            basic.setEnumerated(null);
            basic.setTemporal(null);
            if (type_ComboBox.getSelectedItem().equals("Enumerated")) {
                if (String_RadioButton.isSelected()) {
                    basic.setEnumerated(EnumType.STRING);
                } else {
                    basic.setEnumerated(EnumType.ORDINAL);
                }
            } else if (type_ComboBox.getSelectedItem().equals("Lob")) {
                basic.setLob(new Lob());
            } else if (type_ComboBox.getSelectedItem().equals("Temporal")) {
                if (Date_RadioButton.isSelected()) {
                    basic.setTemporal(TemporalType.DATE);
                } else if (Time_RadioButton.isSelected()) {
                    basic.setTemporal(TemporalType.TIME);
                } else if (TimeStamp_RadioButton.isSelected()) {
                    basic.setTemporal(TemporalType.TIMESTAMP);
                }
            }

        }
        if (baseAttribute instanceof ElementCollection) {
            ElementCollection elementCollection = (ElementCollection) baseAttribute;
            elementCollection.setLob(null);
            elementCollection.setEnumerated(null);
            elementCollection.setTemporal(null);
            if (type_ComboBox.getSelectedItem().equals("Enumerated")) {
                if (String_RadioButton.isSelected()) {
                    elementCollection.setEnumerated(EnumType.STRING);
                } else {
                    elementCollection.setEnumerated(EnumType.ORDINAL);
                }
            } else if (type_ComboBox.getSelectedItem().equals("Lob")) {
                elementCollection.setLob(new Lob());
            } else if (type_ComboBox.getSelectedItem().equals("Temporal")) {
                if (Date_RadioButton.isSelected()) {
                    elementCollection.setTemporal(TemporalType.DATE);
                } else if (Time_RadioButton.isSelected()) {
                    elementCollection.setTemporal(TemporalType.TIME);
                } else if (TimeStamp_RadioButton.isSelected()) {
                    elementCollection.setTemporal(TemporalType.TIMESTAMP);
                }
            }

        } else if (baseAttribute instanceof Id) {
            Id id = (Id) baseAttribute;
            id.setTemporal(null);
            if (type_ComboBox.getSelectedItem().equals("Temporal")) {
                if (Date_RadioButton.isSelected()) {
                    id.setTemporal(TemporalType.DATE);
                } else if (Time_RadioButton.isSelected()) {
                    id.setTemporal(TemporalType.TIME);
                } else if (TimeStamp_RadioButton.isSelected()) {
                    id.setTemporal(TemporalType.TIMESTAMP);
                }
            }

        } else if (baseAttribute instanceof Transient) {
//            Transient _transient = (Transient) baseAttribute;

        } else if (baseAttribute instanceof Version) {
            Version version = (Version) baseAttribute;
            version.setTemporal(null);
            if (type_ComboBox.getSelectedItem().equals("Temporal")) {
                if (Date_RadioButton.isSelected()) {
                    version.setTemporal(TemporalType.DATE);
                } else if (Time_RadioButton.isSelected()) {
                    version.setTemporal(TemporalType.TIME);
                } else if (TimeStamp_RadioButton.isSelected()) {
                    version.setTemporal(TemporalType.TIMESTAMP);
                }
            }
        }
        baseAttribute.setAttributeType(dataType_ComboBox.getSelectedItem().toString());
        return baseAttribute;
    }
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:82,代码来源:FieldTypePanel.java


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