Package org.jitterbit.integration.data.structure

Examples of org.jitterbit.integration.data.structure.DatabaseStructure


    public boolean hasPreviousPage(WizardPage page) {
        return page != startPage;
    }

    public DatabaseStructure getDefinedStructure() {
        DatabaseStructure s = new DatabaseStructure();
        for (WizardPage page : pages) {
            ((DatabaseStructureWizardPage) page).applyTo(s);
        }
        if (database != null) {
            s.setDbLocation((DatabaseLocation) database.getLocation());
            if (database instanceof Source) {
                s.setSourceId((SourceId) database.getID());
            } else {
                s.setTargetId((TargetId) database.getID());
            }
        }
        return s;
    }
View Full Code Here


    }

    public void applyToEditedTransformation() throws WizardPageException {
        checkState(toEdit != null, "This wizard is not editing an existing transformation");
        Transformation tf = toEdit.getTransformation();
        DatabaseStructure struct = getDefinedStructure();
        if (sourceTarget == SourceTarget.Source) {
            tf.setInputStructure(struct);
            tf.setSourceId(struct.getSourceId());
        } else {
            tf.setOutputStructure(struct);
            tf.setTargetId(struct.getTargetId());
            applyInsertMode(tf);
        }
    }
View Full Code Here

    private boolean isApplicable() {
        Transformation tf = page.getObject();
        DataStructure input = tf.getInputStructure();
        if (input instanceof DatabaseStructure) {
            DatabaseStructure s = (DatabaseStructure) input;
            return !s.hasManualSqlStatement();
        }
        return false;
    }
View Full Code Here

        }
        return objs;
    }

    private void setInitialUsageCount(SelectedTables selectedObjects) {
        DatabaseStructure dbStruct = toEdit.getStructure();
        if (dbStruct.hasDatabaseObjectInformation()) {
            updateTableUsageFields(dbStruct, selectedObjects);
        } else {
            // For transformations created in versions 1.3.0.37 or earlier, the table
            // usage is not stored explicitly in the DatabaseStructure. We need to derive
            // it from the list of tables:
View Full Code Here

        }
        return wizard;
    }

    private StructureToEdit getStructureToEdit() {
        DatabaseStructure dbStruct = getDatabaseStructure();
        if (dbStruct.hasDatabaseObjectInformation()) {
            return deriveStructureToEditFromExistingData(dbStruct);
        } else {
            // For transformations that have been downloaded from a jitterbit server,
            // and for transformation created in versions < 1.3.0.37, the transformation
            // object does not contain detailed information about the tables and columns
View Full Code Here

            this.treeMapper = mapper;
        }

        @Override
        public final TransformationDatabaseInfo createInfo() {
            DatabaseStructure data = getDataStructure(treeMapper.getTransformation());
            if (data != null) {
                return new StructureImpl(data, getObjects(data));
            }
            return null;
        }
View Full Code Here

    public static WhereClauseEditorUi createEditorUi(TransformationDatabaseInfo info) {
        // XXX: We currently do not store table and column information in the
        //      DatabaseStructure class, so we need to send in the db objects
        //      separately. This will change with the upcoming new structure
        //      implementation.
        DatabaseStructure structure = info.getStructure();
        DatabaseObject[] objects = info.getDatabaseObjects();
        switch (objects.length) {
        case 0:
            return null;
        case 1:
            SqlScript existingScript = structure.getSqlScript();
            String existingWhereClause = (existingScript == null) ? "" :
                            existingScript.getWhereClause();
            BeginEndQuote quotes = structure.getBeginEndQuote();
            return new SingleTableEditorUi(objects[0], existingWhereClause, quotes);
        default:
            DbTranFilters filters = structure.getHierarchicalFilters();
            return new MultipleTableEditorUi(objects, filters);
        }
    }
View Full Code Here

        @Override
        public void applyTo(Transformation tf) {
            DataStructure struct = tf.getInputStructure();
            if (struct instanceof DatabaseStructure) {
                DatabaseStructure dbStruct = (DatabaseStructure) struct;
                SqlScript script = dbStruct.getSqlScript();
                script.updateWhereClause(ui.getWhereClause());
                dbStruct.setSqlScript(script);
            }
        }
View Full Code Here

        @Override
        public void applyTo(Transformation tf) {
            DataStructure struct = tf.getInputStructure();
            if (struct instanceof DatabaseStructure) {
                DatabaseStructure dbStruct = (DatabaseStructure) struct;
                dbStruct.setHierarchicalFilters(ui.getDefinedFilters());
            }
        }
View Full Code Here

        return page;
    }

    @Override
    public void setStructureToEdit(StructureToEdit toEdit) {
        DatabaseStructure struct = toEdit.getStructure();
        List<TableRelationship> rels = struct.getRelations().getTableRelationships(tables);
        for (TableRelationship r : rels) {
            relations.add(r);
        }
        ui.relationsChanged();
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.data.structure.DatabaseStructure

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.