Package org.objectweb.speedo.metadata

Examples of org.objectweb.speedo.metadata.SpeedoJoinColumn


    sc.inheritance.join = new SpeedoJoin();
    sc.inheritance.join.mainTable = sc.mainTable;
    sc.inheritance.join.extTable = sc.getSuper().mainTable;
    // First parse PrimaryKeyJoinColumn
    if (a1 != null) {
      SpeedoJoinColumn jcol = new SpeedoJoinColumn();
      jcol.column = sc.getColumn(a1.name(), true);
      if (jcol.column == null) {
        nbErrors++;
        logger.log(BasicLevel.ERROR, sc.getSourceDescShort()
            + ": inheritance join define with a column that does not exist - ("
            + a1.name() + ") not found!");
        return;
      }
      if (a1.referencedColumnName().equals("")) {
        nbErrors++;
        logger.log(BasicLevel.ERROR, sc.getSourceDescShort()
            + ": inheritance join define with no column associated in superclass!");
        return;
      }
      jcol.targetColumn = a1.referencedColumnName();
      sc.inheritance.join.columns.add(jcol);
      return;
    }
    // Now parse PrimaryKeyJoinColumns: the PrimaryKeyJoinColmun from the "pkjcs" array
    for (PrimaryKeyJoinColumn pkjc : a2.value()) {
      SpeedoJoinColumn jcol = new SpeedoJoinColumn();
      jcol.column = sc.getColumn(pkjc.name(), true);
      if (jcol.column == null) {
        nbErrors++;
        logger.log(BasicLevel.ERROR, sc.getSourceDescShort()
            + ": inheritance join define with a column that does not exist - ("
View Full Code Here


    sf.join = new SpeedoJoin();
    /*TODO sf.join.extTable = parseTable(jt.table(), sc, null);*/
    sf.join.mainTable = sc.mainTable;
    // Parse joinColumns from JoinTable (may be empty)
    for (JoinColumn jc : jt.joinColumns()) {
      SpeedoJoinColumn sjcol = new SpeedoJoinColumn();
      sjcol.column = new SpeedoColumn();
      if (jc.referencedColumnName().equals("")) {
        if (jc.name().equals("")) {
          nbErrors++;
          logger.log(BasicLevel.ERROR, sc.getSourceDescShort()
View Full Code Here

      }
      if (!st.schema().equals("")) {
        sj.extTable.schema = st.schema();
      }
      for (PrimaryKeyJoinColumn jc : st.pkJoinColumns()) {
        SpeedoJoinColumn sjc = new SpeedoJoinColumn();
        // Parse the colum name within the secondary table under definition
        if (jc.name().equals("")) {
          nbErrors++;
          logger.log(BasicLevel.ERROR, sc.getSourceDescShort()
              + ": try to define the secondary table ("
View Full Code Here

                            + sc.joinToExtTables[i].extTable.name
                            + "' for the class '" + sc.getFQName() + "'.");
                }
                for (Iterator it = sc.joinToExtTables[i].columns.iterator(); it
                        .hasNext();) {
                    SpeedoJoinColumn jc = (SpeedoJoinColumn) it.next();
                    join.addJoinColumnNames(jc.targetColumn,
                            jc.column.name);
                    if (debug) {
                        logger.log(BasicLevel.DEBUG,
                                "\tdefine join between columns '"
View Full Code Here

        //Define the join to the external table
        RdbJoin j = exttable.createRdbJoin(sf.name);
        for (Iterator fkColIt = sf.join.columns.iterator(); fkColIt
                .hasNext();) {
            SpeedoJoinColumn jc = (SpeedoJoinColumn) fkColIt.next();
            j.addJoinColumnNames(jc.targetColumn, jc.column.name);
        }
        // map the name def over pk field of the referenced class
        if (tnd.isFieldName()) {
            RdbPrimitiveElementMapping pem = (RdbPrimitiveElementMapping) trcm
View Full Code Here

        GenClassRef gcr = (GenClassRef) nd.getParent();
        RdbGenClassMapping rgcm = (RdbGenClassMapping) gcm;
        RdbTable table = rgcm.getRdbTable();
        if (nd.isFieldName()) {
            PrimitiveElement pe = gcr.getHiddenField(nd.getFieldName());
            SpeedoJoinColumn col = (SpeedoJoinColumn) sf.join.columns.get(0);
            createPEMInGC(pe, col.column, table, nd, null);
        } else {
            //get the ClassMapping of class owning the generic class
            RdbClassMultiMapping rcmOwner = (RdbClassMultiMapping) sf.moClass.jormclass
                    .getClassProject(rgcm.getProjectName()).getMapping(
View Full Code Here

            //create new JoinColumn to the pk column of the class
            join.columns.addAll(getFKJoinColumn(sc, "FK_", join.extTable));
        } else {
            int size = join.columns.size();
            for (Iterator it = join.columns.iterator(); it.hasNext();) {
                SpeedoJoinColumn jc = (SpeedoJoinColumn) it.next();
                if (jc.targetColumn == null) {
                    if (jc.targetField == null) {
                        if (size == 1) {
                            SpeedoColumn[] cols = getIdColumns(sc);
                            if (cols.length > 1) {
View Full Code Here

            sf.join.extTable = rField.join.extTable;
            //compute the sf.column from the pk column of the referenced class
            sf.columns = new SpeedoColumn[rField.join.columns.size()];
            int i = 0;
            for (Iterator jcolIt = rField.join.columns.iterator(); jcolIt.hasNext();) {
                SpeedoJoinColumn jcol = (SpeedoJoinColumn) jcolIt.next();
                sf.columns[i] = (SpeedoColumn) jcol.column.clone();
                sf.columns[i].targetColumn = jcol.targetColumn;
                sf.columns[i].targetField = jcol.targetField;
                i++;
            }
        }
        //compute the join
        sf.join.columns.clear();
        for (int i = 0; i < rField.columns.length; i++) {
            sf.join.columns.add(new SpeedoJoinColumn(rField.columns[i]));
        }
    }
View Full Code Here

            String colPrefix,
            SpeedoTable table) {
        SpeedoColumn[] fkCols = getFKColumn(rclass, colPrefix, table);
        ArrayList res = new ArrayList(fkCols.length);
        for (int i = 0; i < fkCols.length; i++) {
            res.add(new SpeedoJoinColumn(fkCols[i]));
        }
        return res;
    }
View Full Code Here

            if (logger.isLoggable(BasicLevel.DEBUG)) {
                logger.log(BasicLevel.DEBUG, "\t\t\tDefine the join column: \n" + sf.join.columns);
            }
        } else {
            for (Iterator it = sf.join.columns.iterator(); it.hasNext();) {
                SpeedoJoinColumn jc = (SpeedoJoinColumn) it.next();
                if (jc.targetColumn == null) {
                    computeTargetJoinColumn(sf, jc);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.metadata.SpeedoJoinColumn

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.