Package org.objectweb.speedo.metadata

Examples of org.objectweb.speedo.metadata.SpeedoField


    if (speedoClass.getSuperClassName() != null) {
      pkFieldClassHolder = speedoClass.getAncestor();
    }

        for(Iterator it = pkFieldClassHolder.fields.values().iterator(); it.hasNext();) {
            SpeedoField sp = (SpeedoField) it.next();
            if (sp.primaryKey) {
                String methodName = "pnGet" + upperFL(sp.name);
                logger.log(BasicLevel.DEBUG, "Add to the class " + className
                        + " the method " + methodName);
                CodeVisitor _cv = this.cv.visitMethod(
View Full Code Here


    boolean hasRef = false;
    ctx.put("needSpeedoGenClassListener", new Boolean(false));

    for (Iterator it = moClass.fields.values().iterator(); it.hasNext();) {
      SpeedoField sp = (SpeedoField) it.next();
      Field f = new Field();
      fields.add(f);
      if ((sp.visibility & Constants.ACC_TRANSIENT) == 0
        && (sp.visibility & Constants.ACC_STATIC) == 0) {
        fieldsToSerialize.add(f);
View Full Code Here

    fg.postload = sfg.postLoad;
    //add the list of Field to load with this fetchgroup
    fg.fields = new ArrayList( sfg.getFields().size());
    Iterator it =  sfg.getFields().values().iterator();
    while(it.hasNext()){
      SpeedoField sf = (SpeedoField) it.next();
      Field f = new Field();
      fg.fields.add(f);
      fillFieldInfo4FetchGroup(f, sf);
    }
    //add the names of the nested fetchgroups
View Full Code Here

        return userCaches;
    }
   
    protected void computeUserCaches(SpeedoClass sc, Map userCaches, boolean addNew) {
        for(Iterator it = sc.fields.values().iterator(); it.hasNext();) {
            SpeedoField sf = (SpeedoField) it.next();
            String cacheName = sf.getExtensionValueByKey(SpeedoProperties.USER_CACHE);
            if (cacheName == null) {
                continue;
            }
            List sfs = (List) userCaches.get(cacheName);
            if (sfs == null) {
View Full Code Here

        if (l != null) {
            for (int j = 0; j < l.size(); j++) {
                Node fieldNode = (Node) l.get(j);
                String fieldName = getStringAttributeValue(fieldNode, "name", null);
                if (fieldName != null) {
                    SpeedoField field = fieldOwner.getField(fieldName);
                    if (field != null) {
                        fg.addField(field);
                    } else {
                        logger.log(BasicLevel.WARN, "Bad field name '"
                                + fieldName + "'in the fetch group '"
View Full Code Here

            throw new SpeedoXMLError("Attribute name for tag field requested.");
        String name = n.getNodeValue();
        //add the field name to the index
        moIndex.fieldNames.add(name);
        //try to add the column name(s) to the index
        SpeedoField sf = (SpeedoField) moClass.fields.get(name);
        if (sf == null)
          throw new SpeedoXMLError("The field " + name + " must be defined for the class "
              + moClass.name +".");
        if( sf.columns != null  && sf.columns.length != 0) {
          for(int i = 0; i < sf.columns.length; i++) {
View Full Code Here

        n = fieldNode.getAttributes().getNamedItem("name");
        if (n == null)
            throw new SpeedoXMLError("Attribute name for tag field requested.");
        String name = n.getNodeValue();
        int dotIdx = name.lastIndexOf(".");
        SpeedoField f = null;
        SpeedoCommonField cf;
        FieldContext fc = new FieldContext();
        fc.fieldNode = fieldNode;
        if(dotIdx != -1){
            cf = moClass.inheritance.newSpeedoInheritedField(name);
        } else {
            f = new SpeedoField();
            cf = f;
          f.name = n.getNodeValue();
            f.moClass = moClass;
 
          //<!ATTLIST field persistence-modifier (persistent|transactional|none) #IMPLIED>
View Full Code Here

       
        List fields = (List) fgChildren.get("field");
        if (fields != null) {
          for (Iterator fieldIt = fields.iterator(); fieldIt.hasNext();) {
              Node fieldNode = (Node) fieldIt.next();
              SpeedoField sf = new SpeedoField();
              sf.name = getStringAttributeValue(fieldNode, "name", null);
                fg.addField(sf);
                //depth for a field
                String depth = getStringAttributeValue(fieldNode, "fetch-depth", null);
                if (depth == null) {
View Full Code Here

                        + f.reverseField.type);
                mv.visitTypeInsn(CHECKCAST, getJVMClassName(SpeedoGenClassCoherence.class));
               
                mv.visitVarInsn(ALOAD, 0);
                if (f.getReverseIsMap()) {
                    SpeedoField sf = f.reverseKField;
                    mv.visitVarInsn(ALOAD, 0);
                    mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite,
                            NamingRules.getterName(sf), "()" + sf.type);
                } else {
                    mv.visitInsn(ACONST_NULL);
View Full Code Here

        ctx.put("package", sc.moPackage.name);
        ctx.put("classNameObjectId", sc.name + OBJECTID_SUFFIX);
        ArrayList fields = new ArrayList();
        Iterator it = sc.fields.values().iterator();
        while(it.hasNext()) {
            SpeedoField sf = (SpeedoField) it.next();
            if (sf.primaryKey) {
                TypedElement te = sc.jormclass.getTypedElement(sf.name);
                Field f = new Field(sf.name, te.getType().getJavaName());
                String encode = f.name;
                String decode = "current.substring("
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.