Package org.objectweb.jorm.metainfo.api

Examples of org.objectweb.jorm.metainfo.api.CompositeName


            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
        CompositeName cn = manager.getCompositeName(objectidClass);
        boolean cnNotDefined = (cn == null);
        if (cnNotDefined) {
      if (debug) {
        logger.log(BasicLevel.DEBUG, "\tCreate the composite name " + objectidClass);
      }
            cn = manager.createCompositeName(objectidClass);
            createdMOs.add(cn);
        }
        NameRef nr = nd.createNameRef(cn);
        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) {
                if (pkField.columns[0].length != -1) {
                    size = pkField.columns[0].length;
                }
                if (pkField.columns[0].scale!= -1) {
                    scale = pkField.columns[0].scale;
                }
            }
            if (cnNotDefined) {
                cn.createCompositeNameField(pkField.name,
                        mibh.getPrimitivePType(Type.getType(pkField.type)),
                        size, scale);
            }
            nr.addProjection(pkField.name, pkField.name);
        }
View Full Code Here


                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;
View Full Code Here

        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
View Full Code Here

          mibh.getErrorMessage(sc, sc.jormclass, null)
          + " Impossible to get the field '" + lidname + "'");
      }
    }
        Manager manager = mibh.getManager(jc);
        CompositeName cn = getLongIdCompositeName(manager);
    NameRef nr = nd.createNameRef(cn);
    nr.addProjection(getLongIdLid(), lid.getName());
    if (sc.jormclass.getSuperClasses().isEmpty()) {
      // define the inheritance filter permiting to determine the class
      // since an identifier (some bits are reserved for class
View Full Code Here

      + 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);
    //create the hidden field
    mibh.createNameDefField(cr.getParent(), lidname, getFieldType());
    //define translation betwen the composite name field and the hidden field
    nr.addProjection(getLongIdLid(), lidname);
View Full Code Here

      + 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);
    //create the hidden field
    mibh.createNameDefField(cr.getParent(), lidname, getFieldType());
    //define translation betwen the composite name field and the hidden field
    nr.addProjection(getLongIdLid(), lidname);
View Full Code Here

        }
    //Gen class reference is based on basid
    nd.setFieldName(fn);
    }
  private CompositeName getLongIdCompositeName(Manager manager) {
    CompositeName cn = manager.getCompositeName(getLongIdName());
    if (cn == null) {
      cn = manager.createCompositeName(getLongIdName());
      ScalarField cnf = cn.createCompositeNameField(
        getLongIdLid(), getFieldType(), PType.NOSIZE, PType.NOSIZE);
      cnf.setIsAutoCalculated(true);
    }
    return cn;
  }
View Full Code Here

            MIBuilderHelper mibh,
            String prefix) throws SpeedoException, PException{
        PrimitiveElement oid = mibh.createNameDefField(owner, prefix + OID, PTypeSpace.LONG);
        PrimitiveElement cid = mibh.createNameDefField(owner, prefix + CID, PTypeSpace.LONG);
        Manager manager = mibh.getManager(owner);
        CompositeName speedoidcn = getPolymorphIdCN(manager);
        NameRef nr = nd.createNameRef(speedoidcn);
        nr.addProjection(POLYMORH_ID_OID, oid.getName());
        nr.addProjection(POLYMORH_ID_CID, cid.getName());
    }
View Full Code Here

      throws SpeedoException {
        return false;
    }

    private CompositeName getPolymorphIdCN(Manager manager) {
        CompositeName cn = manager.getCompositeName(POLYMORH_ID_NAME);
        if (cn == null) {
            cn = manager.createCompositeName(POLYMORH_ID_NAME);
            cn.createCompositeNameField(POLYMORH_ID_CID, PTypeSpace.LONG, PType.NOSIZE, PType.NOSIZE);
            cn.createCompositeNameField(POLYMORH_ID_OID, PTypeSpace.LONG, PType.NOSIZE, PType.NOSIZE);
        }
        return cn;
    }
View Full Code Here

TOP

Related Classes of org.objectweb.jorm.metainfo.api.CompositeName

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.