BasicQueries.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20  /*!
21  \file terralin/vp/AbstractDataHandler.h
22 
23  \brief This class represents handler to help reading and writing data from/to a dataSource by dividing it into smaller groups
24  */
25 
26 #ifndef __TERRALIB_VP_INTERNAL_BASICQUERIES_H
27 #define __TERRALIB_VP_INTERNAL_BASICQUERIES_H
28 
29 #include "../Config.h"
30 
31 #include <memory>
32 #include <string>
33 #include <vector>
34 
35 namespace te
36 {
37  namespace dt
38  {
39  class AbstractData;
40  }
41 
42  namespace da
43  {
44  class Select;
45 
47  {
48  BasicQueries() = delete;
49  ~BasicQueries() = delete;
50 
51  public:
52 
53  /*! \brief Helper function to create a query from the given parameters.
54  \param distinct TRUE if distinct clause must be added. FALSE otherwise
55  \param vecColumns A vector containing the columns to be added to the query
56  \param tableName The name of the table to be queried
57  \param vecWhereColumns A vector containing all the columns in the where clause
58  \param vecWhereValues A vector containing all the values in the where clause
59  \return An query resulting from the given parameters
60  */
61  TEDATAACCESSEXPORT static std::unique_ptr<te::da::Select> GetQuery(
62  bool distinct,
63  const std::vector<std::string>& vecColumns,
64  const std::string& tableName,
65  const std::vector<std::string>& vecWhereColumns,
66  const std::vector<std::unique_ptr<te::dt::AbstractData>>& vecWhereValues);
67 
68 
69  /*! \brief Helper function to create a query from the given parameters.
70  \param distinct TRUE if distinct clause must be added. FALSE otherwise
71  \param vecColumns A vector containing the columns to be added to the query
72  \param tableName The name of the table to be queried
73  \return An query resulting from the given parameters
74  */
75  TEDATAACCESSEXPORT static std::unique_ptr<te::da::Select> GetQuery(
76  bool distinct,
77  const std::vector<std::string>& vecColumns,
78  const std::string& tableName);
79  };
80  }
81 }
82 
83 #endif //__TERRALIB_VP_INTERNAL_BASICQUERIES_H
TerraLib.
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:97
static TEDATAACCESSEXPORT std::unique_ptr< te::da::Select > GetQuery(bool distinct, const std::vector< std::string > &vecColumns, const std::string &tableName, const std::vector< std::string > &vecWhereColumns, const std::vector< std::unique_ptr< te::dt::AbstractData >> &vecWhereValues)
Helper function to create a query from the given parameters.