28 #include "../../../common/StringUtils.h" 29 #include "../../../core/translator/Translator.h" 30 #include "../../../dataaccess/dataset/DataSetType.h" 31 #include "../../../dataaccess/dataset/ForeignKey.h" 32 #include "../../../dataaccess/dataset/Index.h" 33 #include "../../../dataaccess/dataset/PrimaryKey.h" 34 #include "../../../dataaccess/datasource/DataSource.h" 35 #include "../../../dataaccess/query_h.h" 36 #include "../../../dataaccess/Enums.h" 37 #include "../../../datatype/SimpleProperty.h" 38 #include "../../../datatype/StringProperty.h" 39 #include "../../../geometry/GeometryProperty.h" 40 #include "../../../memory/DataSet.h" 41 #include "../../../memory/DataSetItem.h" 42 #include "../../core/EdgeProperty.h" 43 #include "../../core/VertexProperty.h" 44 #include "../../Config.h" 45 #include "../../Exception.h" 46 #include "../../Globals.h" 146 std::string propertyName = p->
getName();
180 std::string propertyName = p->
getName();
212 dt->
add(prop_tableName);
246 dt->
add(prop_graphId);
256 dt->
add(prop_column);
276 idxName +=
"_attr_idx";
297 dt->
add(prop_edgeId);
327 std::string pkName = tableName;
331 pk->
add(prop_edgeId);
334 std::string idxEdge = tableName;
335 idxEdge +=
"_edge_idx";
337 indexEdge->
add(prop_edgeId);
339 std::string idxVFrom = tableName;
340 idxVFrom +=
"_vfrom_idx";
342 indexVFrom->
add(prop_vFrom);
344 std::string idxVTo = tableName;
345 idxVTo +=
"_vto_idx";
347 indexVTo->
add(prop_vTo);
352 std::string idxSpatial = tableName;
353 idxSpatial +=
"_spatial_idx";
391 std::string pkName = tableName;
397 std::string idxName = tableName;
405 std::string idxSpatial = tableName;
406 idxSpatial +=
"_spatial_idx";
427 std::map<std::string, std::string> options;
446 std::unique_ptr<te::mem::DataSet> dsMem(
new te::mem::DataSet(dsType.get()));
468 std::map<std::string, std::string> options;
470 dsMem->moveBeforeFirst();
513 std::unique_ptr<te::mem::DataSet> dsMem(
new te::mem::DataSet(dsType.get()));
525 std::map<std::string, std::string> options;
545 std::string idxSpatial = tableName;
546 idxSpatial +=
"_spatial_idx";
551 std::map<std::string, std::string> options;
567 fields->push_back(f);
582 std::unique_ptr<te::da::DataSet> dataset =
m_ds->
query(select);
584 if(dataset->moveNext())
607 fields->push_back(f);
622 std::unique_ptr<te::da::DataSet> dataset =
m_ds->
query(select);
624 while(dataset->moveNext())
645 std::unique_ptr<te::dt::Property>
p =
m_ds->
getProperty(tableName, columnName);
655 std::unique_ptr<te::dt::Property>
p =
m_ds->
getProperty(tableName, columnName);
666 fields->push_back(f);
680 std::unique_ptr<te::da::DataSet> dataset =
m_ds->
query(select);
682 if(dataset->moveNext())
void setAutoNumber(bool a)
It tells if the property is an autonumber or not.
virtual void dropProperty(const std::string &datasetName, const std::string &name)
It removes a property from the given dataset.
void add(te::dt::Property *p)
It adds a property to the list of properties of the primary key.
An abstract class that models a source of data in a query.
The Field class can be used to model an expression that takes part of the output items of a SELECT...
static const std::string sm_tableVertexModelAttrId
Attribute id.
An atomic property like an integer or double.
static const std::string sm_tableAttributeAttrId
Attribute Id.
A class that models the name of a dataset used in a From clause.
std::string Convert2LCase(const std::string &value)
It converts a string to lower case.
A class that models the name of any property of an object.
Base exception class for plugin module.
A class that models the description of a dataset.
virtual void createDataSet(DataSetType *dt, const std::map< std::string, std::string > &options)
It creates the dataset schema definition in the target data source.
void setSize(std::size_t s)
It sets the maximum number of characters for a varying string, or the number of characters for a fixe...
virtual void add(const std::string &datasetName, DataSet *d, const std::map< std::string, std::string > &options, std::size_t limit=0)
It adds data items to the dataset in the data source.
virtual std::unique_ptr< te::dt::Property > getProperty(const std::string &datasetName, const std::string &name)
It retrieves the property with the given name from the dataset.
void add(te::dt::Property *p)
It adds the property to the list of properties of the index.
static const std::string sm_tableGraphAttrName
Attribute Name.
static te::dt::Date ds(2010, 01, 01)
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
#define TE_TR(message)
It marks a string in order to get translated.
virtual Property * clone() const =0
It returns a clone of the object.
static const std::string sm_tableGraphName
Database Model Table Graph Name.
It models a property definition.
static const std::string sm_tableAttributeAttrGraphId
Attribute Graph Id.
virtual std::unique_ptr< DataSet > query(const Select &q, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess)
It executes a query that may return some data using a generic query. This method always returns a dis...
void setInt32(std::size_t i, boost::int32_t value)
It sets the value of the i-th property.
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver...
static const std::string sm_tableGraphAttrType
Attribute Type.
static const std::string sm_tableEdgeModelAttrId
Attribute Id.
static const std::string sm_tableAttributeAttrColumn
Attribute Column.
static const std::string sm_tableGraphAttrTableName
Attribute Table Name.
static te::dt::TimeDuration dt(20, 30, 50, 11)
static const std::string sm_tableGraphAttrId
Attribute Id.
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers.
A class that can be used to model a filter expression that can be applied to a query.
The type for string types: FIXED_STRING, VAR_STRING or STRING.
static const std::string sm_tableAttributeAttrLink
Attribute Link.
static const std::string sm_tableGraphAttrDesc
Attribute Description.
virtual std::unique_ptr< te::da::DataSetType > getDataSetType(const std::string &name)
It gets information about the given dataset.
A Select models a query to be used when retrieving data from a DataSource.
boost::ptr_vector< FromItem > From
It models the FROM clause for a query.
int getType() const
It returns the property data type.
void add(Constraint *c)
It adds a new constraint.
virtual bool dataSetExists(const std::string &name)
It checks if a dataset with the given name exists in the data source.
An implementation of the DatasetItem class for the TerraLib In-Memory Data Access driver...
static const std::string sm_tableAttributeName
Database Model Table Attribute Name.
It describes a primary key (pk) constraint.
It models the comparison operator.
virtual void addIndex(const std::string &datasetName, Index *idx, const std::map< std::string, std::string > &options)
It adds an index to the dataset.
void setString(std::size_t i, const std::string &value)
It sets the value of the i-th property.
static const std::string sm_tableEdgeModelAttrVFrom
Attribute Vertex From.
static const std::string sm_tableVertexAttributeModelSufixName
Database Model Vertex Attribute Model Table Name.
static const std::string sm_tableEdgeModelAttrVTo
Attribute Vertex To.
static const std::string sm_tableAttributeAttrTable
Attribute Table.
static const std::string sm_tableEdgeModelSufixName
Database Model Edge Model Table Name.
It describes an index associated to a DataSetType.
virtual void addProperty(const std::string &datasetName, te::dt::Property *p)
It adds a new property to the dataset schema.
This class models a string Literal value.
static const std::string sm_tableAttributeAttrType
Attribute Type.
const std::string & getName() const
It returns the property name.
void setParent(Property *p)
It associate this property to the informed parent.