Examples of OneToManyMapping


Examples of cysbml.mapping.OneToManyMapping

  ///   MAPPINGS    ///
  public void createGlyphMappings(){
    if (layout.isSetListOfReactionGlyphs()){
      reactionToReactionGlyphMapping = createReactionGlyphMapping(layout.getListOfReactionGlyphs());
    } else {
      reactionToReactionGlyphMapping = new OneToManyMapping();
    }
   
    if (layout.isSetListOfSpeciesGlyphs()){
      speciesToSpeciesGlyphMapping = createSpeciesGlyphMapping(layout.getListOfSpeciesGlyphs());
    } else {
      speciesToSpeciesGlyphMapping = new OneToManyMapping();
    }
  }
View Full Code Here

Examples of cysbml.mapping.OneToManyMapping

      speciesToSpeciesGlyphMapping = new OneToManyMapping();
    }
  }
 
  public static OneToManyMapping createReactionGlyphMapping(ListOf<ReactionGlyph> listOfGlyphs){
    OneToManyMapping map = new OneToManyMapping();
    for (ReactionGlyph glyph : listOfGlyphs){
      if (glyph.isSetReaction()){
        map.put(glyph.getReaction(), glyph.getId());
      }
    }
    return map;
  }
View Full Code Here

Examples of cysbml.mapping.OneToManyMapping

    }
    return map;
  }
 
  public static OneToManyMapping createSpeciesGlyphMapping(ListOf<SpeciesGlyph> listOfGlyphs){
    OneToManyMapping map = new OneToManyMapping();
    for (SpeciesGlyph glyph : listOfGlyphs){
      if (glyph.isSetSpecies()){
        map.put(glyph.getSpecies(), glyph.getId());
      }
    }
    return map;
  }
View Full Code Here

Examples of cysbml.mapping.OneToManyMapping

      makeNetworkAndTreeChanges(selectedNodeIds, selectedNamedSBaseIds);
    }
  } 
 
  private List<String> getNodeIdsFromNamedSBaseIds(List<String> nsbIds){
    OneToManyMapping mapping = sbmlDocuments.getCurrentNSBToNodeMapping();
    return mapping.getValues(nsbIds);
  }
View Full Code Here

Examples of cysbml.mapping.OneToManyMapping

  private List<String> getNodeIdsFromNamedSBaseIds(List<String> nsbIds){
    OneToManyMapping mapping = sbmlDocuments.getCurrentNSBToNodeMapping();
    return mapping.getValues(nsbIds);
  }
  private List<String> getNamedSBaseIdsFromNodeIds(List<String> nodeIds){
    OneToManyMapping mapping = sbmlDocuments.getCurrentNodeToNSBMapping();
    return mapping.getValues(nodeIds);
  }
View Full Code Here

Examples of oracle.toplink.essentials.mappings.OneToManyMapping

            // Add the mapping to the descriptor.
            m_descriptor.addMapping(mapping);
        } else {
            // Create a 1-M mapping and process common collection mapping
            // metadata.
            OneToManyMapping mapping = new OneToManyMapping();
            process(mapping);
           
            // Non-owning side, process the foreign keys from the owner.
      OneToOneMapping ownerMapping = null;
            if (getOwningMapping().isOneToOneMapping()){
              ownerMapping = (OneToOneMapping) getOwningMapping();
            } else {
        // If improper mapping encountered, throw an exception.
              getValidator().throwInvalidMappingEncountered(getJavaClass(), getReferenceClass());
            }
               
            Map<DatabaseField, DatabaseField> keys = ownerMapping.getSourceToTargetKeyFields();
            for (DatabaseField fkField : keys.keySet()) {
                mapping.addTargetForeignKeyField(fkField, keys.get(fkField));
            }  
           
            // Add the mapping to the descriptor.
            m_descriptor.addMapping(mapping);
        }
View Full Code Here

Examples of org.chromattic.core.mapping.value.OneToManyMapping

        ValueInfo beanElementType = multiValuedProperty.getElementValue();
        if (beanElementType instanceof BeanValueInfo) {
          BeanValueInfo bvi = (BeanValueInfo)beanElementType;

          //
          OneToManyMapping mapping;
          RelationshipType type = oneToManyAnn.type();
          if (type == RelationshipType.HIERARCHIC) {
            MappedBy mappedBy = propertyInfo.getAnnotation(MappedBy.class);
            if (mappedBy != null) {
              throw new IllegalStateException();
            }
            mapping = new OneToManyMapping(bvi.getTypeInfo(), RelationshipType.HIERARCHIC);
          } else {
            RelatedMappedBy mappedBy = propertyInfo.getAnnotation(RelatedMappedBy.class);
            if (mappedBy == null) {
              throw new IllegalStateException();
            }
View Full Code Here

Examples of org.eclipse.persistence.mappings.OneToManyMapping

     * INTERNAL:
     */
    protected void prepareOneToManySelectionQuery(OneToManyMapping sourceMapping, AbstractSession session) {
        // Clone the mapping because in reality that is what we have, that
        // is, a 1-M mapping to each class of the hierarchy.
        OneToManyMapping oneToMany = (OneToManyMapping) sourceMapping.clone();
           
        // Update the foreign key fields on the mapping. Basically, take the
        // table name off and let the descriptor figure it out.
        Vector<DatabaseField> targetForeignKeyFields = new Vector<DatabaseField>();
        for (DatabaseField fkField : oneToMany.getTargetForeignKeysToSourceKeys().keySet()) {
            targetForeignKeyFields.add(new DatabaseField(fkField.getName()));
        }
                   
        // Update our foreign key fields and clear the key maps.
        oneToMany.setTargetForeignKeyFields(targetForeignKeyFields);
        oneToMany.getTargetForeignKeysToSourceKeys().clear();
        oneToMany.getSourceKeysToTargetForeignKeys().clear();
       
        addSelectionQuery(oneToMany, sourceMapping, session);
    }
View Full Code Here

Examples of org.eclipse.persistence.mappings.OneToManyMapping

                getDescriptor().addMapping(mapping);
            }
        } else {
            // Create a 1-M mapping and process common collection mapping
            // metadata.
            OneToManyMapping mapping = new OneToManyMapping();
            process(mapping);
           
            // Non-owning side, process the foreign keys from the owner.
            OneToOneMapping ownerMapping = null;
            if (getOwningMapping(getMappedBy()).isOneToOneMapping()){
                ownerMapping = (OneToOneMapping) getOwningMapping(getMappedBy());
            } else {
                // If improper mapping encountered, throw an exception.
                throw ValidationException.invalidMapping(getJavaClass(), getReferenceClass());
            }
               
            Map<DatabaseField, DatabaseField> keys = ownerMapping.getSourceToTargetKeyFields();
            for (DatabaseField fkField : keys.keySet()) {
                DatabaseField pkField = keys.get(fkField);
               
                // If we are within a table per class strategy we have to update
                // the primary key field to point to our own database table.
                // The extra table check is if the mapping is actually defined
                // on our java class (meaning we have the right table at this
                // point and can avoid the cloning)
                if (getDescriptor().usesTablePerClassInheritanceStrategy() && ! pkField.getTable().equals(getDescriptor().getPrimaryTable())) {
                    // We need to update the pk field to be to our table.
                    pkField = (DatabaseField) pkField.clone();
                    pkField.setTable(getDescriptor().getPrimaryTable());
                }
           
                mapping.addTargetForeignKeyField(fkField, pkField);
            }  
           
            // Process properties
            processProperties(mapping);
           
View Full Code Here

Examples of org.eclipse.persistence.mappings.OneToManyMapping

                }
                return associations;
            }

            public void setAttributeValueInObject(Object object, Object value) {
                OneToManyMapping mapping = (OneToManyMapping)object;
                List associations = (List)value;
                mapping.setSourceKeyFields(NonSynchronizedVector.newInstance(associations.size()));
                mapping.setTargetForeignKeyFields(NonSynchronizedVector.newInstance(associations.size()));
                Iterator iterator = associations.iterator();
                while (iterator.hasNext()) {
                    Association association = (Association)iterator.next();
                    mapping.getSourceKeyFields().add((DatabaseField)association.getValue());
                    mapping.getTargetForeignKeyFields().add((DatabaseField)association.getKey());
                }
            }
        });
        sourceToTargetKeyFieldAssociationsMapping.setAttributeName("sourceToTargetKeyFieldAssociations");
        sourceToTargetKeyFieldAssociationsMapping.setXPath(getSecondaryNamespaceXPath() + "target-foreign-key/" + getSecondaryNamespaceXPath() + "field-reference");
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.