Interface SqlContext


  • public interface SqlContext
    Main interface to load and access the set of queries defined at XML files for an application.
    Since:
    0.6.0
    Author:
    Alisson Gomes
    • Method Detail

      • getName

        String getName()
        Return context name that belong the statements
        Returns:
        context name
      • getQuery

        Sql getQuery​(String name)
        Retrieve one query according your name.
        Parameters:
        name - Name of the query.
        Returns:
        Return the query object with SQL.
        Throws:
        IllegalArgumentException - if the parameter name does not refer names of query configured this exception is thrower.
      • getPackage

        List<Sql> getPackage​(String packageName)
        Retrieve all queries from package
        Parameters:
        packageName - name of package
        Returns:
        the list of queries that belong this package, if any one query ins't find a empty list is returned.
      • getPackageStartWith

        Map<String,​List<Sql>> getPackageStartWith​(String packageName)
        Retrieve all packages starting with packagetName.
        Parameters:
        packageName - name of package
        Returns:
        Map with found packages, where each key it is a package
      • containsQuery

        boolean containsQuery​(String name)
      • setSqlDialect

        void setSqlDialect​(SqlDialect sqlDialect)
      • close

        void close()
        Closes this SQL context. After close the SQL context the access to SQL is lost and retrieve a SQL QueryNotFoundException is throw.