Class XmlSources


  • public class XmlSources
    extends Object
    Helper for building and handling XmlSource references.

    An XmlSource represents an XML document containing O/R mapping metadata, either a JPA orm.xml file, or a Hibernate .hbm.xml file.

    • Constructor Detail

      • XmlSources

        public XmlSources()
    • Method Detail

      • fromCacheableFile

        public static XmlSource fromCacheableFile​(File file)
      • fromCacheableFile

        public static XmlSource fromCacheableFile​(File file,
                                                  File cacheableDir)
      • fromCacheableFile

        public static XmlSource fromCacheableFile​(File file,
                                                  boolean strict)
      • fromCacheableFile

        public static XmlSource fromCacheableFile​(File file,
                                                  File cacheableDir,
                                                  boolean strict)
      • fromJar

        public static void fromJar​(File jar,
                                   Consumer<XmlSource> consumer)
        Read all .hbm.xml mappings from a jar file and pass them to the given Consumer.

        Assumes that any file named *.hbm.xml is a mapping document. This method does not support orm.xml files!

        Parameters:
        jar - a jar file
        consumer - a consumer of the resulting XML sources