Examples of MetadataDescriptor


Examples of org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor

     */
    protected void processTableAndInheritance() {
        // If we are an inheritance subclass, ensure our root is processed
        // first since it has information its subclasses depend on.
        if (getDescriptor().isInheritanceSubclass()) {
            MetadataDescriptor parentDescriptor = getDescriptor().getInheritanceRootDescriptor();
            EntityAccessor parentAccessor = (EntityAccessor) parentDescriptor.getClassAccessor();
           
            // An entity who didn't know they were the root of an inheritance
            // hierarchy (that is, does not define inheritance metadata) must
            // process and default the inheritance metadata.
            if (! parentAccessor.hasInheritance()) {   
                parentAccessor.processInheritance();
            }
               
            // If this entity has inheritance metadata as well, then the
            // inheritance strategy is mixed and we need to process the
            // inheritance metadata to ensure this entity's subclasses process
            // correctly.
            if (hasInheritance()) {
                // Process the table metadata if there is some, otherwise default.
                processTable();
               
                // Process the inheritance metadata.
                processInheritance();   
            } else {
                // Process the table metadata for this descriptor (for a
                // joined strategy), if there is some. Must be called
                // before processing the inheritance subclass metadata.
                if (parentDescriptor.usesJoinedInheritanceStrategy()) {
                    processTable();
                }
            }
           
            // Process the inheritance subclass metadata.
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor

     */
    protected String processMapKey(CollectionMapping mapping) {
        String mapKeyMethod = null;
       
        if (isMapCollectionAccessor()) {
            MetadataDescriptor referenceDescriptor = getReferenceDescriptor();
           
            if ((m_mapKey == null || m_mapKey.equals("")) && referenceDescriptor.hasCompositePrimaryKey()) {
                // No persistent property or field name has been provided, and
                // the reference class has a composite primary key class. Let
                // it fall through to return null for the map key. Internally,
                // EclipseLink will use an instance of the composite primary
                // key class as the map key.
            } else {
                // A persistent property or field name may have have been
                // provided. 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(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();
            }
        }
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.