Interface NamedQueryManager

  • All Known Implementing Classes:
    ClientNamedQueryManager, DesignerNamedQueryManager

    public interface NamedQueryManager
    This allows NamedQueries to use unsaved queries in the Designer (so other resources can use them without forcing a save), but not the Client.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clearAllCaches​(java.lang.String project)
      Clears all Named Query caches for this project.
      void clearCache​(java.lang.String project, java.lang.String queryPaths)
      Clears the named query caches of the passed paths to the named queries.
      java.lang.Object execute​(java.lang.String project, NamedQuery query, java.util.Map<java.lang.String,​java.lang.Object> parameters, boolean canCache, boolean canLimit)
      Executes a named query that exists on the provided queryPath.
      java.lang.Object execute​(java.lang.String project, java.lang.String queryPath, java.util.Map<java.lang.String,​java.lang.Object> parameters, boolean canCache, boolean canLimit)
      Executes a named query that exists on the provided queryPath.
      NamedQuery getQueryFromPath​(java.lang.String project, java.lang.String queryPath)
      Returns the Cached NamedQuery based on the provided queryPath.
    • Method Detail

      • execute

        java.lang.Object execute​(java.lang.String project,
                                 java.lang.String queryPath,
                                 java.util.Map<java.lang.String,​java.lang.Object> parameters,
                                 boolean canCache,
                                 boolean canLimit)
                          throws java.lang.Exception
        Executes a named query that exists on the provided queryPath. If the Named Query has parameters, values for each parameter should be supplied in the parameters map that conform to their data type. If the Named Query cannot be found at the supplied path, the required parameters aren't present, or their types are incorrect an Exception is thrown.
        Parameters:
        queryPath - The path to the Named Query. Must not be null
        parameters - A parameter map for the named query. Keys being the parameter name and values their corresponding value. Must not be null
        canCache - If true, will cache if the query config is set to cache
        canLimit - If true, will limit the results if the query config is set to limit
        Returns:
        Object of query results. May be null
        Throws:
        java.lang.Exception - If query not found or query generates an exception
      • execute

        java.lang.Object execute​(java.lang.String project,
                                 NamedQuery query,
                                 java.util.Map<java.lang.String,​java.lang.Object> parameters,
                                 boolean canCache,
                                 boolean canLimit)
                          throws java.lang.Exception
        Executes a named query that exists on the provided queryPath. If the Named Query has parameters, values for each parameter should be supplied in the parameters map that conform to their data type. If the Named Query cannot be found at the supplied path, the required parameters aren't present, or their types are incorrect an Exception is thrown.
        Parameters:
        project - The name of the effective project the named queries whose cache you wish to clear reside in.
        query - The NamedQuery to execute. Must not be null
        parameters - A parameter map for the named query. Keys being the parameter name and values their corresponding value. Must not be null
        canCache - If true, will cache if the query config is set to cache
        canLimit - If true, will limit the results if the query config is set to limit
        Returns:
        Object of query results. May be null
        Throws:
        java.lang.Exception - If query not found or query generates an exception
      • getQueryFromPath

        NamedQuery getQueryFromPath​(java.lang.String project,
                                    java.lang.String queryPath)
                             throws java.lang.Exception
        Returns the Cached NamedQuery based on the provided queryPath. Useful for checking permissions.
        Parameters:
        queryPath - Path to Named Query resource
        Returns:
        NamedQuery resource or null if not found.
        Throws:
        java.lang.Exception - If query or the project are not found
      • clearCache

        void clearCache​(java.lang.String project,
                        java.lang.String queryPaths)
                 throws java.lang.Exception
        Clears the named query caches of the passed paths to the named queries.
        Parameters:
        project - the name of the effective project the named queries whose cache you wish to clear reside in.
        queryPaths - a comma-separated string of the paths to the named queries that we want to clear. Must not be null
        Throws:
        java.lang.Exception - If query or the project are not found
      • clearAllCaches

        void clearAllCaches​(java.lang.String project)
                     throws java.lang.Exception
        Clears all Named Query caches for this project.
        Parameters:
        project - The name of the effective project whose named queries' cache you wish to clear.
        Throws:
        java.lang.Exception - If the project is not found