Examples of MetadataAccessor


Examples of oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessor

     * object given. Order of checking is important, careful when modifying
     * or adding, check what the isXyz call does to determine if the accessor
     * is of type xyz.
     */
    protected MetadataAccessor buildAccessor(MetadataAccessibleObject accessibleObject) {
        MetadataAccessor accessor = m_descriptor.getAccessorFor(accessibleObject.getAttributeName());
       
        if (accessor == null) {
            if (MetadataHelper.isBasic(accessibleObject, m_descriptor)) {
                return new BasicAccessor(accessibleObject, this);
            } else if (MetadataHelper.isEmbedded(accessibleObject, m_descriptor)) {
View Full Code Here

Examples of oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessor

     * again. If still no accessor is found and this descriptor metadata is
     * and an inheritance sublcass, than it will then look on the root metadata
     * descriptor. Null is returned otherwise.
     */
    public MetadataAccessor getAccessorFor(String fieldOrPropertyName) {
      MetadataAccessor accessor = m_accessors.get(fieldOrPropertyName);
       
        if (accessor == null) {
            // Perhaps we have a property name ...
            accessor = m_accessors.get(MetadataHelper.getAttributeNameFromMethodName(fieldOrPropertyName));
          
View Full Code Here

Examples of oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessor

     * Non-owning mappings that need to look up the owning mapping, should call
     * this method with their respective accessor to check for circular mappedBy
     * references. If the referencingAccessor is null, no check will be made.
     */
    public DatabaseMapping getMappingForAttributeName(String attributeName, MetadataAccessor referencingAccessor) {
        MetadataAccessor accessor = (MetadataAccessor) getAccessorFor(attributeName);
       
        if (accessor != null) {
            // If the accessor is a relationship accessor than it may or may
            // not have been processed yet. Fast track its processing if it
            // needs to be. The process call will do nothing if it has already
            // been processed.
            if (accessor.isRelationship()) {
                RelationshipAccessor relationshipAccessor = (RelationshipAccessor) accessor;
               
                // Check that we don't have circular mappedBy values which
                // will cause an infinite loop.
                if (referencingAccessor != null && ! relationshipAccessor.isManyToOne() && relationshipAccessor.getMappedBy().equals(referencingAccessor.getAttributeName())) {
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor

                // key of the reference class. The primary key cannot be
                // composite at this point.
                String fieldOrPropertyName = getName(m_mapKey, referenceDescriptor.getIdAttributeName(), getLogger().MAP_KEY_ATTRIBUTE_NAME);
   
                // Look up the referenceAccessor
                MetadataAccessor referenceAccessor = referenceDescriptor.getAccessorFor(fieldOrPropertyName);
       
                if (referenceAccessor == null) {
                    throw ValidationException.couldNotFindMapKey(fieldOrPropertyName, referenceDescriptor.getJavaClass(), mapping);
                }
       
                mapKeyMethod = referenceAccessor.getAccessibleObjectName();
            }
        }
       
        return mapKeyMethod;
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor

                // key of the reference class. The primary key cannot be
                // composite at this point.
                String fieldOrPropertyName = getName(m_mapKey, referenceDescriptor.getIdAttributeName(), getLogger().MAP_KEY_ATTRIBUTE_NAME);
   
                // Look up the referenceAccessor
                MetadataAccessor referenceAccessor = referenceDescriptor.getAccessorFor(fieldOrPropertyName);
       
                if (referenceAccessor == null) {
                    throw ValidationException.couldNotFindMapKey(fieldOrPropertyName, referenceDescriptor.getJavaClass(), mapping);
                }
       
                mapKeyMethod = referenceAccessor.getAccessibleObjectName();
            }
        }
       
        return mapKeyMethod;
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor

                // key of the reference class. The primary key cannot be
                // composite at this point.
                String fieldOrPropertyName = getName(m_mapKey, referenceDescriptor.getIdAttributeName(), getLogger().MAP_KEY_ATTRIBUTE_NAME);
   
                // Look up the referenceAccessor
                MetadataAccessor referenceAccessor = referenceDescriptor.getAccessorFor(fieldOrPropertyName);
       
                if (referenceAccessor == null) {
                    throw ValidationException.couldNotFindMapKey(fieldOrPropertyName, referenceDescriptor.getJavaClass(), mapping);
                }
       
                mapKeyMethod = referenceAccessor.getAccessibleObjectName();
            }
        }
       
        return mapKeyMethod;
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor

            // If one has not we will default to the primary key of the reference
            // class. The primary key cannot be composite at this point.
            String fieldOrPropertyName = MetadataHelper.getName(m_name, referenceDescriptor.getIdAttributeName(), logger.MAP_KEY_ATTRIBUTE_NAME, logger, mappingAccessor.getAnnotatedElementName());
   
            // Look up the referenceAccessor
            MetadataAccessor referenceAccessor = referenceDescriptor.getMappingAccessor(fieldOrPropertyName);
            if (referenceAccessor == null) {
                // 266912: relax validation for MappedSuperclass descriptors when the map key is an unresolved generic type
                if (referenceDescriptor.isMappedSuperclass()) {
                    return null;
                } else {
                    throw ValidationException.couldNotFindMapKey(fieldOrPropertyName, referenceDescriptor.getJavaClass(), (DatabaseMapping)mapping);
                }
            }
       
            return referenceAccessor.getAccessibleObjectName();
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor

            // If one has not we will default to the primary key of the reference
            // class. The primary key cannot be composite at this point.
            String fieldOrPropertyName = MetadataHelper.getName(m_name, referenceDescriptor.getIdAttributeName(), logger.MAP_KEY_ATTRIBUTE_NAME, logger, mappingAccessor.getAnnotatedElementName());
   
            // Look up the referenceAccessor
            MetadataAccessor referenceAccessor = referenceDescriptor.getMappingAccessor(fieldOrPropertyName);
            if (referenceAccessor == null) {
                // 266912: relax validation for MappedSuperclass descriptors when the map key is an unresolved generic type
                if (referenceDescriptor.isMappedSuperclass()) {
                    return null;
                } else {
                    throw ValidationException.couldNotFindMapKey(fieldOrPropertyName, referenceDescriptor.getJavaClass(), mapping);
                }
            }
       
            return referenceAccessor.getAccessibleObjectName();
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor

            // If one has not we will default to the primary key of the reference
            // class. The primary key cannot be composite at this point.
            String fieldOrPropertyName = getName(mapKey, referenceDescriptor.getIdAttributeName(), getLogger().MAP_KEY_ATTRIBUTE_NAME);
   
            // Look up the referenceAccessor
            MetadataAccessor referenceAccessor = referenceDescriptor.getAccessorFor(fieldOrPropertyName);
            if (referenceAccessor == null) {
                // 266912: relax validation for MappedSuperclass descriptors when the map key is an unresolved generic type
                if(!referenceDescriptor.isMappedSuperclass()) {
                    throw ValidationException.couldNotFindMapKey(fieldOrPropertyName, referenceDescriptor.getJavaClass(), mapping);
                } else {
                    return null;
                }
            }
       
            return referenceAccessor.getAccessibleObjectName();
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor

            // If one has not we will default to the primary key of the reference
            // class. The primary key cannot be composite at this point.
            String fieldOrPropertyName = MetadataHelper.getName(m_name, referenceDescriptor.getIdAttributeName(), logger.MAP_KEY_ATTRIBUTE_NAME, logger, mappingAccessor.getAnnotatedElementName());
   
            // Look up the referenceAccessor
            MetadataAccessor referenceAccessor = referenceDescriptor.getAccessorFor(fieldOrPropertyName);
            if (referenceAccessor == null) {
                // 266912: relax validation for MappedSuperclass descriptors when the map key is an unresolved generic type
                if (referenceDescriptor.isMappedSuperclass()) {
                    return null;
                } else {
                    throw ValidationException.couldNotFindMapKey(fieldOrPropertyName, referenceDescriptor.getJavaClass(), mapping);
                }
            }
       
            return referenceAccessor.getAccessibleObjectName();
        }
    }
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.