Package oracle.toplink.essentials.mappings

Examples of oracle.toplink.essentials.mappings.OneToOneMapping


     * Process a @ManyToOne or many-to-one element into a TopLink OneToOne
     * mapping.
     */
    public void process() {
        // Initialize our mapping now with what we found.
        OneToOneMapping mapping = initOneToOneMapping();

        // Now process the JoinColumns (if there are any) for this mapping.
        processOwningMappingKeys(mapping);
       
        // Add the mapping to the descriptor.
View Full Code Here


     * Process a @OneToOne or one-to-one element into a TopLink OneToOne
     * mapping.
     */
    public void process() {
        // Initialize our mapping now with what we found.
        OneToOneMapping mapping = initOneToOneMapping();
       
        if (getMappedBy().equals("")) {
            // Owning side, look for JoinColumns or PrimaryKeyJoinColumns.
            processOwningMappingKeys(mapping);
        } else
            // 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());
            }

            mapping.setSourceToTargetKeyFields(ownerMapping.getTargetToSourceKeyFields());
            mapping.setTargetToSourceKeyFields(ownerMapping.getSourceToTargetKeyFields());
        }
       
        // Add the mapping to the descriptor.
        m_descriptor.addMapping(mapping);
    }
View Full Code Here

            // 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.
View Full Code Here

    /**
     * INTERNAL:
     * Initialize a OneToOneMapping.
     */
    protected OneToOneMapping initOneToOneMapping() {
      OneToOneMapping mapping = new OneToOneMapping();
        mapping.setIsReadOnly(false);
        mapping.setIsPrivateOwned(false);
        mapping.setIsOptional(isOptional());
        mapping.setAttributeName(getAttributeName());
        mapping.setReferenceClassName(getReferenceClassName());
       
        // If the global weave for value holders is true, the use the value
        // from usesIndirection. Otherwise, force it to false.
        boolean usesIndirection = (m_project.enableLazyForOneToOne()) ? usesIndirection() : false;
        if (usesIndirection && m_descriptor.usesPropertyAccess()) {
            mapping.setIndirectionPolicy(new WeavedObjectBasicIndirectionPolicy(getSetMethodName()));
        } else {
            mapping.setUsesIndirection(usesIndirection);
        }
       
        // Set the getter and setter methods if access is PROPERTY.
        setAccessorMethods(mapping);
       
View Full Code Here

TOP

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

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.