KDbAlterTableHandler::ChangeFieldPropertyAction
#include <KDbAlter.h>
Protected Member Functions | |
ChangeFieldPropertyAction (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) |
Protected Attributes | |
QVariant | m_newValue |
QString | m_propertyName |
Protected Attributes inherited from KDbAlterTableHandler::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", "maxLength", "precision", "defaultWidth", "defaultValue", "primaryKey", "unique", "notNull", "allowEmpty", "autoIncrement", "indexed", "visibleDecimalPlaces"
More to come.
Definition at line 295 of file KDbAlter.h.
Constructor & Destructor Documentation
◆ ChangeFieldPropertyAction() [1/3]
KDbAlterTableHandler::ChangeFieldPropertyAction::ChangeFieldPropertyAction | ( | const QString & | fieldName, |
const QString & | propertyName, | ||
const QVariant & | newValue, | ||
int | uid ) |
Definition at line 194 of file KDbAlter.cpp.
◆ ChangeFieldPropertyAction() [2/3]
KDbAlterTableHandler::ChangeFieldPropertyAction::ChangeFieldPropertyAction | ( | ) |
Creates null action.
Definition at line 202 of file KDbAlter.cpp.
◆ ~ChangeFieldPropertyAction()
|
override |
Definition at line 212 of file KDbAlter.cpp.
◆ ChangeFieldPropertyAction() [3/3]
|
explicitprotected |
, used for constructing null action
Definition at line 207 of file KDbAlter.cpp.
Member Function Documentation
◆ debugString()
|
overridevirtual |
Reimplemented from KDbAlterTableHandler::ActionBase.
Definition at line 221 of file KDbAlter.cpp.
◆ execute()
|
overrideprotectedvirtual |
Performs physical execution of this action.
Many of the properties must be applied using a separate algorithm.
- Todo
- errmsg
Reimplemented from KDbAlterTableHandler::ActionBase.
Definition at line 422 of file KDbAlter.cpp.
◆ newValue()
|
inline |
Definition at line 309 of file KDbAlter.h.
◆ propertyName()
|
inline |
Definition at line 306 of file KDbAlter.h.
◆ shouldBeRemoved()
|
overridevirtual |
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 KDbAlterTableHandler::ActionBase.
Definition at line 394 of file KDbAlter.cpp.
◆ simplifyActions()
|
overridevirtual |
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 KDbAlterTableHandler::ActionBase.
Definition at line 325 of file KDbAlter.cpp.
◆ updateAlteringRequirements()
|
overrideprotectedvirtual |
Reimplemented from KDbAlterTableHandler::ActionBase.
Definition at line 216 of file KDbAlter.cpp.
◆ updateTableSchema()
|
overridevirtual |
Reimplemented from KDbAlterTableHandler::ActionBase.
Definition at line 400 of file KDbAlter.cpp.
Member Data Documentation
◆ m_newValue
|
protected |
Definition at line 331 of file KDbAlter.h.
◆ m_propertyName
|
protected |
Definition at line 330 of file KDbAlter.h.
The documentation for this class was generated from the following files:
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.