Package org.netbeans.modules.dbschema

Examples of org.netbeans.modules.dbschema.ColumnPairElement


        ArrayList foreignColumns = new ArrayList();

        // We need to go through each local column and extract the foreign column.
        if ((assocPairs == null) || (assocPairs.size() == 0)) {
            for (int i = 0; i < pairs.size(); i++) {
                ColumnPairElement fce = (ColumnPairElement) pairs.get(i);
                localColumns.add(fce.getLocalColumn());
                foreignColumns.add(fce.getReferencedColumn());
            }

            ff.localColumns = localColumns;
            ff.foreignColumns = foreignColumns;
        } else {
            ArrayList assocLocalColumns = new ArrayList();
            ArrayList assocForeignColumns = new ArrayList();

            for (int i = 0; i < pairs.size(); i++) {
                ColumnPairElement alc = (ColumnPairElement) pairs.get(i);
                localColumns.add(alc.getLocalColumn());
                assocLocalColumns.add(alc.getReferencedColumn());
            }

            for (int i = 0; i < assocPairs.size(); i++) {
                ColumnPairElement afc = (ColumnPairElement) assocPairs.get(i);
                assocForeignColumns.add(afc.getLocalColumn());
                foreignColumns.add(afc.getReferencedColumn());
            }

            ff.localColumns = localColumns;
            ff.assocLocalColumns = assocLocalColumns;
            ff.assocForeignColumns = assocForeignColumns;
View Full Code Here


        }
    }

    private void createSecondaryTableKey(TableDesc table, MappingReferenceKeyElementImpl mappingSecondaryKey) {

        ColumnPairElement pairs[] = mappingSecondaryKey.getColumnPairs();
        KeyDesc referencingKey = new KeyDesc();
        KeyDesc referencedKey = new KeyDesc();
        TableDesc secondaryTable = findTableDesc(((MappingTableElementImpl) mappingSecondaryKey.getTable()).getTableObject());

        for (int i = 0; i < pairs.length; i++) {
            ColumnPairElement pair = pairs[i];

            ColumnElement lc = pair.getLocalColumn();
            ColumnElement fc = pair.getReferencedColumn();

            referencingKey.addColumn(lc);

            FieldDesc lf = getLocalFieldDesc(lc);
            referencingKey.addField(lf);
View Full Code Here

          if (colCount > 0)
          {
            println(tabs+1, "--> columnsObjects ")//NOI18N
            for (int j = 0; j < colCount; j++)
            {
              ColumnPairElement fce = (ColumnPairElement) columnObjects.get(j);
              ColumnElement rce = (fce!=null)?fce.getReferencedColumn():null;
              println(tabs+1, "[" + j + "] " + fce + " -> " + rce)//NOI18N
            }
            println(tabs+1, "<-- columnsObjects ")//NOI18N
          }
         
          println(tabs+1, "associatedColumns = " + mre.getAssociatedColumns())//NOI18N

          ArrayList associatedColumnObjects = mre.getAssociatedColumnObjects();
          colCount = ((associatedColumnObjects != null) ?
            associatedColumnObjects.size() : 0);
          if (colCount > 0)
          {
            println(tabs+1, "--> associatedColumnObjects ")//NOI18N
            for (int j = 0; j < colCount; j++)
            {
              ColumnPairElement fce = (ColumnPairElement) associatedColumnObjects.get(j);
              ColumnElement rce = (fce!=null)?fce.getReferencedColumn():null;
              println(tabs+1, "[" + j + "] " + fce + " -> " + rce)//NOI18N
            }
            println(tabs+1, "<-- associatedColumnObjects ")//NOI18N
          }
        }
View Full Code Here

          if (colCount > 0)
          {
            println(tabs+1, "--> columnsObjects ")//NOI18N
            for (int j = 0; j < colCount; j++)
            {
              ColumnPairElement fce = (ColumnPairElement) columnObjects.get(j);
              ColumnElement rce = (fce!=null)?fce.getReferencedColumn():null;
              println(tabs+1, "[" + j + "] " + fce + " -> " + rce)//NOI18N
            }
            println(tabs+1, "<-- columnsObjects ")//NOI18N
          }
         
          println(tabs+1, "associatedColumns = " + mre.getAssociatedColumns())//NOI18N

          ArrayList associatedColumnObjects = mre.getAssociatedColumnObjects();
          colCount = ((associatedColumnObjects != null) ?
            associatedColumnObjects.size() : 0);
          if (colCount > 0)
          {
            println(tabs+1, "--> associatedColumnObjects ")//NOI18N
            for (int j = 0; j < colCount; j++)
            {
              ColumnPairElement fce = (ColumnPairElement) associatedColumnObjects.get(j);
              ColumnElement rce = (fce!=null)?fce.getReferencedColumn():null;
              println(tabs+1, "[" + j + "] " + fce + " -> " + rce)//NOI18N
            }
            println(tabs+1, "<-- associatedColumnObjects ")//NOI18N
          }
        }
View Full Code Here

        ArrayList foreignColumns = new ArrayList();

        // We need to go through each local column and extract the foreign column.
        if ((assocPairs == null) || (assocPairs.size() == 0)) {
            for (int i = 0; i < pairs.size(); i++) {
                ColumnPairElement fce = (ColumnPairElement) pairs.get(i);
                localColumns.add(fce.getLocalColumn());
                foreignColumns.add(fce.getReferencedColumn());
            }

            ff.localColumns = localColumns;
            ff.foreignColumns = foreignColumns;
        } else {
            ArrayList assocLocalColumns = new ArrayList();
            ArrayList assocForeignColumns = new ArrayList();

            for (int i = 0; i < pairs.size(); i++) {
                ColumnPairElement alc = (ColumnPairElement) pairs.get(i);
                localColumns.add(alc.getLocalColumn());
                assocLocalColumns.add(alc.getReferencedColumn());
            }

            for (int i = 0; i < assocPairs.size(); i++) {
                ColumnPairElement afc = (ColumnPairElement) assocPairs.get(i);
                assocForeignColumns.add(afc.getLocalColumn());
                foreignColumns.add(afc.getReferencedColumn());
            }

            ff.localColumns = localColumns;
            ff.assocLocalColumns = assocLocalColumns;
            ff.assocForeignColumns = assocForeignColumns;
View Full Code Here

        }
    }

    private void createSecondaryTableKey(TableDesc table, MappingReferenceKeyElementImpl mappingSecondaryKey) {

        ColumnPairElement pairs[] = mappingSecondaryKey.getColumnPairs();
        KeyDesc referencingKey = new KeyDesc();
        KeyDesc referencedKey = new KeyDesc();
        TableDesc secondaryTable = findTableDesc(((MappingTableElementImpl) mappingSecondaryKey.getTable()).getTableObject());

        for (int i = 0; i < pairs.length; i++) {
            ColumnPairElement pair = pairs[i];

            ColumnElement lc = pair.getLocalColumn();
            ColumnElement fc = pair.getReferencedColumn();

            referencingKey.addColumn(lc);

            FieldDesc lf = getLocalFieldDesc(lc);
            referencingKey.addField(lf);
View Full Code Here

TOP

Related Classes of org.netbeans.modules.dbschema.ColumnPairElement

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.