Package org.exolab.castor.mapping.xml

Examples of org.exolab.castor.mapping.xml.FieldMapping


        if (name.indexOf(".") > 0) {
            name = name.substring(name.indexOf(".") + 1);
  }

        FieldMapping[] fields = clsMapping.getFieldMapping();
  FieldMapping field = null;

        for (int i = 0; i < fields.length; ++i) {
            if (fields[i].getSql() != null && fields[i].getName().equals(name)) {
                field = fields[i];
                break;
            }
        }

        if (field == null) {
            throw new DTXException("The field " + name + " was not found");
  }

  Sql fieldSql = field.getSql();
  String table = clsMapping.getMapTo().getTable();

        if (value.startsWith("$")) {
            expr.addParameter(table, fieldSql.getName()[0], op);
        } else {
View Full Code Here


        // --------------------------------------------------------------------
        LOG.info( "Begin: Walking the mapping descriptor via objects" );

        MappingRoot mappingRoot = _mapping.getRoot();
        ClassMapping classMap;
        FieldMapping fieldMap;
        FieldMapping[] fieldMaps;

        int mappingCount = mappingRoot.getClassMappingCount();

        // loop over the classes
        for ( int i = 0; i < mappingCount; ++i )
        {
            classMap = mappingRoot.getClassMapping( i );
            LOG.debug( "Class name: " + classMap.getName() );

            int fieldCount = classMap.getClassChoice().getFieldMappingCount();
            fieldMaps = classMap.getClassChoice().getFieldMapping();

            LOG.debug( "fieldMaps.length: " + fieldMaps.length );

            // loop over the fields in each class
            for ( int j = 0; j < fieldMaps.length; ++j )
            {
                fieldMap = fieldMaps[j];
                LOG.debug( "        Field name: " + fieldMap.getName() );
                LOG.debug( "        Field type: " + fieldMap.getType() );
            }
        }

        LOG.info( "End: Walking the mapping descriptor via objects" );
        // --------------------------------------------------------------------
View Full Code Here

TOP

Related Classes of org.exolab.castor.mapping.xml.FieldMapping

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.