C# 클래스 Azavea.Open.DAO.PostgreSQL.PostgreSqlDaLayer

Implements a FastDao layer customized for PostGreSQL (optionally with PostGIS installed).
상속: Azavea.Open.DAO.SQL.SqlDaDdlLayer
파일 보기 프로젝트 열기: azavea/net-dao-postgresql

공개 메소드들

메소드 설명
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