kexi

KexiDB::AlterTableHandler::InsertFieldAction Class Reference

#include <alter.h>

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

Public Member Functions

 InsertFieldAction (int fieldIndex, KexiDB::Field *newField, int uid)
 InsertFieldAction (const InsertFieldAction &action)
 InsertFieldAction (bool)
int index () const
void setIndex (int index)
KexiDB::Field & field () const
void setField (KexiDB::Field *field)
virtual TQString debugString (const DebugOptions &debugOptions=DebugOptions())
virtual void simplifyActions (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
virtual bool shouldBeRemoved (ActionDictDict &fieldActions)

Protected Attributes

int m_index
Protected Attributes inherited from KexiDB::AlterTableHandler::FieldActionBase
int m_fieldUID

Detailed Description

Defines an action for inserting a single table field.

Definition at line 322 of file alter.h.

Constructor & Destructor Documentation

◆ InsertFieldAction() [1/3]

AlterTableHandler::InsertFieldAction::InsertFieldAction ( int fieldIndex,
KexiDB::Field * newField,
int uid )

Definition at line 539 of file alter.cpp.

◆ InsertFieldAction() [2/3]

AlterTableHandler::InsertFieldAction::InsertFieldAction ( const InsertFieldAction & action)

Definition at line 548 of file alter.cpp.

◆ InsertFieldAction() [3/3]

AlterTableHandler::InsertFieldAction::InsertFieldAction ( bool )

Definition at line 555 of file alter.cpp.

◆ ~InsertFieldAction()

AlterTableHandler::InsertFieldAction::~InsertFieldAction ( )
virtual

Definition at line 562 of file alter.cpp.

Member Function Documentation

◆ debugString()

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

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 583 of file alter.cpp.

◆ execute()

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

Performs physical execution of this action.

Todo

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 678 of file alter.cpp.

◆ field()

KexiDB::Field & KexiDB::AlterTableHandler::InsertFieldAction::field ( ) const
inline

Definition at line 332 of file alter.h.

◆ index()

int KexiDB::AlterTableHandler::InsertFieldAction::index ( ) const
inline

Definition at line 330 of file alter.h.

◆ setField()

void AlterTableHandler::InsertFieldAction::setField ( KexiDB::Field * field)

Definition at line 567 of file alter.cpp.

◆ setIndex()

void KexiDB::AlterTableHandler::InsertFieldAction::setIndex ( int index)
inline

Definition at line 331 of file alter.h.

◆ simplifyActions()

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

Legend: A,B==fields, P==property, [....]==action, (..,..,..) group of actions, <...> internal operation.

Case 1: there are "change property" actions after the Insert action. -> change the properties in the Insert action itself and remove the "change property" actions. Examples: [Insert A] && [rename A to B] => [Insert B] [Insert A] && [change property P in field A] => [Insert A with P altered] Comment: we need to do this reduction because otherwise we'd need to do psyhical altering right after [Insert A] if [rename A to B] follows.

Todo
not checked

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 606 of file alter.cpp.

◆ updateAlteringRequirements()

void AlterTableHandler::InsertFieldAction::updateAlteringRequirements ( )
protectedvirtual
Todo
sometimes add DataConversionRequired (e.g. when relationships require removing orphaned records) ?
Todo

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 575 of file alter.cpp.

◆ updateTableSchema()

tristate AlterTableHandler::InsertFieldAction::updateTableSchema ( TableSchema & table,
Field * field,
TQMap< TQString, TQString > & fieldMap )
virtual
Todo
add it only when there should be fixed value (e.g. default) set for this new field...

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 667 of file alter.cpp.

Member Data Documentation

◆ m_index

int KexiDB::AlterTableHandler::InsertFieldAction::m_index
protected

Definition at line 347 of file alter.h.


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