Package org.objectweb.speedo.metadata

Examples of org.objectweb.speedo.metadata.SpeedoField


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


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

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

      sc.name = UNKNOWN;
      sc.name2query = new HashMap();
      //sc.noArgConstructorStatus = ?;
      //sc.version = ?;
    } else if (se instanceof SpeedoField) {
      SpeedoField sf = (SpeedoField) se;
      sf.name = null;
      //sf.visibility = ?;
      sf.propagate = SpeedoField.PROPAG_NONE;
      sf.type = null;
      sf.number = -1;
View Full Code Here

        Collection fields = gc.sc.fields.values();
        cv.visitIntInsn(BIPUSH, fields.size());
        cv.visitTypeInsn(ANEWARRAY, "java/lang/String");
        int idx = 0;
        for(Iterator it = fields.iterator(); it.hasNext();) {
            SpeedoField sf = (SpeedoField) it.next();
            cv.visitInsn(DUP);
            Util.visitIntConstant(cv, idx);
            cv.visitLdcInsn(sf.name);
            cv.visitInsn(AASTORE);
            idx ++;
View Full Code Here

        int idx = 0;
        for(Iterator it = fields.iterator(); it.hasNext();) {
            cv.visitInsn(DUP);
            Util.visitIntConstant(cv, idx);
            idx ++;
            SpeedoField sf = (SpeedoField) it.next();
            Type t = Type.getType(sf.type);
            switch (t.getSort()) {
            case Type.BOOLEAN:
                cv.visitFieldInsn(GETSTATIC, "java/lang/Boolean", fieldType, gc.classJT);
                break;
View Full Code Here

        {
            for (int ucIdx = 0; ucIdx < gc.userCacheNames.length; ucIdx++) {
                String ucn = gc.userCacheNames[ucIdx];
                List fields = (List) gc.ucn2sfs.get(ucn);
                for(Iterator itf = fields.iterator(); itf.hasNext();) {
                    SpeedoField sf = (SpeedoField) itf.next();
                    //if ((fields[${f.jormFieldIdLongPos}] & ${f.jormFieldId}L) != 0) {
                    cv.visitVarInsn(ALOAD, 2);
                    Util.visitIntConstant(cv, sf.number / 64);
                    cv.visitInsn(LALOAD);
                    Util.visitLongConstant(cv, 1L << (sf.number % 64));
View Full Code Here

                // new String[]{"f1", "f2"}
                final List fields = (List) gc.ucn2sfs.get(ucn);
                Util.visitIntConstant(cv, fields.size()); //Array size
                cv.visitTypeInsn(ANEWARRAY, "java/lang/String");
                for (int fieldIdx = 0; fieldIdx < fields.size(); fieldIdx++) {
                    SpeedoField sf = (SpeedoField) fields.get(fieldIdx);
                    cv.visitInsn(DUP);
                    Util.visitIntConstant(cv, fieldIdx); //index
                    cv.visitLdcInsn(sf.name); //value = field name
                    cv.visitInsn(AASTORE);
                }
View Full Code Here

        }
        ((SpeedoClass) mo).identity = ident;
        return ident;
    }
    private Object treatFieldNode(Node node, Object mo) throws SpeedoException {
        SpeedoField f = new SpeedoField();
    Node n = null;

        //attribut name (compulsory)
        n = node.getAttributes().getNamedItem("name");
        if (n == null)
            throw new SpeedoXMLError("Attribute name for tag field requested.");
        String name = n.getNodeValue();
        if(name.indexOf(".") != -1){
           
        }
        f.name = n.getNodeValue();

        //attribute persistence-modifier
        n = node.getAttributes().getNamedItem("persistence-modifier");
        if (n != null)
            f.persistenceStatus = SpeedoField.parsePersistenceStatus(n.getNodeValue());

        //attribute primary-key
        n = node.getAttributes().getNamedItem("primary-key");
        if (n != null)
            f.primaryKey = Boolean.valueOf(n.getNodeValue()).booleanValue();

        //attribute null-value
        n = node.getAttributes().getNamedItem("null-value");
        if (n != null) {
            f.nullValue = SpeedoNullValue.toByte(n.getNodeValue());
        }

        //attribute default-fetch-group
        n = node.getAttributes().getNamedItem("default-fetch-group");
        if (n != null)
            f.defaultFetchGroup = Boolean.valueOf(n.getNodeValue()).booleanValue();

        //attribute fetch-group
        n = node.getAttributes().getNamedItem("fetch-group");
        if (n != null)
            f.fetchGroup = n.getNodeValue();
           
        //attribute depth
        n = node.getAttributes().getNamedItem("depth");
        if (n != null)
            f.depth = Integer.valueOf(n.getNodeValue()).intValue();

        //attribute embbedded
        n = node.getAttributes().getNamedItem("embedded");
        if (n != null)
            f.embedded = Boolean.valueOf(n.getNodeValue()).booleanValue();

        //attribute value-strategy
        n = node.getAttributes().getNamedItem("value-strategy");
        if (n != null)
            f.valueStrategy = n.getNodeValue();
       
        //attribute sequence
        n = node.getAttributes().getNamedItem("sequence");
        if (n != null)
            f.sequence = n.getNodeValue();
       
        //attribute column
        n = node.getAttributes().getNamedItem("table");
        SpeedoTable st = null;
        if (n != null) {
            st = new SpeedoTable();
        }
        //attribute column
        n = node.getAttributes().getNamedItem("column");
        if (n != null) {
            SpeedoColumn sc = new SpeedoColumn();
            sc.name = n.getNodeValue();
            if (st != null) {
                sc.table = st;
            }
            f.addColumn(sc);
            logger.log(BasicLevel.DEBUG, "specify column " + sc.name
                    + " to the field " + f.name + ": " + f.columns);
        }
        if (debug) {
            logger.log(BasicLevel.DEBUG, "New field: "
View Full Code Here

            sfg.addField(f);
        }
        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;
View Full Code Here

TOP

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

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.