Package org.objectweb.speedo.metadata

Examples of org.objectweb.speedo.metadata.SpeedoMap


      sf.type = Type.getDescriptor(t);
      return;
    }
    if (Map.class.isAssignableFrom(t)) {
      // This is a Map valid type.
      sf.jdoTuple = new SpeedoMap();
      sf.jdoTuple.moField = sf;
      if (t == gt) {
        logger.log(BasicLevel.WARN, sc.getSourceDescShort()
            + ": unknown type for element of Map for field ("
            + sf.name + ").");
View Full Code Here


  public void visitField(SpeedoField sf) throws SpeedoException {
    super.visitField(sf);

    if (sf.jdoTuple instanceof SpeedoMap) {
      SpeedoMap sm = (SpeedoMap) sf.jdoTuple;
      sm.keyType = toJavaFQN((String) sm.keyType);
      sm.valueType = toJavaFQN((String) sm.valueType);
    } else if (sf.jdoTuple instanceof SpeedoCollection) {
      SpeedoCollection sc = (SpeedoCollection) sf.jdoTuple;
      sc.elementType = toJavaFQN((String) sc.elementType);
View Full Code Here

    SpeedoField keyfield = sf.getFieldOfTheReferencedClass(se.value);
    if (keyfield == null) {
      throw new SpeedoException("No key field '" + se.value
                    + "' found for the" + sf.getSourceDesc());
    }
    SpeedoMap sm = (SpeedoMap) sf.jdoTuple;
    if (sm.keyType != null && ((String) sm.keyType).length() > 0) {
      //check the key field type and the
      if (keyfield.type().equalsIgnoreCase((String) sm.keyType)) {
                throw new SpeedoException("Bad type for the key field '" + se.value
                        + "' found for the" + sf.getSourceDesc());
View Full Code Here

                            "\t\t\tCreate column for the list index"
                        + collec.indexColumns.toString());
                }
            }
        } else if (sf.jdoTuple instanceof SpeedoMap) {
            SpeedoMap map = (SpeedoMap) sf.jdoTuple;
            if (map.keyColumns == null) {
                map.keyColumns = new SpeedoColumn("idx", sf.join.extTable);
                if (logger.isLoggable(BasicLevel.DEBUG)) {
                    logger.log(BasicLevel.DEBUG, "\t\t\tCreate column for the map key"
                        + map.keyColumns.toString());
View Full Code Here

        }
        return isSubType(c1.getSuperclass(), c2);
    }

    private PType getMapKeyPType(SpeedoField sf) throws SpeedoException {
        SpeedoMap sm = (SpeedoMap) sf.jdoTuple;
        if (sm.keyType == null) {
            throw new SpeedoException(
                "It is required to define a key-type for the Map field'"
                + sf.name + "' of the class '" + sf.moClass.getFQName() +"' ");
        }
View Full Code Here

      sc.elementType = null;
      sc.embeddedElement = false;
      sc.indexColumns = null;
      sc.moField = null;
    } else if (se instanceof SpeedoMap) {
      SpeedoMap sm = (SpeedoMap) se;
      sm.embeddedKey = false;
      sm.embeddedValue = false;
      sm.keyColumns = null;
      sm.keyType = null;
      sm.moField = null;
View Full Code Here

      sc.elementType = null;
      sc.embeddedElement = false;
      sc.indexColumns = null;
      sc.moField = null;
    } else if (se instanceof SpeedoMap) {
      SpeedoMap sm = (SpeedoMap) se;
      sm.embeddedKey = false;
      sm.embeddedValue = false;
      sm.keyColumns = null;
      sm.keyType = null;
      sm.moField = null;
View Full Code Here

            }
            moClass.add(f, true, logger);
        } //else it is an inherited field already attached to moClass.inheritance
    }
    private void treatMapField(FieldContext fc) throws SpeedoException {
        SpeedoMap m = (SpeedoMap) fc.field.jdoTuple;
        if (m == null) {
            m = new SpeedoMap();
        }
        fc.field.jdoTuple = m;
        m.moField = (SpeedoField) fc.field;
        List l = (List) fc.fieldChildren.get("map");
        if (l != null) {
View Full Code Here

        }
        return f;
    }
    private Object treatMap(Node node, Object mo) throws SpeedoException {
        SpeedoField f = (SpeedoField) mo;
        SpeedoMap m = (SpeedoMap) f.jdoTuple;
        if (m == null) {
            m = new SpeedoMap();
        }
        f.jdoTuple = m;
        m.moField = f;

        //attribut key-type
View Full Code Here

        if (!(f.jdoTuple instanceof SpeedoMap)) {
            throw new SpeedoException(
                    "key element must be used for map field only: "
                    + f.getSourceDesc());
        }
        SpeedoMap m = (SpeedoMap) f.jdoTuple;
        if (col != null) {
            m.keyColumns = col;
        }
        return m;
    }
View Full Code Here

TOP

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

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.