Examples of PLSQLrecord


Examples of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord

               
                if (typeMetadata != null) {
                    return typeMetadata.process();
                }
               
                PLSQLrecord record = new PLSQLrecord();
                record.setTypeName(type);
                return record;
            }
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord

    /**
     * INTERNAL:
     * Build a runtime record type from the meta-data.
     */
    public PLSQLrecord process() {
        PLSQLrecord record = new PLSQLrecord();
        super.process(record);
       
        for (PLSQLParameterMetadata field : this.fields) {
            PLSQLargument argument = new PLSQLargument();
            argument.name = field.getName();
            argument.databaseType = getDatabaseTypeEnum(field.getDatabaseType());
           
            if (field.getLength() != null) {
                argument.length = field.getLength();
            }
           
            if (field.getPrecision() != null) {
                argument.precision = field.getPrecision();
            }
           
            if (field.getScale() != null) {
                argument.scale = field.getScale();
            }
           
            record.addField(argument);
        }
       
        return record;
    }
View Full Code Here

Examples of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord

        }
    }

    @Override
    public void beginPlsqlRecord(String plsqlRecordName, String targetTypeName, int numFields) {
        PLSQLrecord plsqlRecord = null;
        boolean found = false;
        for (DatabaseType[] databaseTypes : methodTypeMap.values()) {
            if (found) {
                break;
            }
            for (int i = 0, len = databaseTypes.length; i < len; i++) {
                DatabaseType databaseType = databaseTypes[i];
                if (databaseType != null && databaseType.isComplexDatabaseType()) {
                    ComplexDatabaseType cdt = (ComplexDatabaseType)databaseType;
                    if (cdt.isRecord()) {
                        PLSQLrecord tmp = (PLSQLrecord)cdt;
                        if (tmp.getCompatibleType().equalsIgnoreCase(targetTypeName)) {
                            found = true;
                            plsqlRecord = tmp;
                            break;
                        }
                    }
                }
            }
        }
        if (plsqlRecord == null) {
            plsqlRecord = new PLSQLrecord();
            plsqlRecord.setTypeName(trimOffSchemaName(plsqlRecordName));
            plsqlRecord.setCompatibleType(targetTypeName);
            plsqlRecord.setJavaTypeName(plsqlRecord.getTypeName().toLowerCase());
            putKnownDatabaseType(plsqlRecordName, plsqlRecord);
        }
View Full Code Here

Examples of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord

        typeStack.push(plsqlRecord);
    }

    @Override
    public void beginPlsqlRecordField(String fieldName, int idx) {
        PLSQLrecord plsqlRecord = (PLSQLrecord)typeStack.peek();
        boolean found = false;
        for (PLSQLargument arg : plsqlRecord.getFields()) {
            if (arg.name.equalsIgnoreCase(fieldName)) {
                found = true;
                break;
            }
        }
        if (!found) {
            plsqlRecord.addField(fieldName, null);
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord

    public void endPlsqlRecord(String plsqlRecordName, String typeDeclaration, String typeDropDDL) {
        if (!"".equals(typeDeclaration)) {
            dbwsBuilder.getTypeDDL().add(typeDeclaration);
            dbwsBuilder.getTypeDropDDL().add(typeDropDDL);
        }
        PLSQLrecord plsqlRecord = (PLSQLrecord)typeStack.pop();
        if (!typeStack.empty()) {
            DatabaseType top = typeStack.peek();
            if (top.isComplexDatabaseType()) {
                ComplexDatabaseType cdt = (ComplexDatabaseType)top;
                if (cdt.isCollection()) {
                    PLSQLCollection coll = (PLSQLCollection)cdt;
                    if (coll.getNestedType() == null) {
                        coll.setNestedType(plsqlRecord);
                    }
                }
                else if (cdt.isRecord()) {
                    PLSQLrecord rec = (PLSQLrecord)cdt;
                    List<PLSQLargument> fields = rec.getFields();
                    PLSQLargument arg = fields.get(fields.size() - 1);
                    if (arg.databaseType == null) {
                        arg.databaseType = plsqlRecord;
                    }
                }
View Full Code Here

Examples of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord

                        }
                    }
                }
                else {
                    if (cdt.isRecord()) {
                        PLSQLrecord rec = (PLSQLrecord)cdt;
                        List<PLSQLargument> fields = rec.getFields();
                        PLSQLargument arg = fields.get(fields.size() - 1);
                        if (arg.databaseType == null) {
                            arg.databaseType = databaseType;
                        }
                    }
View Full Code Here

Examples of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord

                    if (coll.getNestedType() == null) {
                        coll.setNestedType(databaseType);
                    }
                }
                else if (cdt.isRecord()) {
                    PLSQLrecord rec = (PLSQLrecord)cdt;
                    List<PLSQLargument> fields = rec.getFields();
                    PLSQLargument arg = fields.get(fields.size() - 1);
                    if (arg.databaseType == null) {
                        arg.databaseType = databaseType;
                    }
                }
                else if (cdt.isJDBCType()) {
                    if (typeStack.size() > 1) {
                        typeStack.pop();
                        DatabaseType topMinus1 = typeStack.peek();
                        if (topMinus1.isComplexDatabaseType()) {
                            ComplexDatabaseType cdtMinus1 = (ComplexDatabaseType)topMinus1;
                            if (cdtMinus1.isRecord()) {
                                PLSQLrecord rec = (PLSQLrecord)cdtMinus1;
                                List<PLSQLargument> fields = rec.getFields();
                                PLSQLargument arg = fields.get(fields.size() - 1);
                                if (arg.databaseType == null) {
                                    arg.databaseType = cdt;
                                }
                            }
View Full Code Here

Examples of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord

                    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();) {
                                    arg = i.next();
                                    if (arg.name.equalsIgnoreCase(fieldName)) {
                                        break;
                                    }
                                }
View Full Code Here

Examples of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord

            } catch (Exception alsoInvalid) {
                PLSQLComplexTypeMetadata typeMetadata = project.getPLSQLComplexType(type);
                if (typeMetadata != null) {
                    return typeMetadata.process(project);
                }
                PLSQLrecord record = new PLSQLrecord();
                record.setTypeName(type);
                return record;
            }
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord

   
    /**
     * Build a runtime record type from the meta-data.
     */
    public PLSQLrecord process(MetadataProject project) {
        PLSQLrecord record = new PLSQLrecord();
        super.process(record, project);
        for (PLSQLParameterMetadata field : this.fields) {
            PLSQLargument argument = new PLSQLargument();
            argument.name = field.getName();
            argument.databaseType = field.getDatabaseTypeEnum(field.getDatabaseType(), project);
            if (field.getLength() != null) {
                argument.length = field.getLength();
            }
            if (field.getPrecision() != null) {
                argument.precision = field.getPrecision();
            }
            if (field.getScale() != null) {
                argument.scale = field.getScale();
            }
            record.addField(argument);
        }
        return record;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.