C# Class Azavea.Open.DAO.PostgreSQL.PostgreSqlDaLayer

Implements a FastDao layer customized for PostGreSQL (optionally with PostGIS installed).
Inheritance: Azavea.Open.DAO.SQL.SqlDaDdlLayer
Afficher le fichier Open project: azavea/net-dao-postgresql

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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.

Method Details

AddColDefinition() protected méthode

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.
Résultat bool

CreateGeometry() public méthode

Creates a geometry object from the string input.
public CreateGeometry ( object input ) : object
input object An "e" well known text string.
Résultat object

CreateQuery() public méthode

public CreateQuery ( ClassMapping mapping, DaoCriteria crit ) : IDaQuery
mapping ClassMapping
crit Azavea.Open.DAO.Criteria.DaoCriteria
Résultat IDaQuery

ExpressionToQuery() protected méthode

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.
Résultat bool

GetAsciiStringType() protected méthode

PostgreSQL encoding is specified by the database not by the column, so we just use TEXT again.
protected GetAsciiStringType ( ) : string
Résultat string

GetAutoType() protected méthode

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).
Résultat string

GetBooleanType() protected méthode

Returns the SQL type used to store a boolean in the DB.
protected GetBooleanType ( ) : string
Résultat string

GetByteArrayType() protected méthode

Returns the SQL type used to store a byte array in the DB.
protected GetByteArrayType ( ) : string
Résultat string

GetLongType() protected méthode

Returns the SQL type used to store a long in the DB.
protected GetLongType ( ) : string
Résultat string

GetStringType() protected méthode

Returns the SQL type used to store a "normal" (unicode) string in the DB.
protected GetStringType ( ) : string
Résultat string

PostgreSqlDaLayer() public méthode

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.
Résultat System

PreProcessPropertyValues() protected méthode

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.
Résultat void