Class JpaMapUtils

    • Constructor Detail

      • JpaMapUtils

        public JpaMapUtils()
    • Method Detail

      • getSchemaForNativeQuery

        public static String getSchemaForNativeQuery​(javax.persistence.EntityManager em)
      • loadSpecificNamedQueries

        public static Properties loadSpecificNamedQueries​(String databaseType)
        Method that adds the different query variants for the database. The method loads the queries specified in the files META-INF/jpa-map/queries-{dbType}.properties and the default META-INF/jpa-map/ At least the default file should exist inside the jar file. The default file contains all the needed queries and the specific one can overload all or some of them for that database type.
        databaseType - The database type as returned by getDatabaseType
      • loadSqlProperties

        public static Properties loadSqlProperties​(URL url)
        Loads the URL as a properties file.
        url - The url to load, it can be null
        A properties file with the url loaded or null
      • configureNamedQuery

        public static void configureNamedQuery​(String queryName,
                                               String querySql,
                                               javax.persistence.EntityManager entityManager)
        Configures a named query to Hibernate.
        queryName - the query name
        querySql - the query SQL
        entityManager - the entity manager
      • getDatabaseType

        public static String getDatabaseType​(String productName)
      • addSpecificNamedQueries

        public static void addSpecificNamedQueries​(javax.persistence.EntityManagerFactory emf)