Package org.eclipse.persistence.internal.helper

Examples of org.eclipse.persistence.internal.helper.DatabaseType


        }
    }

    @Override
    public void handleSqlArrayType(String name, String targetTypeName) {
        DatabaseType databaseType = OraclePLSQLTypes.getDatabaseTypeForCode(
            trimOffSchemaName(name));
        if (databaseType == null) {
            databaseType = getKnownDatabaseType(name);
        }
        if (databaseType == null) {
View Full Code Here


    }

    @Override
    public void endPlsqlRecordField(String fieldName, int idx) {
        if (!typeStack.empty()) {
            DatabaseType top = typeStack.peek();
            if (top.isComplexDatabaseType()) {
                ComplexDatabaseType cdt = (ComplexDatabaseType)top;
                if (cdt.isJDBCType() && cdt.isCollection()) {
                    // take OracleArrayType off stack
                    DatabaseType pop = typeStack.pop();
                    if (!typeStack.isEmpty()) {
                        DatabaseType topMinus1 = typeStack.peek();
                        if (topMinus1.isComplexDatabaseType()) {
                            ComplexDatabaseType cdtMinus1 = (ComplexDatabaseType)topMinus1;
                            if (cdtMinus1.isRecord()) {
                                PLSQLrecord recMinus1 = (PLSQLrecord)cdtMinus1;
                                PLSQLargument arg = null;
                                for (Iterator<PLSQLargument> i = recMinus1.getFields().iterator(); i.hasNext();) {
View Full Code Here

        }

        if ((m_optional != null) && m_optional) {
            call.addOptionalArgument(procedureParameterName);
        }
        DatabaseType type = getDatabaseTypeEnum(getDatabaseType(), project);
        // Process the parameter direction
        if (functionReturn) {
            if (getLength() != null) {
                ((PLSQLStoredFunctionCall)call).setResult(type, getLength());
            } else if (getPrecision() != null) {
View Full Code Here

                    dq.setCall(call);

                    DatabaseType[] typesForMethod = procOpModel.getArgumentTypes().get(i);
                    for (int j=0, len=typesForMethod.length; j<len; j++) {
                        DbStoredArgument arg = storedProcedure.getArguments().get(j);
                        DatabaseType databaseType = typesForMethod[j];
                        InOut direction = arg.getInOut();
                        if (direction == OUT) {
                            call.addNamedOutputArgument(arg.getName(), databaseType);
                        }
                        else if (direction == IN) {
                            call.addNamedArgument(arg.getName(), databaseType);
                        }
                        else {
                            call.addNamedInOutputArgument(arg.getName(), databaseType);
                        }
                        if (direction == IN | direction == INOUT) {
                            if (xdesc != null) {
                                dq.addArgumentByTypeName(arg.getName(), xdesc.getJavaClassName());
                            }
                            else {
                                if (databaseType instanceof PLSQLCollection) {
                                    dq.addArgument(arg.getName(), Array.class);
                                }
                                else if (databaseType instanceof PLSQLrecord) {
                                    dq.addArgument(arg.getName(), Struct.class);
                                }
                                else {
                                    dq.addArgument(arg.getName(),
                                        JDBCTypes.getClassForCode(databaseType.getConversionCode()));
                                }
                            }
                        }
                    }
                    orProject.getQueries().add(dq);
View Full Code Here

        }

        if ((m_optional != null) && m_optional) {
            call.addOptionalArgument(procedureParameterName);
        }
        DatabaseType type = getDatabaseTypeEnum(getDatabaseType(), project);
        // Process the parameter direction
        if (functionReturn) {
            if (getLength() != null) {
                ((PLSQLStoredFunctionCall)call).setResult(type, getLength());
            } else if (getPrecision() != null) {
View Full Code Here

                    dq.setCall(call);

                    DatabaseType[] typesForMethod = procOpModel.getArgumentTypes().get(i);
                    for (int j=0, len=typesForMethod.length; j<len; j++) {
                        DbStoredArgument arg = storedProcedure.getArguments().get(j);
                        DatabaseType databaseType = typesForMethod[j];
                        InOut direction = arg.getInOut();
                        if (direction == OUT) {
                            call.addNamedOutputArgument(arg.getName(), databaseType);
                        }
                        else if (direction == IN) {
                            call.addNamedArgument(arg.getName(), databaseType);
                        }
                        else {
                            call.addNamedInOutputArgument(arg.getName(), databaseType);
                        }
                        if (direction == IN | direction == INOUT) {
                            if (xdesc != null) {
                                dq.addArgumentByTypeName(arg.getName(), xdesc.getJavaClassName());
                            }
                            else {
                                if (databaseType instanceof PLSQLCollection) {
                                    dq.addArgument(arg.getName(), Array.class);
                                }
                                else if (databaseType instanceof PLSQLrecord) {
                                    dq.addArgument(arg.getName(), Struct.class);
                                }
                                else {
                                    dq.addArgument(arg.getName(),
                                        JDBCTypes.getClassForCode(databaseType.getConversionCode()));
                                }
                            }
                        }
                    }
                    orProject.getQueries().add(dq);
View Full Code Here

        XMLCompositeObjectMapping databaseTypeMapping = new XMLCompositeObjectMapping();
        databaseTypeMapping.setAttributeName("databaseTypeWrapper");
        databaseTypeMapping.setAttributeAccessor(new AttributeAccessor() {
            public Object getAttributeValueFromObject(Object object) {
                PLSQLCollection collection = (PLSQLCollection)object;
                DatabaseType type = collection.getNestedType();
                return wrapType(type);
            }
            public void setAttributeValueInObject(Object object, Object value) {
                PLSQLCollection collection = (PLSQLCollection)object;
                DatabaseTypeWrapper type = (DatabaseTypeWrapper)value;
                collection.setNestedType(type.getWrappedType());
            }
        });
        databaseTypeMapping.setReferenceClass(DatabaseTypeWrapper.class);
        databaseTypeMapping.setXPath("nested-type");
        descriptor.addMapping(databaseTypeMapping);
View Full Code Here

         XMLCompositeObjectMapping databaseTypeMapping = new XMLCompositeObjectMapping();
         databaseTypeMapping.setAttributeName("databaseTypeWrapper");
         databaseTypeMapping.setAttributeAccessor(new AttributeAccessor() {
           public Object getAttributeValueFromObject(Object object) {
             PLSQLargument argument = (PLSQLargument)object;
             DatabaseType type = argument.databaseType;
             return wrapType(type);
           }

           public void setAttributeValueInObject(Object object, Object value) {
             PLSQLargument argument = (PLSQLargument)object;
             DatabaseTypeWrapper type = (DatabaseTypeWrapper)value;
             argument.databaseType = type.getWrappedType();
           }
          });
         databaseTypeMapping.setReferenceClass(DatabaseTypeWrapper.class);
         databaseTypeMapping.setXPath(".");
         descriptor.addMapping(databaseTypeMapping);
View Full Code Here

     * parameter (JDBCType vs. OraclePLSQLType, simple vs. complex). The extra length parameter
     * indicates that this parameter, when used in an Anonymous PL/SQL block, requires a length.
     */
    public void addNamedArgument(String procedureParameterName, DatabaseType databaseType,
        int length) {
        DatabaseType dt = databaseType.isComplexDatabaseType() ?
            ((ComplexDatabaseType)databaseType).clone() : databaseType;
        arguments.add(new PLSQLargument(procedureParameterName, originalIndex++, IN, dt, length));
    }
View Full Code Here

     * parameters indicates that this parameter, when used in an Anonymous PL/SQL block, requires
     * scale and precision specification
     */
    public void addNamedArgument(String procedureParameterName, DatabaseType databaseType,
        int precision, int scale) {
        DatabaseType dt = databaseType.isComplexDatabaseType() ?
            ((ComplexDatabaseType)databaseType).clone() : databaseType;
        arguments.add(new PLSQLargument(procedureParameterName, originalIndex++, IN, dt, precision, scale));
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.helper.DatabaseType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.