Class ClassDescriptorMap

java.lang.Object
org.apache.cayenne.reflect.ClassDescriptorMap

public class ClassDescriptorMap extends Object
An object that holds class descriptors for mapped entities, compiling new descriptors on demand using an internal chain of descriptor factories. Note that the object is not synchronized internally, so it has to be prefilled with descriptors by the caller on initialization via calling 'getDescriptor' for all mapped entities.
Since:
3.0
  • Field Details

  • Constructor Details

    • ClassDescriptorMap

      public ClassDescriptorMap(EntityResolver resolver)
  • Method Details

    • getResolver

      public EntityResolver getResolver()
    • addFactory

      public void addFactory(ClassDescriptorFactory factory)
      Adds a factory to the descriptor factory chain.
    • removeFactory

      public void removeFactory(ClassDescriptorFactory factory)
    • clearFactories

      public void clearFactories()
    • clearDescriptors

      public void clearDescriptors()
    • removeDescriptor

      public void removeDescriptor(String entityName)
      Removes cached descriptor if any for the given entity.
    • addDescriptor

      public void addDescriptor(String entityName, ClassDescriptor descriptor)
      Caches descriptor definition.
    • getDescriptor

      public ClassDescriptor getDescriptor(String entityName)
    • createProxyDescriptor

      protected ClassDescriptor createProxyDescriptor(String entityName)
      Creates a descriptor wrapper that will compile the underlying descriptor on demand. Using proxy indirection is needed to compile relationships of descriptors to other descriptors that are not compiled yet.
    • createDescriptor

      protected ClassDescriptor createDescriptor(String entityName)
      Creates a new descriptor.