Class DesignerNamedQueryManager

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String beginTransaction​(java.lang.String projectName, java.lang.String datasource, int isolationLevel, long timeout)
      Registers a transaction, but does not actually begin it until a query is invoked in that transaction.
      void clearAllCaches​(java.lang.String project)
      Clears all Named Query caches for this project.
      void clearCache​(java.lang.String project, java.lang.String namedQueries)
      Clears the named query caches of the passed paths to the named queries.
      java.lang.Object execute​(java.lang.String projectName, NamedQuery query, java.util.Map<java.lang.String,​java.lang.Object> parameters, boolean canCache, boolean canLimit, java.lang.String tx, boolean getKey)
      Executes a named query that exists on the provided queryPath.
      java.lang.Object execute​(java.lang.String projectName, java.lang.String queryPath, java.util.Map<java.lang.String,​java.lang.Object> parameters, boolean canCache, boolean canLimit, java.lang.String tx, boolean getKey)
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • beginTransaction

        public java.lang.String beginTransaction​(java.lang.String projectName,
                                                 java.lang.String datasource,
                                                 int isolationLevel,
                                                 long timeout)
                                          throws java.lang.Exception
        Description copied from interface: NamedQueryManager
        Registers a transaction, but does not actually begin it until a query is invoked in that transaction. This lets us have a beginTransaction without client protection that doesn't risk getting our connection pool clobbered. Returns null if project does not exist or has not started up.
        Specified by:
        beginTransaction in interface NamedQueryManager
        Throws:
        java.lang.Exception
      • execute

        public java.lang.Object execute​(java.lang.String projectName,
                                        java.lang.String queryPath,
                                        java.util.Map<java.lang.String,​java.lang.Object> parameters,
                                        boolean canCache,
                                        boolean canLimit,
                                        java.lang.String tx,
                                        boolean getKey)
                                 throws java.lang.Exception
        Description copied from interface: NamedQueryManager
        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.
        Specified by:
        execute in interface NamedQueryManager
        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
        tx - If this field is not blank, will make this query part of a transaction
        getKey - If update query, will return new PK if true otherwise returns number of rows affected.
        Returns:
        Object of query results. May be null
        Throws:
        java.lang.Exception - If query not found or query generates an exception
      • execute

        public java.lang.Object execute​(java.lang.String projectName,
                                        NamedQuery query,
                                        java.util.Map<java.lang.String,​java.lang.Object> parameters,
                                        boolean canCache,
                                        boolean canLimit,
                                        java.lang.String tx,
                                        boolean getKey)
                                 throws java.lang.Exception
        Description copied from interface: NamedQueryManager
        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.
        Specified by:
        execute in interface NamedQueryManager
        Parameters:
        projectName - 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

        public NamedQuery getQueryFromPath​(java.lang.String project,
                                           java.lang.String queryPath)
                                    throws java.lang.Exception
        Description copied from interface: NamedQueryManager
        Returns the Cached NamedQuery based on the provided queryPath. Useful for checking permissions.
        Specified by:
        getQueryFromPath in interface NamedQueryManager
        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

        public void clearCache​(java.lang.String project,
                               java.lang.String namedQueries)
                        throws java.lang.Exception
        Description copied from interface: NamedQueryManager
        Clears the named query caches of the passed paths to the named queries.
        Specified by:
        clearCache in interface NamedQueryManager
        Parameters:
        project - the name of the effective project the named queries whose cache you wish to clear reside in.
        namedQueries - 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

        public void clearAllCaches​(java.lang.String project)
                            throws java.lang.Exception
        Description copied from interface: NamedQueryManager
        Clears all Named Query caches for this project.
        Specified by:
        clearAllCaches in interface NamedQueryManager
        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