Examples of MappingInfo


Examples of com.save4j.model.MappingInfo

    return map;
  }

  private static MappingInfo processObjectField(Field field) throws InstantiationException, IllegalAccessException {
    MappingInfo mapping = new MappingInfo();

    mapping.setName(convertCaseChangeToUnderscore(field.getName()));

    if (isFieldPrimitive(field.getType())) {
      mapping.setType(getFieldType(field));
    }
    else if (isFieldOneToMany(field.getType())) {
      mapping.setOneToMany(true);
    }
    // One to one object
    else {
      mapping.setOneToOne(true);
    }

    return mapping;
  }
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.MappingInfo

     */
    private boolean startMapKeyColumn(Attributes attrs)
        throws SAXException {
        FieldMapping fm = (FieldMapping) peekElement();
        Column col = parseColumn(attrs);
        MappingInfo info = fm.getKeyMapping().getValueInfo();
        List<Column> cols = new ArrayList<Column>();
        cols.add(col);
        info.setColumns(cols);
        return true;
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.MappingInfo

        boolean retVal = startMapKeyColumn(attrs);
        // check if name is not set, set it to default: the
        // concatenation of the name of the referencing property
        // or field name, "-", "KEY"
        FieldMapping fm = (FieldMapping) peekElement();
        MappingInfo info = fm.getKeyMapping().getValueInfo();
        List<Column> cols = info.getColumns();
        Column col = cols.get(0);
        if (DBIdentifier.isNull(col.getIdentifier())) {
            col.setIdentifier(DBIdentifier.newColumn(fm.getName() + "_" + "KEY", delimit()));
        }
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.MappingInfo

        }
       
        boolean implicit = Boolean.parseBoolean(_foreignKeyAttributes.getValue("implicit"));
       
        FieldMapping fm = (FieldMapping) peekElement();
        MappingInfo info = fm.getValueInfo();
       
        String name = _foreignKeyAttributes.getValue("name");
        boolean enabled = Boolean.parseBoolean(_foreignKeyAttributes.getValue("enabled"));
        boolean deferred = Boolean.parseBoolean(_foreignKeyAttributes.getValue("deferred"));
        boolean specified = Boolean.parseBoolean(_foreignKeyAttributes.getValue("specified"));
        String deleteActionString = _foreignKeyAttributes.getValue("delete-action");
        String updateActionString = _foreignKeyAttributes.getValue("update-action");
        int deleteAction = toForeignKeyInt(deleteActionString);
        int updateAction = toForeignKeyInt(updateActionString);
       
        if (!implicit) {
            parseForeignKey(info, name,
                enabled,
                deferred, deleteAction,
                updateAction);
        }
        else {
            info.setImplicitRelation(true);
            assertDefault(name, enabled, deferred, specified, updateAction, deleteAction);
        }
       
        _columnNamesList = null;
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.MappingInfo

     */
    private boolean startMapKeyColumn(Attributes attrs)
        throws SAXException {
        FieldMapping fm = (FieldMapping) peekElement();
        Column col = parseColumn(attrs);
        MappingInfo info = fm.getKeyMapping().getValueInfo();
        List<Column> cols = new ArrayList<Column>();
        cols.add(col);
        info.setColumns(cols);
        return true;
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.MappingInfo

        boolean retVal = startMapKeyColumn(attrs);
        // check if name is not set, set it to default: the
        // concatenation of the name of the referencing property
        // or field name, "-", "KEY"
        FieldMapping fm = (FieldMapping) peekElement();
        MappingInfo info = fm.getKeyMapping().getValueInfo();
        List<Column> cols = info.getColumns();
        Column col = cols.get(0);
        if (DBIdentifier.isNull(col.getIdentifier())) {
            col.setIdentifier(DBIdentifier.newColumn(fm.getName() + "_" + "KEY", delimit()));
        }
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.MappingInfo

     */
    private boolean startMapKeyColumn(Attributes attrs)
        throws SAXException {
        FieldMapping fm = (FieldMapping) peekElement();
        Column col = parseColumn(attrs);
        MappingInfo info = fm.getKeyMapping().getValueInfo();
        List<Column> cols = new ArrayList<Column>();
        cols.add(col);
        info.setColumns(cols);
        return true;
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.MappingInfo

        boolean retVal = startMapKeyColumn(attrs);
        // check if name is not set, set it to default: the
        // concatenation of the name of the referencing property
        // or field name, "-", "KEY"
        FieldMapping fm = (FieldMapping) peekElement();
        MappingInfo info = fm.getKeyMapping().getValueInfo();
        List<Column> cols = info.getColumns();
        Column col = cols.get(0);
        if (DBIdentifier.isNull(col.getIdentifier())) {
            col.setIdentifier(DBIdentifier.newColumn(fm.getName() + "_" + "KEY", delimit()));
        }
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.MappingInfo

        }
       
        boolean implicit = Boolean.parseBoolean(_foreignKeyAttributes.getValue("implicit"));
       
        FieldMapping fm = (FieldMapping) peekElement();
        MappingInfo info = fm.getValueInfo();
       
        String name = _foreignKeyAttributes.getValue("name");
        boolean enabled = Boolean.parseBoolean(_foreignKeyAttributes.getValue("enabled"));
        boolean deferred = Boolean.parseBoolean(_foreignKeyAttributes.getValue("deferred"));
        boolean specified = Boolean.parseBoolean(_foreignKeyAttributes.getValue("specified"));
        String deleteActionString = _foreignKeyAttributes.getValue("delete-action");
        String updateActionString = _foreignKeyAttributes.getValue("update-action");
        int deleteAction = toForeignKeyInt(deleteActionString);
        int updateAction = toForeignKeyInt(updateActionString);
       
        if (!implicit) {
            parseForeignKey(info, name,
                enabled,
                deferred, deleteAction,
                updateAction);
        }
        else {
            info.setImplicitRelation(true);
            assertDefault(name, enabled, deferred, specified, updateAction, deleteAction);
        }
       
        _columnNamesList = null;
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.MappingInfo

     */
    private boolean startMapKeyColumn(Attributes attrs)
        throws SAXException {
        FieldMapping fm = (FieldMapping) peekElement();
        Column col = parseColumn(attrs);
        MappingInfo info = fm.getKeyMapping().getValueInfo();
        List<Column> cols = new ArrayList<Column>();
        cols.add(col);
        info.setColumns(cols);
        return true;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.