Package org.objectweb.speedo.metadata

Examples of org.objectweb.speedo.metadata.SpeedoTable


                    SpeedoJoin join = sc.joinToExtTables[i];
                    if (join.mainTable == null) {
                        join.mainTable = sc.mainTable;
                    }
                    if (join.extTable == null) {
                        join.extTable = new SpeedoTable();
                        allocateTableName(sc, join.extTable);
                    }
                }
            }
          //visit primitive Fields first because it can contain the pk fields used
View Full Code Here


     */
    private void visitClassTable(SpeedoClass sc) throws SpeedoException {
        //check the mainTable
        if (sc.mainTable == null) {
            if (sc.inheritance == null || sc.inheritance.superClassName == null) {
                sc.mainTable = new SpeedoTable();
            } else if (sc.inheritance.isFilteredMapping()) {
                //The table is one of the parent
                sc.mainTable = getRootTable(sc.getSuper());
            } else if (sc.inheritance.isHorizontalMapping()) {
                sc.mainTable = new SpeedoTable();
            } else if (sc.inheritance.isVerticalMapping()) {
                SpeedoClass parent = sc.getSuper();
                if (sc.inheritance.join == null) {
                    sc.inheritance.join = new SpeedoJoin();
                }
                SpeedoJoin join = sc.inheritance.join;
                if (join.mainTable == null) {
                    join.mainTable = getRootTable(parent);
                }
                if (sc.mainTable == null) {
                  if (join.extTable == null) {
                      join.extTable = new SpeedoTable();
                  }
                    sc.mainTable = join.extTable;
                } else {
                    join.extTable = sc.mainTable;
                }
            } else if (sc.inheritance.strategy == SpeedoInheritance.STRATEGY_SUBCLASS_TABLE) {
                //allocate a temp table
                sc.mainTable = new SpeedoTable();
            } else {
                throw new SpeedoException("Inheritance case not managed, class: "
                        + sc.getSourceDesc());
            }
        }
View Full Code Here

                    + "' is mapped by reverse field: "
                    + rf.getFQFieldName());;
            visitSpeedoClass(rclass, new VisitRequired(rf));
            computeFieldFromReverse(sf);
        } else {
          SpeedoTable table;
          if (sf.join == null) {
              table = sf.moClass.mainTable;
          } else {
              table = sf.join.extTable;
          }
View Full Code Here

                    sf.join.extTable = rfield.join.extTable;
                    if (logger.isLoggable(BasicLevel.DEBUG)) {
                        logger.log(BasicLevel.DEBUG, "\t\t\tUse table of reverse field: " + sf.join.extTable.name);
                    }
                } else {
                    sf.join.extTable = new SpeedoTable();
                    sf.join.extTable.name = sf.moClass.name + "_" + sf.name;
                    if (logger.isLoggable(BasicLevel.DEBUG)) {
                        logger.log(BasicLevel.DEBUG, "\t\t\tDefine the join table of the relation: " + sf.join.extTable.name);
                    }
                }
                break;
            case SpeedoField.ONE_MANY_BI_RELATION:
                rfield = sf.getReverseField();
              if (rfield.join != null && rfield.join.extTable != null) {
                  sf.join.extTable = rfield.join.extTable;
                  if (logger.isLoggable(BasicLevel.DEBUG)) {
                      logger.log(BasicLevel.DEBUG, "\t\t\tUse table of reverse field: " + sf.join.extTable.name);
                  }
              } else {
                  sf.join.extTable = rfield.moClass.mainTable;
                  if (logger.isLoggable(BasicLevel.DEBUG)) {
                      logger.log(BasicLevel.DEBUG, "\tUse the table of the reference class: " + sf.join.extTable.name);
                  }
              }
              break;
            default:
              sf.join.extTable = new SpeedoTable();
            sf.join.extTable.name = sf.moClass.name + "_" + sf.name;
                if (logger.isLoggable(BasicLevel.DEBUG)) {
                    logger.log(BasicLevel.DEBUG, "\t\t\tDefine the GC table: " + sf.join.extTable.name);
                }
              break;
View Full Code Here

        }
        sf.join = new SpeedoJoin();
        sf.join.mainTable = sf.moClass.mainTable;
        //sf.moClass.addJoin(sf.join);
        if (jt != null) {
            sf.join.extTable = new SpeedoTable();
            sf.join.extTable.name = jt;
        }
        if (tfk != null && (sf.columns == null || sf.columns[0].name == null)) {
            //compute the value column(s)
            sf.columns = getFKColumn(tfk, sf.join.extTable, sf.getReferencedClass());
View Full Code Here

            logger.log(BasicLevel.WARN,
                LocaleHelper.getEJBParsingRB().getString("ejbclnotannot")
                + ((SpeedoClass) cl).getFQName());
            continue;
          }
          ((SpeedoClass) cl).mainTable = new SpeedoTable();
          ((SpeedoClass) cl).mainTable.name = "main_table_to_be_defined_later";
          ((SpeedoClass) cl).inheritance = new SpeedoInheritance();
          ((SpeedoClass) cl).inheritance.clazz = null;
          ((SpeedoClass) cl).inheritance.superClassName = null;
          Class superc = clazz.getSuperclass();
View Full Code Here

   * @param sc  The SpeedoClass under construction.
   * @param st  The SpeedoTable under construction.
   */
  private SpeedoTable parseTable(Table t, SpeedoClass sc, SpeedoTable st) {
    if (st == null) {
      st = new SpeedoTable();
    }
    if (!t.name().equals("")) {
      st.name = t.name();
    }
    if (!t.catalog().equals("")) {
View Full Code Here

                reverseField = sf.getReverseField();
              RdbClassMultiMapping trcm = (RdbClassMultiMapping) getClassMapping(
                    mapping, targetClassJMO);
              if (sf.mappedByReversefield) {
                  RdbTable tTable;
                  SpeedoTable table;
                  if (reverseField.join != null) {
                      table = reverseField.join.extTable;
                      tTable = trcm.getRdbExternalTable(table.name);
                  } else {
                      table = reverseField.moClass.mainTable;
View Full Code Here

        logger.log(BasicLevel.DEBUG, "Extension '" + se.key + "=" + se.value);
        if (se.owner instanceof SpeedoClass) {
            SpeedoClass sc = (SpeedoClass) se.owner;
            //Main table name
            if (SQL_NAME.equals(se.key)) {
                sc.mainTable = new SpeedoTable();
                sc.mainTable.name = se.value;
                sc.mainTable.catalog = null;
                sc.mainTable.schema = null;
            } else if (INHERITANCE_FILTER.equals(se.key)) {
                setDiscriminatorElement(sc, se.value);
View Full Code Here

      }
      sf.columns = null;
      sf.join = null;
      sf.mappedByReversefield = false;
    } else if (se instanceof SpeedoTable) {
      SpeedoTable st = (SpeedoTable) se;
      st.catalog = null;
      st.name = null;
      st.schema = null;
      st.join = null;
    } else if (se instanceof SpeedoJoin) {
View Full Code Here

TOP

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

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.