C# Класс Azavea.Open.DAO.PostgreSQL.PostgreSqlDaLayer

Implements a FastDao layer customized for PostGreSQL (optionally with PostGIS installed).
Наследование: Azavea.Open.DAO.SQL.SqlDaDdlLayer
Показать файл Открыть проект

Открытые методы

Метод Описание
CreateGeometry ( object input ) : object

Creates a geometry object from the string input.

CreateQuery ( ClassMapping mapping, DaoCriteria crit ) : IDaQuery
PostgreSqlDaLayer ( PostgreSqlDescriptor connDesc ) : System

Construct the layer. Should typically be called only by the appropriate ConnectionDescriptor.

Защищенные методы

Метод Описание
AddColDefinition ( StringBuilder sb, string col, ClassMapping mapping, string separator, ICollection extraStatements ) : bool

Add the definition for the given column to the create table statement.

ExpressionToQuery ( SqlDaQuery queryToAddTo, IExpression expr, ClassMapping mapping, string colPrefix, string booleanOperator ) : bool

Converts a single Expression to SQL (mapping the columns as appropriate) and appends to the given string builder. The expression's SQL will already be wrapped in parends, so you do not need to add them here.

GetAsciiStringType ( ) : string

PostgreSQL encoding is specified by the database not by the column, so we just use TEXT again.

GetAutoType ( Type baseType ) : string

Returns the DDL for the type of an automatically incrementing column. Some databases only store autonums in one col type so baseType may be ignored.

GetBooleanType ( ) : string

Returns the SQL type used to store a boolean in the DB.

GetByteArrayType ( ) : string

Returns the SQL type used to store a byte array in the DB.

GetLongType ( ) : string

Returns the SQL type used to store a long in the DB.

GetStringType ( ) : string

Returns the SQL type used to store a "normal" (unicode) string in the DB.

PreProcessPropertyValues ( string table, object>.IDictionary propValues ) : void

Overriden to convert IGeometries to correctly-encoded strings that PostGIS can recognize. This is called prior to inserting or updating these values in the table.

Описание методов

AddColDefinition() защищенный Метод

Add the definition for the given column to the create table statement.
protected AddColDefinition ( StringBuilder sb, string col, ClassMapping mapping, string separator, ICollection extraStatements ) : bool
sb StringBuilder Current create table statement to append to.
col string Name of the column to add a definition for.
mapping ClassMapping Classmapping we're creating a table for.
separator string Separator to use before appending to sb.
extraStatements ICollection If adding this column requires any additional /// SQL statements to be run afterwards, put them here.
Результат bool

CreateGeometry() публичный Метод

Creates a geometry object from the string input.
public CreateGeometry ( object input ) : object
input object An "e" well known text string.
Результат object

CreateQuery() публичный Метод

public CreateQuery ( ClassMapping mapping, DaoCriteria crit ) : IDaQuery
mapping ClassMapping
crit Azavea.Open.DAO.Criteria.DaoCriteria
Результат IDaQuery

ExpressionToQuery() защищенный Метод

Converts a single Expression to SQL (mapping the columns as appropriate) and appends to the given string builder. The expression's SQL will already be wrapped in parends, so you do not need to add them here.
protected ExpressionToQuery ( SqlDaQuery queryToAddTo, IExpression expr, ClassMapping mapping, string colPrefix, string booleanOperator ) : bool
queryToAddTo Azavea.Open.DAO.SQL.SqlDaQuery Query we're adding the expression to.
expr IExpression The expression. NOTE: It should NOT be null. This method does not check.
mapping ClassMapping Class mapping for the class we're dealing with.
colPrefix string What to prefix column names with, I.E. "Table." for "Table.Column". /// May be null if no prefix is desired. May be something other than /// the table name if the tables are being aliased.
booleanOperator string The boolean operator (AND or OR) to insert before /// this expression. Blank ("") if we don't need one.
Результат bool

GetAsciiStringType() защищенный Метод

PostgreSQL encoding is specified by the database not by the column, so we just use TEXT again.
protected GetAsciiStringType ( ) : string
Результат string

GetAutoType() защищенный Метод

Returns the DDL for the type of an automatically incrementing column. Some databases only store autonums in one col type so baseType may be ignored.
protected GetAutoType ( Type baseType ) : string
baseType System.Type The data type of the column (nominally).
Результат string

GetBooleanType() защищенный Метод

Returns the SQL type used to store a boolean in the DB.
protected GetBooleanType ( ) : string
Результат string

GetByteArrayType() защищенный Метод

Returns the SQL type used to store a byte array in the DB.
protected GetByteArrayType ( ) : string
Результат string

GetLongType() защищенный Метод

Returns the SQL type used to store a long in the DB.
protected GetLongType ( ) : string
Результат string

GetStringType() защищенный Метод

Returns the SQL type used to store a "normal" (unicode) string in the DB.
protected GetStringType ( ) : string
Результат string

PostgreSqlDaLayer() публичный Метод

Construct the layer. Should typically be called only by the appropriate ConnectionDescriptor.
public PostgreSqlDaLayer ( PostgreSqlDescriptor connDesc ) : System
connDesc PostgreSqlDescriptor Connection to the PostGreSQL / PostGIS DB we'll be using.
Результат System

PreProcessPropertyValues() защищенный Метод

Overriden to convert IGeometries to correctly-encoded strings that PostGIS can recognize. This is called prior to inserting or updating these values in the table.
protected PreProcessPropertyValues ( string table, object>.IDictionary propValues ) : void
table string The table these values will be inserted or updated into.
propValues object>.IDictionary A dictionary of "column"/value pairs for the object to insert or update.
Результат void