Package org.apache.cayenne.reflect

## Class PersistentDescriptorFactory

- java.lang.Object
- - org.apache.cayenne.reflect.PersistentDescriptorFactory

- All Implemented Interfaces:
    `ClassDescriptorFactory`
  Direct Known Subclasses:
    `DataObjectDescriptorFactory`, `ValueHolderDescriptorFactory`

      public abstract class PersistentDescriptorFactory
      extends Object
      implements ClassDescriptorFactory

  A convenience superclass for `ClassDescriptorFactory` implementors.
  Since:
    3.0

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected ClassDescriptorMap` | `descriptorMap` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PersistentDescriptorFactory​(ClassDescriptorMap descriptorMap)` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected Accessor` | `createAccessor​(PersistentDescriptor descriptor, String propertyName, Class<?> propertyType)` | Creates an accessor for the property.
    `protected void` | `createAttributeProperty​(PersistentDescriptor descriptor, ObjAttribute attribute)` |
    `protected PersistentDescriptor` | `createDescriptor()` |
    `protected Accessor` | `createEmbeddableAccessor​(EmbeddableDescriptor descriptor, String propertyName, Class<?> propertyType)` | Creates an accessor for the property of the embeddable class.
    `protected EmbeddableDescriptor` | `createEmbeddableDescriptor​(EmbeddedAttribute embeddedAttribute)` | Creates a descriptor of the embedded property.
    `protected void` | `createEmbeddedAttributeProperty​(PersistentDescriptor descriptor, EmbeddedAttribute embeddedAttribute, ObjAttribute attribute)` |
    `protected Accessor` | `createMapKeyAccessor​(ObjRelationship relationship, ClassDescriptor targetDescriptor)` | Creates an accessor to read a map key for a given relationship.
    `protected abstract void` | `createToManyCollectionProperty​(PersistentDescriptor descriptor, ObjRelationship relationship)` |
    `protected abstract void` | `createToManyListProperty​(PersistentDescriptor descriptor, ObjRelationship relationship)` |
    `protected abstract void` | `createToManyMapProperty​(PersistentDescriptor descriptor, ObjRelationship relationship)` |
    `protected abstract void` | `createToManySetProperty​(PersistentDescriptor descriptor, ObjRelationship relationship)` |
    `protected abstract void` | `createToOneProperty​(PersistentDescriptor descriptor, ObjRelationship relationship)` |
    `ClassDescriptor` | `getDescriptor​(String entityName)` | Returns a ClassDescriptor instance for a given symbolic entity name.
    `protected ClassDescriptor` | `getDescriptor​(ObjEntity entity, Class<?> entityClass)` |
    `protected void` | `indexAdditionalDbEntities​(PersistentDescriptor descriptor)` |
    `protected void` | `indexQualifiers​(PersistentDescriptor descriptor, EntityInheritanceTree inheritanceTree)` |
    `protected void` | `indexRootDbEntities​(PersistentDescriptor descriptor, EntityInheritanceTree inheritanceTree)` |
    `protected void` | `indexSubclassDescriptors​(PersistentDescriptor descriptor, EntityInheritanceTree inheritanceTree)` |
    `protected void` | `indexSuperclassProperties​(PersistentDescriptor descriptor)` | Adds superclass properties to the descriptor, applying proper overrides.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### descriptorMap

          protected ClassDescriptorMap descriptorMap

  - ### Constructor Detail

    - #### PersistentDescriptorFactory

          public PersistentDescriptorFactory​(ClassDescriptorMap descriptorMap)

  - ### Method Detail

    - #### getDescriptor

          public ClassDescriptor getDescriptor​(String entityName)

      Description copied from interface: `ClassDescriptorFactory`
      Returns a ClassDescriptor instance for a given symbolic entity name. Returns null if this factory doesn't support this type of entity.
      Specified by:
        `getDescriptor` in interface `ClassDescriptorFactory`

    - #### getDescriptor

          protected ClassDescriptor getDescriptor​(ObjEntity entity,
                                                  Class<?> entityClass)

    - #### createDescriptor

          protected PersistentDescriptor createDescriptor()

    - #### createAttributeProperty

          protected void createAttributeProperty​(PersistentDescriptor descriptor,
                                                 ObjAttribute attribute)

    - #### createEmbeddedAttributeProperty

          protected void createEmbeddedAttributeProperty​(PersistentDescriptor descriptor,
                                                         EmbeddedAttribute embeddedAttribute,
                                                         ObjAttribute attribute)

    - #### createToOneProperty

          protected abstract void createToOneProperty​(PersistentDescriptor descriptor,
                                                      ObjRelationship relationship)

    - #### createToManySetProperty

          protected abstract void createToManySetProperty​(PersistentDescriptor descriptor,
                                                          ObjRelationship relationship)

    - #### createToManyMapProperty

          protected abstract void createToManyMapProperty​(PersistentDescriptor descriptor,
                                                          ObjRelationship relationship)

    - #### createToManyListProperty

          protected abstract void createToManyListProperty​(PersistentDescriptor descriptor,
                                                           ObjRelationship relationship)

    - #### createToManyCollectionProperty

          protected abstract void createToManyCollectionProperty​(PersistentDescriptor descriptor,
                                                                 ObjRelationship relationship)

    - #### indexSubclassDescriptors

          protected void indexSubclassDescriptors​(PersistentDescriptor descriptor,
                                                  EntityInheritanceTree inheritanceTree)

    - #### indexRootDbEntities

          protected void indexRootDbEntities​(PersistentDescriptor descriptor,
                                             EntityInheritanceTree inheritanceTree)

    - #### indexQualifiers

          protected void indexQualifiers​(PersistentDescriptor descriptor,
                                         EntityInheritanceTree inheritanceTree)

    - #### indexSuperclassProperties

          protected void indexSuperclassProperties​(PersistentDescriptor descriptor)

      Adds superclass properties to the descriptor, applying proper overrides.

    - #### indexAdditionalDbEntities

          protected void indexAdditionalDbEntities​(PersistentDescriptor descriptor)

    - #### createAccessor

          protected Accessor createAccessor​(PersistentDescriptor descriptor,
                                            String propertyName,
                                            Class<?> propertyType)
                                     throws PropertyException

      Creates an accessor for the property.
      Throws:
        `PropertyException`

    - #### createMapKeyAccessor

          protected Accessor createMapKeyAccessor​(ObjRelationship relationship,
                                                  ClassDescriptor targetDescriptor)

      Creates an accessor to read a map key for a given relationship.

    - #### createEmbeddableAccessor

          protected Accessor createEmbeddableAccessor​(EmbeddableDescriptor descriptor,
                                                      String propertyName,
                                                      Class<?> propertyType)

      Creates an accessor for the property of the embeddable class.

    - #### createEmbeddableDescriptor

          protected EmbeddableDescriptor createEmbeddableDescriptor​(EmbeddedAttribute embeddedAttribute)

      Creates a descriptor of the embedded property.