Package org.objectweb.jorm.metainfo.api

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


          + " 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
      // identification)
      Expression expr = new Round(new DivideBy(
View Full Code Here


        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);
    //map the created hidden field in the ClassMapping
      mb.createClassRefNameDefMapping(cm, nd, sf);
    }
View Full Code Here

        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);
    //map the created hidden field in the GenClassMapping
      mb.createClassRefNameDefMapping(gcm, nd, sf);
    }
View Full Code Here

            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

        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

    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) {
                if (pkField.columns[0].length != -1) {
                    size = pkField.columns[0].length;
                }
                if (pkField.columns[0].scale != -1) {
                    scale = pkField.columns[0].scale;
                }
            }
      // create a hidden field in the class corresponding to this
      // composite Name field. The name is based on a prefix (ClassRef name)
            String fieldName = prefix + pkField.name;
            PType type = mibh.getPrimitivePType(Type.getType(pkField.type));
      if (logger.isLoggable(BasicLevel.DEBUG)) {
        logger.log(BasicLevel.DEBUG, "\tField: name=" + fieldName
                + ", type=" + type.getJavaName());
      }
            mibh.createNameDefField(cr.getParent(), fieldName, type, size, scale);
            //define the projection between composite name fields and field used
            // in NameRef
            nr.addProjection(pkField.name, fieldName);
        }
    }
View Full Code Here

    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;
      if (logger.isLoggable(BasicLevel.DEBUG)) {
        logger.log(BasicLevel.DEBUG, "\tField: name=" + fieldName);
      }
            if (isGCId) {
                PType type = mibh.getPrimitivePType(Type.getType(pkField.type));
                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;
                    }
                }
                mibh.createNameDefField(gcr, fieldName, type, size, scale);
            }
            //define the projection between composite name fields and field used
            // in NameRef
            nr.addProjection(pkField.name, fieldName);
        }
    }
View Full Code Here

TOP

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

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.