Package org.objectweb.speedo.metadata

Examples of org.objectweb.speedo.metadata.SpeedoColumn


   
    private void checkColumn(SpeedoClass sc, SpeedoDiscriminator sd) throws SpeedoException {
        for (int i = 0; i < sd.elements.size(); i++) {
            SpeedoElement se = (SpeedoElement) sd.elements.get(i);
            if (se instanceof SpeedoNoFieldColumn) {
                SpeedoColumn col = ((SpeedoNoFieldColumn) se).column;
                SpeedoField sf = sc.getFieldFromColumn(col.name);
                if (sf != null) {
                    // the specified column correspond to a primitive persistent
                    // field. Then the SpeedoNoFieldColumn is replaced by the
                    // the found field.
View Full Code Here


            }
            if (cols.length > 1) {
                throw new SpeedoException("More than one column for the "
                        + sf.getSourceDesc());
            }
            SpeedoColumn col = cols[0];
            colName = col.name;
            colType = col.sqlType;
            //Find the table (JORM Meta object)
            if (sf.join == null) {
                t = rcm.getMainRdbTable();
View Full Code Here

                //find the pk column
                RdbPrimitiveElementMapping tpem = getPEMOfField(tclass,
                        (Mapping) rcm.getParent(),
                        (String) tndproj.get(me.getKey()));
                //find the fk column name
                SpeedoColumn fkCol = sf.getFKColumn(tpem.getName());
                //check if the fk column name is already used
                RdbPrimitiveElementMapping pem = (RdbPrimitiveElementMapping) table
                        .getPrimitiveElementMappingByCol(fkCol.name);
                if (pem == null) {
                    // create it
View Full Code Here

                //find the pk column
                RdbPrimitiveElementMapping tpem = getPEMOfField(tclass,
                        (Mapping) gcm.getParent(),
                        (String) tndproj.get(me.getKey()));
                //find the fk column name
                SpeedoColumn fkCol = sf.getFKColumn(tpem.getName());
                createPEMInGC(pe, fkCol, table, nd, (String) me.getKey());
            }
        }
    }
View Full Code Here

     */
    public PrimitiveElementMapping createGenClassIndexMapping(
            PrimitiveElement pe,
            SpeedoField sf,
            GenClassMapping gcm) throws PException, SpeedoException {
        SpeedoColumn col = null;
        if (sf.jdoTuple instanceof SpeedoCollection) {
            col = ((SpeedoCollection) sf.jdoTuple).indexColumns;
        } else if (sf.jdoTuple instanceof SpeedoMap) {
            col = ((SpeedoMap) sf.jdoTuple).keyColumns;
        }
View Full Code Here

                //get the primitive element corresponding in the Generic class
                PrimitiveElement peInGC =
                        gcr.getHiddenField(compositeFieldName);
                String classIdFieldName = (String) classNdProj.get(me.getKey());
                SpeedoField pkfield = (SpeedoField) sf.moClass.getField(classIdFieldName);
                SpeedoColumn col = sf.getJoinColumn(pkfield);
                createPEMInGC(peInGC, col, table, nd, (String) me.getKey());
            }
        }
    }
View Full Code Here

     * already done.
     */
    private void initColumnField(SpeedoField sf) {
        if (sf.columns == null || sf.columns.length == 0) {
            //
            sf.columns = new SpeedoColumn[]{ new SpeedoColumn()};
            if (sf.moClass.mainTable != null) {
                sf.columns[0].table = sf.moClass.mainTable;
            }
        }
    }
View Full Code Here

            }
        }
    }
    private SpeedoColumn initCollectionIndexColumn(SpeedoCollection sc) {
        if (sc.indexColumns == null) {
            sc.indexColumns = new SpeedoColumn();
            if (sc.moField.join != null && sc.moField.join.extTable != null) {
                sc.indexColumns.table = sc.moField.join.extTable;
            }
        }
        return sc.indexColumns;
View Full Code Here

        }
        return sc.indexColumns;
    }
    private SpeedoColumn initMapKeyColumn(SpeedoMap sm) {
        if (sm.keyColumns == null) {
            sm.keyColumns = new SpeedoColumn();
            if (sm.moField.join != null && sm.moField.join.extTable != null) {
                sm.keyColumns.table = sm.moField.join.extTable;
            }
        }
        return sm.keyColumns;
View Full Code Here

      String cn = a.name();
      if (cn.equals("")) {
        cn = "TYPE"; // Default name of the discriminator column
      }
      SpeedoNoFieldColumn snofc = new SpeedoNoFieldColumn();
      SpeedoColumn scol = sc.getColumn(cn, true);
      if (scol == null) {
        // There is no existing column: create one
        scol = new SpeedoColumn();
        scol.name = cn;
        scol.allowNull = false;
        if (! a.columnDefinition().equals("")) {
          scol.sqlType = a.columnDefinition();
        }
View Full Code Here

TOP

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

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.