kexi

KexiDB::AlterTableHandler::ChangeFieldPropertyAction Class Reference

#include <alter.h>

Inheritance diagram for KexiDB::AlterTableHandler::ChangeFieldPropertyAction:
KexiDB::AlterTableHandler::FieldActionBase KexiDB::AlterTableHandler::ActionBase

Public Member Functions

 ChangeFieldPropertyAction (const TQString &fieldName, const TQString &propertyName, const TQVariant &newValue, int uid)
 ChangeFieldPropertyAction (bool null)
TQString propertyName () const
TQVariant newValue () const
virtual TQString debugString (const DebugOptions &debugOptions=DebugOptions())
virtual void simplifyActions (ActionDictDict &fieldActions)
virtual bool shouldBeRemoved (ActionDictDict &fieldActions)
virtual tristate updateTableSchema (TableSchema &table, Field *field, TQMap< TQString, TQString > &fieldMap)
Public Member Functions inherited from KexiDB::AlterTableHandler::FieldActionBase
 FieldActionBase (const TQString &fieldName, int uid)
 FieldActionBase (bool)
TQString fieldName () const
int uid () const
void setFieldName (const TQString &fieldName)
Public Member Functions inherited from KexiDB::AlterTableHandler::ActionBase
 ActionBase (bool null=false)
ChangeFieldPropertyAction & toChangeFieldPropertyAction ()
RemoveFieldAction & toRemoveFieldAction ()
InsertFieldAction & toInsertFieldAction ()
MoveFieldPositionAction & toMoveFieldPositionAction ()
bool isNull () const
void debug (const DebugOptions &debugOptions=DebugOptions())

Protected Member Functions

virtual void updateAlteringRequirements ()
virtual tristate execute (Connection &conn, TableSchema &table)
Protected Member Functions inherited from KexiDB::AlterTableHandler::ActionBase
void setAlteringRequirements (int alteringRequirements)
int alteringRequirements () const

Protected Attributes

TQString m_propertyName
TQVariant m_newValue
Protected Attributes inherited from KexiDB::AlterTableHandler::FieldActionBase
int m_fieldUID

Detailed Description

Defines an action for changing a single property value of a table field. Supported properties are currently: "name", "type", "caption", "description", "unsigned", "length", "precision", "width", "defaultValue", "primaryKey", "unique", "notNull", "allowEmpty", "autoIncrement", "indexed", "visibleDecimalPlaces"

More to come.

Definition at line 271 of file alter.h.

Constructor & Destructor Documentation

◆ ChangeFieldPropertyAction() [1/2]

AlterTableHandler::ChangeFieldPropertyAction::ChangeFieldPropertyAction ( const TQString & fieldName,
const TQString & propertyName,
const TQVariant & newValue,
int uid )

Definition at line 191 of file alter.cpp.

◆ ChangeFieldPropertyAction() [2/2]

AlterTableHandler::ChangeFieldPropertyAction::ChangeFieldPropertyAction ( bool null)

Definition at line 199 of file alter.cpp.

◆ ~ChangeFieldPropertyAction()

AlterTableHandler::ChangeFieldPropertyAction::~ChangeFieldPropertyAction ( )
virtual

Definition at line 204 of file alter.cpp.

Member Function Documentation

◆ debugString()

TQString AlterTableHandler::ChangeFieldPropertyAction::debugString ( const DebugOptions & debugOptions = DebugOptions())
virtual

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 214 of file alter.cpp.

◆ execute()

tristate AlterTableHandler::ChangeFieldPropertyAction::execute ( Connection & conn,
TableSchema & table )
protectedvirtual

Performs physical execution of this action.

Many of the properties must be applied using a separate algorithm.

Todo
errmsg
Todo

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 413 of file alter.cpp.

◆ newValue()

TQVariant KexiDB::AlterTableHandler::ChangeFieldPropertyAction::newValue ( ) const
inline

Definition at line 280 of file alter.h.

◆ propertyName()

TQString KexiDB::AlterTableHandler::ChangeFieldPropertyAction::propertyName ( ) const
inline

Definition at line 279 of file alter.h.

◆ shouldBeRemoved()

bool AlterTableHandler::ChangeFieldPropertyAction::shouldBeRemoved ( ActionDictDict & fieldActions)
virtual

After calling simplifyActions() for each action, shouldBeRemoved() is called for them as an additional step. This is used for ChangeFieldPropertyAction items so actions that do not change property values are removed.

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 385 of file alter.cpp.

◆ simplifyActions()

void AlterTableHandler::ChangeFieldPropertyAction::simplifyActions ( ActionDictDict & fieldActions)
virtual

Legend: A,B==fields, P==property, [....]==action, (..,..,..) group of actions, <...> internal operation. Case 1. (special) when new action=[rename A to B] and exists=[rename B to C] => remove [rename B to C] and set result to new [rename A to C] and go to 1b. Case 1b. when new action=[rename A to B] and actions exist like [set property P to C in field B] or like [delete field B] or like [move field B] => change B to A for all these actions Case 2. when new action=[change property in field A] (property != name) and exists=[remove A] or exists=[change property in field A] => do not add [change property in field A] because it will be removed anyway or the property will change

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 312 of file alter.cpp.

◆ updateAlteringRequirements()

void AlterTableHandler::ChangeFieldPropertyAction::updateAlteringRequirements ( )
protectedvirtual

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 208 of file alter.cpp.

◆ updateTableSchema()

tristate AlterTableHandler::ChangeFieldPropertyAction::updateTableSchema ( TableSchema & table,
Field * field,
TQMap< TQString, TQString > & fieldMap )
virtual

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 391 of file alter.cpp.

Member Data Documentation

◆ m_newValue

TQVariant KexiDB::AlterTableHandler::ChangeFieldPropertyAction::m_newValue
protected

Definition at line 297 of file alter.h.

◆ m_propertyName

TQString KexiDB::AlterTableHandler::ChangeFieldPropertyAction::m_propertyName
protected

Definition at line 296 of file alter.h.


The documentation for this class was generated from the following files: