Package org.objectweb.speedo.metadata

Examples of org.objectweb.speedo.metadata.SpeedoClass


            ClassMapping cm,
            MIBuilderHelper mibh,
            JormMIMappingBuilder mb) throws SpeedoException, PException {
    String lidname = mibh.getNameDefFieldPrefix(cr, false, false, sf)
      + getHiddenLidFieldName();
        SpeedoClass referencedClass = sf.moClass.getSpeedoClassFromContext(
                cr.getMOClass().getFQName());
        //get the composite name
        Manager manager = mibh.getManager(cr);
        CompositeName cn = getLongIdCompositeName(manager);
    NameRef nr = nd.createNameRef(cn);
View Full Code Here


            GenClassMapping gcm,
            MIBuilderHelper mibh,
            JormMIMappingBuilder mb) throws SpeedoException, PException {
    String lidname = mibh.getNameDefFieldPrefix(cr, false, true, sf)
      + getHiddenLidFieldName();
        SpeedoClass referencedClass = sf.moClass.getSpeedoClassFromContext(
                cr.getMOClass().getFQName());
        //get the composite name
    Manager manager = mibh.getManager(cr);
        CompositeName cn = getLongIdCompositeName(manager);
    NameRef nr = nd.createNameRef(cn);
View Full Code Here

    sb.append(NamingManagerHelper.HINTS_SEP);
    boolean isGCR = sourceMO instanceof GenClassRef;
    String binderInfo = (isGCR ? getBinderForGenClass() : getBinderForClass());
    sb.append(binderInfo);

    SpeedoClass ancestor = targetClass.getAncestor();
    String ancestorClassName;
    String pncClassName;
    if (!isGCR //For a Genclass ref or genclass identifier
      && (ancestor != null // has supper class
        || !targetClass.jormclass.getSubClasses().isEmpty()) // has sub class
      ) {
      if (ancestor == null) {
        ancestor = targetClass;
      }
      ancestorClassName = ancestor.getFQName();
      pncClassName = NamingRules.kfpncName(ancestorClassName);
    } else {
      ancestorClassName = targetClass.getFQName();
      pncClassName = binderInfo;
    }
View Full Code Here

    if (debug) {
      logger.log(BasicLevel.DEBUG,
              "CompositeUserId: Filling the identifider name def: \n\t class="
              + sc.getFQName());
    }
    SpeedoClass clazzWithIdField = sc.getAncestor();
    if (clazzWithIdField == null) {
        clazzWithIdField = sc;
    }
        List idFields = clazzWithIdField.getPKFields();
        String objectidClass = clazzWithIdField.identity.objectidClass;
        if (objectidClass == null && sc.generateObjectId()) {
            objectidClass = NamingRules.generatedObjectIdName(clazzWithIdField.getFQName());
            clazzWithIdField.identity.oidClassAutoCalculated = true;
            clazzWithIdField.identity.objectidClass = objectidClass;
        }
        Manager manager = (Manager) jc.getPackage().getParent();
        //The user has specified an object id ==> use it for the namedef
View Full Code Here

            ClassRef cr,
            SpeedoField sf,
            MIBuilderHelper mibh,
            String prefix) throws SpeedoException, PException {
        Manager manager = mibh.getManager(cr);
        SpeedoClass referencedClass = sf.moClass.getSpeedoClassFromContext(
                cr.getMOClass().getFQName());
    SpeedoClass clazzWithIdField = referencedClass.getAncestor();
    if (clazzWithIdField == null) {
        clazzWithIdField = referencedClass;
    }
        CompositeName cn = manager.getCompositeName(clazzWithIdField.identity.objectidClass);
        NameRef nr = nd.createNameRef(cn);
        List idFields = clazzWithIdField.getPKFields();
        for (int i = 0; i < idFields.size(); i++) {
            SpeedoField pkField = (SpeedoField) idFields.get(i);
            int size = PType.NOSIZE;
            int scale = PType.NOSIZE;
            if (pkField.columns != null && pkField.columns.length == 1) {
View Full Code Here

            SpeedoField sf,
            MIBuilderHelper mibh,
            boolean isGCId) throws SpeedoException, PException {
        String prefix = mibh.getNameDefFieldPrefix(gcr, isGCId, isGCId, sf);
        Manager manager = mibh.getManager(gcr);
    SpeedoClass clazzWithIdField = sf.moClass.getAncestor();
    if (clazzWithIdField == null) {
        clazzWithIdField = sf.moClass;
    }
        CompositeName cn = manager.getCompositeName(clazzWithIdField.identity.objectidClass);
        NameRef nr = nd.createNameRef(cn);
        List idFields = clazzWithIdField.getPKFields();
        for (int i = 0; i < idFields.size(); i++) {
            SpeedoField pkField = (SpeedoField) idFields.get(i);
      // create a hidden field in the class corresponding to this
      // composite Name field. The name is based on a prefix (GenClassRef name)
            String fieldName = prefix + pkField.name;
View Full Code Here

    String binderClassName = NamingRules.binderName(
      nd.getNameRef().getCompositeName().getFQName());
    sb.append(binderClassName);
    sb.append(HINTS_SEP);
    String className = targetClass.getFQName();
    SpeedoClass ancestor = targetClass.getAncestor();
    if (sourceMO instanceof GenClassRef //For a Genclass ref or identifier
      || (ancestor == null //No inheritance
        && targetClass.jormclass.getSubClasses().isEmpty())) {
      sb.append(binderClassName);
    } else {
      if (ancestor == null) {
        ancestor = targetClass;
      }
      try {
        logger.log(BasicLevel.DEBUG, "Class " + targetClass.jormclass.getFQName() + "\n"
                    + "  NamedDef " + nd.toString() + "\n"
                    + "  Filter " + ExpressionPrinter.e2str(targetClass.jormclass.getInheritanceFilter(nd)) );
        if (targetClass.jormclass.getSubClasses().isEmpty()) {
          sb.append(binderClassName);
        } else   if (targetClass.jormclass.detectFilterElementNotInPK(targetClass.jormclass.getInheritanceFilter(nd), nd)) {
          //if has child(ren)
          //and one of the fields of the filter is not in the primary key,
          //use a PolymorphicPNC
          logger.log(BasicLevel.DEBUG, "Composite PName : assign a polymorphic PNC for the class" + targetClass.jormclass.getFQName() + ".");
          sb.append(POLYMORPHIC_PNC);
        } else {
          //use a kfpnc
          logger.log(BasicLevel.DEBUG, "Composite PName : assign a KFPNC for the class" + targetClass.jormclass.getFQName() + ".");
          sb.append(NamingRules.kfpncName(ancestor.getFQName()));
        }
      } catch (Exception e) {
        logger.log(BasicLevel.ERROR, "Error while retrieving the inheritance filter of the namedef:" + nd.toString());
        throw new SpeedoException("Error while retrieving the inheritance filter of the namedef:" + nd.toString(), e);
      }
      className = ancestor.getFQName();
    }
    sb.append(HINTS_SEP);
    sb.append(className);
    result.setProperty(key, sb.toString());
    }
View Full Code Here

      //sp.jdoExtension = ?;
      //sp.name = ?;
      //sp.sequences = ?;
      //sp.xmlDescriptor = ?;
    } else if (se instanceof SpeedoClass) {
      SpeedoClass sc = (SpeedoClass) se;
      //sc.enhancementStatus = ?;
      sc.fetchGroups = new HashMap();
      sc.fields = new HashMap();
      sc.identity = new SpeedoIdentity();
      sc.versionField = null;
View Full Code Here

      //sp.jdoExtension = ?;
      sp.name = UNKNOWN;
      //sp.sequences = ?;
      sp.xmlDescriptor = null;
    } else if (se instanceof SpeedoClass) {
      SpeedoClass sc = (SpeedoClass) se;
      //sc.enhancementStatus = ?;
      sc.fetchGroups = new HashMap();
      sc.fields = new HashMap();
      sc.identity = null;
      sc.versionField = null;
View Full Code Here

                .hasNext();) {
            Object o = it.next();
            if (o instanceof ClassRef) {
                nd = getRefNameDef((ClassRef) o, sc.jormclass);
                id = JormPathHelper.getPath(((ClassRef) o));
                SpeedoClass tsc = xml.getSpeedoClass(((ClassRef) o)
                        .getMOClass().getFQName(), true);
                jormConfigs(nd, tsc, sc.jormclass, id, classProperties);
            } else if (o instanceof GenClassRef) {
                GenClassRef gcr = (GenClassRef) o;
                nd = getRefNameDef(gcr, sc.jormclass);
                id = JormPathHelper.getPath((GenClassRef) o, false);
                jormConfigs(nd, sc, gcr, id, classProperties);
                while (gcr.isGenClassRef()) {
                    gcr = gcr.getGenClassRef();
                    nd = getElemNameDef(gcr, sc.jormclass);
                    id = JormPathHelper.getPath(gcr, false);
                    jormConfigs(nd, sc, gcr, id, classProperties);
                }
                if (gcr.isClassRef()) {
                    ClassRef cr = gcr.getClassRef();
                    nd = getElemNameDef(gcr, sc.jormclass);
                    id = JormPathHelper.getPath(cr);
                    SpeedoClass tsc = xml.getSpeedoClass(cr.getMOClass()
                            .getFQName(), true);
                    jormConfigs(nd, tsc, cr, id, classProperties);
                }
            }
        }
View Full Code Here

TOP

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

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.