KDbAlterTableHandler::InsertFieldAction

Search for usage in LXR

KDbAlterTableHandler::InsertFieldAction Class Reference

#include <KDbAlter.h>

Inheritance diagram for KDbAlterTableHandler::InsertFieldAction:

Public Member Functions

 InsertFieldAction ()
 
 InsertFieldAction (const InsertFieldAction &action)
 
 InsertFieldAction (int fieldIndex, KDbField *newField, int uid)
 
QString debugString (const DebugOptions &debugOptions=DebugOptions()) override
 
const KDbFieldfield () const
 
int index () const
 
void setField (KDbField *field)
 
void setIndex (int index)
 
void simplifyActions (ActionDictDict *fieldActions) override
 
tristate updateTableSchema (KDbTableSchema *table, KDbField *field, QHash< QString, QString > *fieldHash) override
 
- Public Member Functions inherited from KDbAlterTableHandler::FieldActionBase
 FieldActionBase (const QString &fieldName, int uid)
 
QString fieldName () const
 
void setFieldName (const QString &fieldName)
 
int uid () const
 
- Public Member Functions inherited from KDbAlterTableHandler::ActionBase
void debug (const DebugOptions &debugOptions=DebugOptions())
 
bool isNull () const
 
ChangeFieldPropertyActiontoChangeFieldPropertyAction ()
 
InsertFieldActiontoInsertFieldAction ()
 
MoveFieldPositionActiontoMoveFieldPositionAction ()
 
RemoveFieldActiontoRemoveFieldAction ()
 

Protected Member Functions

 InsertFieldAction (bool null)
 
tristate execute (KDbConnection *conn, KDbTableSchema *table) override
 
void updateAlteringRequirements () override
 
- Protected Member Functions inherited from KDbAlterTableHandler::FieldActionBase
 FieldActionBase (bool null)
 
- Protected Member Functions inherited from KDbAlterTableHandler::ActionBase
 ActionBase (bool null)
 
int alteringRequirements () const
 
void setAlteringRequirements (int alteringRequirements)
 
virtual bool shouldBeRemoved (ActionDictDict *fieldActions)
 

Protected Attributes

int m_index
 
- Protected Attributes inherited from KDbAlterTableHandler::FieldActionBase
int m_fieldUID
 

Detailed Description

Defines an action for inserting a single table field.

Definition at line 360 of file KDbAlter.h.

Constructor & Destructor Documentation

◆ InsertFieldAction() [1/4]

KDbAlterTableHandler::InsertFieldAction::InsertFieldAction ( int fieldIndex,
KDbField * newField,
int uid )

Definition at line 550 of file KDbAlter.cpp.

◆ InsertFieldAction() [2/4]

KDbAlterTableHandler::InsertFieldAction::InsertFieldAction ( const InsertFieldAction & action)

copy ctor

Definition at line 559 of file KDbAlter.cpp.

◆ InsertFieldAction() [3/4]

KDbAlterTableHandler::InsertFieldAction::InsertFieldAction ( )

Creates null action.

Definition at line 566 of file KDbAlter.cpp.

◆ ~InsertFieldAction()

KDbAlterTableHandler::InsertFieldAction::~InsertFieldAction ( )
override

Definition at line 578 of file KDbAlter.cpp.

◆ InsertFieldAction() [4/4]

KDbAlterTableHandler::InsertFieldAction::InsertFieldAction ( bool null)
explicitprotected

, used for constructing null action

Definition at line 571 of file KDbAlter.cpp.

Member Function Documentation

◆ debugString()

QString KDbAlterTableHandler::InsertFieldAction::debugString ( const DebugOptions & debugOptions = DebugOptions())
overridevirtual

Reimplemented from KDbAlterTableHandler::ActionBase.

Definition at line 599 of file KDbAlter.cpp.

◆ execute()

tristate KDbAlterTableHandler::InsertFieldAction::execute ( KDbConnection * conn,
KDbTableSchema * table )
overrideprotectedvirtual

Performs physical execution of this action.

Todo

Reimplemented from KDbAlterTableHandler::ActionBase.

Definition at line 703 of file KDbAlter.cpp.

◆ field()

const KDbField * KDbAlterTableHandler::InsertFieldAction::field ( ) const
inline

Definition at line 379 of file KDbAlter.h.

◆ index()

int KDbAlterTableHandler::InsertFieldAction::index ( ) const
inline

Definition at line 373 of file KDbAlter.h.

◆ setField()

void KDbAlterTableHandler::InsertFieldAction::setField ( KDbField * field)

Definition at line 583 of file KDbAlter.cpp.

◆ setIndex()

void KDbAlterTableHandler::InsertFieldAction::setIndex ( int index)
inline

Definition at line 376 of file KDbAlter.h.

◆ simplifyActions()

void KDbAlterTableHandler::InsertFieldAction::simplifyActions ( ActionDictDict * fieldActions)
overridevirtual

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 KDbAlterTableHandler::ActionBase.

Definition at line 624 of file KDbAlter.cpp.

◆ updateAlteringRequirements()

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

Reimplemented from KDbAlterTableHandler::ActionBase.

Definition at line 591 of file KDbAlter.cpp.

◆ updateTableSchema()

tristate KDbAlterTableHandler::InsertFieldAction::updateTableSchema ( KDbTableSchema * table,
KDbField * field,
QHash< QString, QString > * fieldHash )
overridevirtual
Todo
add it only when there should be fixed value (e.g. default) set for this new field...

Reimplemented from KDbAlterTableHandler::ActionBase.

Definition at line 692 of file KDbAlter.cpp.

Member Data Documentation

◆ m_index

int KDbAlterTableHandler::InsertFieldAction::m_index
protected

Definition at line 399 of file KDbAlter.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.