Package oracle.toplink.essentials.mappings

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

TOP

Related Classes of oracle.toplink.essentials.mappings.OneToManyMapping

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.