Interface MetaDataFactory

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addClassExtensionKeys​(java.util.Collection<?> exts)
      Add any extension keys used by this instance to the given set.
      void addFieldExtensionKeys​(java.util.Collection<?> exts)
      Add any extension keys used by this instance to the given set.
      void clear()
      Clear any internal caches.
      boolean drop​(java.lang.Class<?>[] cls, int mode, java.lang.ClassLoader envLoader)
      Drop the metadata for the given classes in the given mode(s).
      MetaDataDefaults getDefaults()
      Return the metadata defaults for this factory.
      java.lang.Class<?> getManagedClass​(java.lang.Class<?> c)
      Gets the managed class corresponding to the given meta-class.
      java.lang.String getManagedClassName​(java.lang.String metamodelClassName)
      Gets the name of the managed class for the given fully-qualified meta-model class name.
      java.lang.String getMetaModelClassName​(java.lang.String managedClassName)
      Gets the name of the meta-model class for the given fully-qualified managed class name.
      java.util.Set<java.lang.String> getPersistentTypeNames​(boolean devpath, java.lang.ClassLoader envLoader)
      Return all persistent class names, using the metadata locations supplied in configuration, optionally scanning the classpath.
      java.lang.Class<?> getQueryScope​(java.lang.String queryName, java.lang.ClassLoader loader)
      Return the type defining the given query name, if any.
      java.lang.Class<?> getResultSetMappingScope​(java.lang.String resultSetMappingName, java.lang.ClassLoader loader)
      Return the type defining the given result set mapping name, if any.
      boolean isMetaClass​(java.lang.Class<?> c)
      Affirms if the given class is a meta-class.
      void load​(java.lang.Class<?> cls, int mode, java.lang.ClassLoader envLoader)
      Load metadata for the given class in the given mode(s).
      void loadXMLMetaData​(java.lang.Class<?> cls)
      Load XMLClassMetadata for the given class.
      ClassArgParser newClassArgParser()
      Return a properly-configured class arg parser for our expected metadata format.
      void setRepository​(MetaDataRepository repos)
      Set the repository to load metadata into.
      void setStoreDirectory​(java.io.File dir)
      Base directory for storing metadata.
      void setStoreMode​(int store)
      Storage mode.
      void setStrict​(boolean strict)
      If true, I/O's must exactly obey the mode directives given, and may not load additional information.
      boolean store​(ClassMetaData[] metas, QueryMetaData[] queries, SequenceMetaData[] seqs, int mode, java.util.Map<java.io.File,​java.lang.String> output)
      Store the given metadata.
    • Method Detail

      • setRepository

        void setRepository​(MetaDataRepository repos)
        Set the repository to load metadata into. This method will be called before use.
      • setStoreDirectory

        void setStoreDirectory​(java.io.File dir)
        Base directory for storing metadata. May not be called.
      • setStoreMode

        void setStoreMode​(int store)
        Storage mode. May not be called.
      • setStrict

        void setStrict​(boolean strict)
        If true, I/O's must exactly obey the mode directives given, and may not load additional information.
      • load

        void load​(java.lang.Class<?> cls,
                  int mode,
                  java.lang.ClassLoader envLoader)
        Load metadata for the given class in the given mode(s). If loading in MetaDataModes.MODE_QUERY, the class may be null. Loaded metadata should be added directly to the repository. It should have its source mode set appropriately via ClassMetaData.setSourceMode(int).
        Parameters:
        mode - the mode to load metadata in: if mapping information is stored together with metadata, then you can load mapping data even if this mode only includes MODE_META, so long as the strict property hasn't been set
      • store

        boolean store​(ClassMetaData[] metas,
                      QueryMetaData[] queries,
                      SequenceMetaData[] seqs,
                      int mode,
                      java.util.Map<java.io.File,​java.lang.String> output)
        Store the given metadata.
        Parameters:
        mode - hint about what aspects of the metadata have changed
        output - if non-null, rather than storing metadata directly, add entries mapping each output destination such as a File to the planned output for that destination in string form
        Returns:
        false if this factory is unable to store metadata
      • drop

        boolean drop​(java.lang.Class<?>[] cls,
                     int mode,
                     java.lang.ClassLoader envLoader)
        Drop the metadata for the given classes in the given mode(s).
        Returns:
        false if any metadata could not be dropped
      • getDefaults

        MetaDataDefaults getDefaults()
        Return the metadata defaults for this factory.
      • getQueryScope

        java.lang.Class<?> getQueryScope​(java.lang.String queryName,
                                         java.lang.ClassLoader loader)
        Return the type defining the given query name, if any.
      • getResultSetMappingScope

        java.lang.Class<?> getResultSetMappingScope​(java.lang.String resultSetMappingName,
                                                    java.lang.ClassLoader loader)
        Return the type defining the given result set mapping name, if any.
      • newClassArgParser

        ClassArgParser newClassArgParser()
        Return a properly-configured class arg parser for our expected metadata format.
      • clear

        void clear()
        Clear any internal caches.
      • addClassExtensionKeys

        void addClassExtensionKeys​(java.util.Collection<?> exts)
        Add any extension keys used by this instance to the given set.
      • addFieldExtensionKeys

        void addFieldExtensionKeys​(java.util.Collection<?> exts)
        Add any extension keys used by this instance to the given set.
      • loadXMLMetaData

        void loadXMLMetaData​(java.lang.Class<?> cls)
        Load XMLClassMetadata for the given class. Loaded metadata should be added directly to the repository.
      • getMetaModelClassName

        java.lang.String getMetaModelClassName​(java.lang.String managedClassName)
        Gets the name of the meta-model class for the given fully-qualified managed class name.
        Since:
        2.0.0
      • getManagedClassName

        java.lang.String getManagedClassName​(java.lang.String metamodelClassName)
        Gets the name of the managed class for the given fully-qualified meta-model class name.
        Since:
        2.0.0
      • isMetaClass

        boolean isMetaClass​(java.lang.Class<?> c)
        Affirms if the given class is a meta-class.
        Since:
        2.0.0
      • getManagedClass

        java.lang.Class<?> getManagedClass​(java.lang.Class<?> c)
        Gets the managed class corresponding to the given meta-class.
        Returns:
        null if the given input is not a meta-class.
        Since:
        2.0.0