SQLVisitor.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 terralib/ado/SQLVisitor.h
22 
23  \brief A visitor for building an SQL statement using ADO dialect.
24 */
25 
26 #ifndef __TERRALIB_ADO_INTERNAL_SQLVISITOR_H
27 #define __TERRALIB_ADO_INTERNAL_SQLVISITOR_H
28 
29 // TerraLib
30 #include "../dataaccess/query/SQLVisitor.h"
31 #include "Config.h"
32 
33 // Boost
34 #include <boost/noncopyable.hpp>
35 
36 // ADO
37 #import "msado15.dll" \
38  no_namespace rename("EOF", "EndOfFile")
39 
40 namespace te
41 {
42  namespace ado
43  {
44  /*!
45  \class SQLVisitor
46 
47  \brief A visitor for building an SQL statement using ADO dialect.
48  */
50  {
51  public:
52 
53  /** @name Initializer Methods
54  * Methods related to instantiation and destruction.
55  */
56  //@{
57 
58  /*! \brief Default constructor. */
59  SQLVisitor(const te::da::SQLDialect& dialect, std::string& sql, _ConnectionPtr conn);
60 
61  /*! \brief Destructor. */
63 
64  //@}
65 
66  /** @name Select
67  * All concrete visitors must implement these methods.
68  */
69  //@{
70 
71  void visit(const te::da::Function& visited);
72  void visit(const te::da::Fields& visited);
73  void visit(const te::da::JoinConditionOn& visited);
74  void visit(const te::da::LiteralByteArray& visited);
75  void visit(const te::da::LiteralDateTime& visited);
76  void visit(const te::da::LiteralEnvelope& visited);
77  void visit(const te::da::LiteralGeom& visited);
78  void visit(const te::da::PropertyName& visited);
79 
80  //@}
81 
82  private:
83 
84  _ConnectionPtr m_conn; //!< The ADO connection used to escape string!
85  };
86 
87  } // end namespace ado
88 } // end namespace te
89 
90 #endif // __TERRALIB_ADO_INTERNAL_SQLVISITOR_H
te::da::SQLVisitor
A visitor for building an SQL statement from a given Query hierarchy.
Definition: SQLVisitor.h:59
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::da::SQLDialect
It represents the SQL query dialect accepted by a given data source.
Definition: SQLDialect.h:56
te::ado::SQLVisitor::SQLVisitor
SQLVisitor(const te::da::SQLDialect &dialect, std::string &sql, _ConnectionPtr conn)
Default constructor.
te::da::LiteralDateTime
A class that models a literal for Date and Time values.
Definition: LiteralDateTime.h:49
te::ado::SQLVisitor::m_conn
_ConnectionPtr m_conn
The ADO connection used to escape string!
Definition: SQLVisitor.h:84
te::ado::SQLVisitor::visit
void visit(const te::da::LiteralByteArray &visited)
te::ado::SQLVisitor
A visitor for building an SQL statement using ADO dialect.
Definition: SQLVisitor.h:50
te::da::Fields
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers.
Definition: Fields.h:37
te::da::PropertyName
A class that models the name of any property of an object.
Definition: PropertyName.h:51
te::da::Function
A class that models a Function expression.
Definition: Function.h:48
te::ado::SQLVisitor::visit
void visit(const te::da::PropertyName &visited)
te::ado::SQLVisitor::~SQLVisitor
~SQLVisitor()
Destructor.
Definition: SQLVisitor.h:62
te::ado::SQLVisitor::visit
void visit(const te::da::Fields &visited)
te::ado::SQLVisitor::visit
void visit(const te::da::LiteralDateTime &visited)
te::ado::SQLVisitor::visit
void visit(const te::da::Function &visited)
te::da::LiteralGeom
A class that models a literal for Geometry values.
Definition: LiteralGeom.h:47
te::ado::SQLVisitor::visit
void visit(const te::da::LiteralEnvelope &visited)
te::ado::SQLVisitor::visit
void visit(const te::da::LiteralGeom &visited)
TEADOEXPORT
#define TEADOEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:130
Config.h
Proxy configuration file for TerraView (see terraview_config.h).
te::da::LiteralEnvelope
A class that models a literal for Envelope values.
Definition: LiteralEnvelope.h:50
te::da::JoinConditionOn
JoinConditionOn is a boolean expression and it specifies which items in a join are considered to matc...
Definition: JoinConditionOn.h:50
te::da::LiteralByteArray
A class that models a literal for ByteArray values.
Definition: LiteralByteArray.h:49
te::ado::SQLVisitor::visit
void visit(const te::da::JoinConditionOn &visited)