Interface CriteriaBuilderConfiguration


  • public interface CriteriaBuilderConfiguration
    A configuration for a CriteriaBuilderFactory which is mostly used in non Java EE environments.
    Since:
    1.0.0
    Author:
    Christian Beikov
    • Method Detail

      • withPackageOpener

        CriteriaBuilderConfiguration withPackageOpener​(PackageOpener packageOpener)
        Sets the package opener to use for obtaining access to user classes.
        Parameters:
        packageOpener - The package opener to use to obtain access to user classes
        Returns:
        this for method chaining
        Since:
        1.2.0
      • registerNamedType

        CriteriaBuilderConfiguration registerNamedType​(String name,
                                                       Class<?> type)
        Registers the given type under the given name. This makes the type usable for the VALUES clause.
        Parameters:
        name - The name of the type
        type - The type
        Returns:
        this for method chaining
        Since:
        1.2.0
      • registerFunction

        CriteriaBuilderConfiguration registerFunction​(JpqlFunctionGroup jpqlFunctionGroup)
        Registers the given jpql function group in the configuration.
        Parameters:
        jpqlFunctionGroup - The jpql function group
        Returns:
        this for method chaining
      • registerMacro

        CriteriaBuilderConfiguration registerMacro​(String macroName,
                                                   JpqlMacro jpqlMacro)
        Registers the given jpql macro in the configuration.
        Parameters:
        macroName - The name of the macro
        jpqlMacro - The jpql macro
        Returns:
        this for method chaining
        Since:
        1.2.0
      • registerDialect

        CriteriaBuilderConfiguration registerDialect​(String dbms,
                                                     DbmsDialect dialect)
        Registers the given dialect for the given dbms name.
        Parameters:
        dbms - The dbms for which the dialect should be registered
        dialect - The dialect which should be registered
        Returns:
        this for method chaining
        Since:
        1.1.0
      • getFunction

        JpqlFunctionGroup getFunction​(String name)
        Returns the JpqlFunctionGroup for registered function with the given name or null.
        Parameters:
        name - The name of the functino to retrieve
        Returns:
        the registered function or null
        Since:
        1.2.0
      • getFunctionNames

        Set<String> getFunctionNames()
        Returns the set of registered functions.
        Returns:
        the set of registered functions
      • getMacroNames

        Set<String> getMacroNames()
        Returns the set of registered macros.
        Returns:
        the set of registered macros
      • getNamedTypes

        Map<String,​Class<?>> getNamedTypes()
        Returns a map of registered named types.
        Returns:
        a map of the registered named types
        Since:
        1.2.0
      • registerEntityManagerIntegrator

        CriteriaBuilderConfiguration registerEntityManagerIntegrator​(EntityManagerFactoryIntegrator entityManagerEnricher)
        Registers the given entity manager enricher in the configuration.
        Parameters:
        entityManagerEnricher - The enricher that should be added
        Returns:
        this for method chaining
      • getEntityManagerIntegrators

        List<EntityManagerFactoryIntegrator> getEntityManagerIntegrators()
        Returns a list of registered entity manager enrichers.
        Returns:
        A list of registered entity manager enrichers
      • createCriteriaBuilderFactory

        CriteriaBuilderFactory createCriteriaBuilderFactory​(javax.persistence.EntityManagerFactory entityManagerFactory)
        Creates a new CriteriaBuilderFactory based on this configuration.
        Parameters:
        entityManagerFactory - The entity manager factory for which the criteria builder factory should be created
        Returns:
        A new CriteriaBuilderFactory
      • getProperties

        Properties getProperties()
        Returns all properties.
        Returns:
        All properties
      • getProperty

        String getProperty​(String propertyName)
        Returns a property value by name.
        Parameters:
        propertyName - The name of the property
        Returns:
        The value currently associated with that property name; may be null.
      • setProperties

        CriteriaBuilderConfiguration setProperties​(Properties properties)
        Replace the properties of the configuration with the given properties.
        Parameters:
        properties - The new set of properties
        Returns:
        this for method chaining
      • addProperties

        CriteriaBuilderConfiguration addProperties​(Properties extraProperties)
        Add the given properties to the properties of the configuration.
        Parameters:
        extraProperties - The properties to add.
        Returns:
        this for method chaining
      • mergeProperties

        CriteriaBuilderConfiguration mergeProperties​(Properties properties)
        Adds the given properties to the properties of the configuration, without overriding existing values.
        Parameters:
        properties - The properties to merge
        Returns:
        this for method chaining
      • setProperty

        CriteriaBuilderConfiguration setProperty​(String propertyName,
                                                 String value)
        Set a property value by name.
        Parameters:
        propertyName - The name of the property to set
        value - The new property value
        Returns:
        this for method chaining