- Home
- About
- Testimonials
- Demos
- Download
- Documentation
- Blogs
- Forum
- Support

Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml
Classes:
TDiscriminator
TInlineParameterMapParser
TParameterMap
TParameterProperty
TResultMap
TResultProperty
TSimpleDynamicParser
TSqlMapCacheKey
TSqlMapCacheModel
TSqlMapCacheTypes
TSqlMapDelete
TSqlMapInsert
TSqlMapSelectKey
TSqlMapStatement
TSqlMapUpdate
TSqlMapXmlConfigBuilder
TSqlMapXmlConfiguration
TSqlMapXmlMappingConfiguration
TSubMap

Keyword

# Class TDiscriminator

    TComponent
       |
       --TDiscriminator

The TDiscriminator corresponds to the <discriminator> tag within a <resultMap>.

TDiscriminator allows inheritance logic in SqlMap result mappings. SqlMap compares the data found in the discriminator column to the different <submap> values using the column value's string equivalence. When the string values matches a particular <submap>, SqlMap will use the <resultMap> defined by resultMapping property for loading the object data.

Since: 3.1
Author: Wei Zhuo <weizho[at]gmail[dot]com>

Method Summary
void | addSubMap ( TSubMap $subMap)
string | getColumn ()
int | getColumnIndex ()
TResultProperty | getMapping ()
mixed | getNullValue ()
TResultMap | getSubMap ( string $value)
void | getType ( string 0)
string | getTypeHandler ()
void | initialize ( TSqlMapManager $manager) Set the result maps for particular sub-mapping values.
void | initMapping ( TResultMap $resultMap) Copies the discriminator properties to a new TResultProperty.
void | setColumn ( string $value)
void | setColumnIndex ( int $value) The columnIndex attribute value is the index of the column in the ResultSet from which the value will be used to populate the object property.
void | setNullValue ( mixed $value)
string | setType ( mixed $value) The type attribute is used to explicitly specify the property type of the parameter to be set. If the attribute type is not set and the framework cannot otherwise determine the type, the type is assumed from the default value of the property.
void | setTypeHandler ( string $value)

Methods Inherited From TComponent

TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()

Method Details

## addSubMap

public void addSubMap | (TSubMap $subMap )

Input
TSubMap | $subMap | add new sub mapping.
Output
Exception

## getColumn

public string getColumn | ()

Output
string | the name of the column in the result set from which the value will be used to populate the property.
Exception

## getColumnIndex

public int getColumnIndex | ()

Output
int | index of the column in the ResultSet
Exception

## getMapping

public TResultProperty getMapping | ()

Output
TResultProperty | result property for the discriminator column.
Exception

## getNullValue

public mixed getNullValue | ()

Output
mixed | outgoing null value replacement.
Exception

## getSubMap

public TResultMap getSubMap | (string $value )

Input
string | $value | database value
Output
TResultMap | result mapping.
Exception

## getType

public void getType | (string 0 )

Input
string | 0 | property type of the parameter to be set.
Output
Exception

## getTypeHandler

public string getTypeHandler | ()

Output
string | custom type handler class name (may use namespace).
Exception

## initialize

public void initialize | (TSqlMapManager $manager )

Set the result maps for particular sub-mapping values.

Input
TSqlMapManager | $manager | sql map manager instance.
Output
Exception

## initMapping

public void initMapping | (TResultMap $resultMap )

Copies the discriminator properties to a new TResultProperty.

Input
TResultMap | $resultMap | result map holding the discriminator.
Output
Exception

## setColumn

public void setColumn | (string $value )

Input
string | $value | the name of the column in the result set from which the value will be used to populate the property.
Output
Exception

## setColumnIndex

public void setColumnIndex | (int $value )

The columnIndex attribute value is the index of the column in the ResultSet from which the value will be used to populate the object property.

Input
int | $value | index of the column in the ResultSet
Output
Exception

## setNullValue

public void setNullValue | (mixed $value )

Input
mixed | $value | outgoing null value replacement.
Output
Exception

## setType

public string setType | (mixed $value )

The type attribute is used to explicitly specify the property type of the parameter to be set. If the attribute type is not set and the framework cannot otherwise determine the type, the type is assumed from the default value of the property.

Input
mixed | $value |
Output
string | property type of the parameter to be set.
Exception

## setTypeHandler

public void setTypeHandler | (string $value )

Input
string | $value | custom type handler class name (may use namespace).
Output
Exception