Package org.apache.openjpa.jdbc.meta

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


        } else
            RelationStrategies.mapRelationToUnmappedPC(elem, "element", adapt);
        elem.setUseClassCriteria(criteria);
        elem.mapConstraints("element", adapt);

        FieldMappingInfo finfo = field.getMappingInfo();
        Column orderCol = finfo.getOrderColumn(field, field.getTable(), adapt);
        field.setOrderColumn(orderCol);
        field.setOrderColumnIO(finfo.getColumnIO());
        field.mapPrimaryKey(adapt);
    }
View Full Code Here


          ClassMappingInfo info = ((ClassMapping) ctx).getMappingInfo();
          tableName = (_secondaryTable == null)
            ? info.getTableName() : _secondaryTable;
          info.addUnique(tableName, unique);
        } else if (ctx instanceof FieldMapping) {// JoinTable
          FieldMappingInfo info = ((FieldMapping)ctx).getMappingInfo();
          info.addJoinTableUnique(unique);
        } else if (ctx instanceof SequenceMapping) {
          SequenceMapping seq = (SequenceMapping)ctx;
          unique.setTableName(seq.getTable());
          Column[] uniqueColumns = unique.getColumns();
          String[] columnNames = new String[uniqueColumns.length];
View Full Code Here

    /**
     * Parse @JoinTable.
     */
    private void parseJoinTable(FieldMapping fm, JoinTable join) {
      FieldMappingInfo info = fm.getMappingInfo();
        info.setTableName(toTableName(join.schema(), join.name()));
        parseJoinColumns(fm, info, false, join.joinColumns());
        parseJoinColumns(fm, fm.getElementMapping().getValueInfo(), false,
            join.inverseJoinColumns());
        addUniqueConstraints(info.getTableName(), fm, info, 
            join.uniqueConstraints());
    }
View Full Code Here

     */
    private boolean startCollectionTable(Attributes attrs)
        throws SAXException {
        FieldMapping fm = (FieldMapping) peekElement();

        FieldMappingInfo info = fm.getMappingInfo();
        DBIdentifier ctbl = parseCollectionTable(attrs);
        info.setTableIdentifier(ctbl);
        return true;
    }
View Full Code Here

          ClassMappingInfo info = ((ClassMapping) ctx).getMappingInfo();
          tableName = (_secondaryTable == null)
            ? info.getTableIdentifier() : DBIdentifier.newTable(_secondaryTable, delimit());
          info.addUnique(tableName, unique);
        } else if (ctx instanceof FieldMapping) {// JoinTable
          FieldMappingInfo info = ((FieldMapping)ctx).getMappingInfo();
          info.addJoinTableUnique(unique);
        } else if (ctx instanceof SequenceMapping) {
          SequenceMapping seq = (SequenceMapping)ctx;
          unique.setTableIdentifier(seq.getTableIdentifier());
          Column[] uniqueColumns = unique.getColumns();
          DBIdentifier[] columnNames = new DBIdentifier[uniqueColumns.length];
View Full Code Here

          ClassMappingInfo info = ((ClassMapping) ctx).getMappingInfo();
          tableName = (_secondaryTable == null)
            ? info.getTableName() : _secondaryTable;
          info.addUnique(tableName, unique);
        } else if (ctx instanceof FieldMapping) {// JoinTable
          FieldMappingInfo info = ((FieldMapping)ctx).getMappingInfo();
          info.addJoinTableUnique(unique);
        } else if (ctx instanceof SequenceMapping) {
          SequenceMapping seq = (SequenceMapping)ctx;
          unique.setTableName(seq.getTable());
          Column[] uniqueColumns = unique.getColumns();
          String[] columnNames = new String[uniqueColumns.length];
View Full Code Here

    /**
     * Parse @JoinTable.
     */
    private void parseJoinTable(FieldMapping fm, JoinTable join) {
      FieldMappingInfo info = fm.getMappingInfo();
      DBIdentifier joinTbl = toTableIdentifier(join.schema(), join.name());
        info.setTableIdentifier(joinTbl);
        parseJoinColumns(fm, info, false, join.joinColumns());
        parseJoinColumns(fm, fm.getElementMapping().getValueInfo(), false,
            join.inverseJoinColumns());
        addUniqueConstraints(info.getTableIdentifier().getName(), fm, info, 
            join.uniqueConstraints());
    }
View Full Code Here

    /**
     * Parse @CollectionTable.
     */
    protected void parseCollectionTable(FieldMapping fm, CollectionTable ctbl) {
        FieldMappingInfo info = fm.getMappingInfo();
        DBIdentifier tblName = toTableIdentifier(ctbl.schema(), ctbl.name());
        info.setTableIdentifier(tblName);
        //ctbl.catalog()
        parseJoinColumns(fm, fm.getMappingInfo(), false, ctbl.joinColumns());
        addUniqueConstraints(info.getTableIdentifier().getName(), fm.getDefiningMetaData(),
            info, ctbl.uniqueConstraints());
    }
View Full Code Here

    /**
     * Parse @MapKeyColumn.
     */
    protected void parseMapKeyColumn(FieldMapping fm, MapKeyColumn anno) {
        int unique = 0;
        FieldMappingInfo info = fm.getMappingInfo();
        if (anno.table() != null && anno.table().length() > 0) {
            info.setTableIdentifier(DBIdentifier.newTable(anno.table(), delimit()));
        }
        Column col = new Column();
        setupMapKeyColumn(fm, col, anno);
        unique |= (anno.unique()) ? TRUE : FALSE;
        setMapKeyColumn(fm, fm.getKeyMapping().getValueInfo(), col, unique);
View Full Code Here

     */
    private boolean startCollectionTable(Attributes attrs)
        throws SAXException {
        FieldMapping fm = (FieldMapping) peekElement();

        FieldMappingInfo info = fm.getMappingInfo();
        DBIdentifier ctbl = parseCollectionTable(attrs);
        info.setTableIdentifier(ctbl);
        return true;
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.jdbc.meta.FieldMappingInfo

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.