Kexi API Documentation (2.0 alpha)

KexiDB::AlterTableHandler::InsertFieldAction Class Reference

#include <alter.h>

Inheritance diagram for KexiDB::AlterTableHandler::InsertFieldAction:

KexiDB::AlterTableHandler::FieldActionBase KexiDB::AlterTableHandler::ActionBase List of all members.

Detailed Description

Defines an action for inserting a single table field.

Definition at line 322 of file alter.h.

Public Member Functions

 InsertFieldAction (int fieldIndex, KexiDB::Field *newField, int uid)
 InsertFieldAction (const InsertFieldAction &action)
 InsertFieldAction (bool)
virtual ~InsertFieldAction ()
int index () const
void setIndex (int index)
KexiDB::Fieldfield () const
void setField (KexiDB::Field *field)
virtual QString debugString (const DebugOptions &debugOptions=DebugOptions())
virtual void simplifyActions (ActionDictDict &fieldActions)
virtual tristate updateTableSchema (TableSchema &table, Field *field, QMap< QString, QString > &fieldMap)

Protected Member Functions

virtual void updateAlteringRequirements ()
virtual tristate execute (Connection &conn, TableSchema &table)
 Performs physical execution of this action.

Protected Attributes

int m_index


Constructor & Destructor Documentation

AlterTableHandler::InsertFieldAction::InsertFieldAction int  fieldIndex,
KexiDB::Field newField,
int  uid
 

Definition at line 518 of file alter.cpp.

References setField().

AlterTableHandler::InsertFieldAction::InsertFieldAction const InsertFieldAction action  ) 
 

Definition at line 527 of file alter.cpp.

References field().

AlterTableHandler::InsertFieldAction::InsertFieldAction bool   ) 
 

Definition at line 534 of file alter.cpp.

AlterTableHandler::InsertFieldAction::~InsertFieldAction  )  [virtual]
 

Definition at line 541 of file alter.cpp.


Member Function Documentation

QString AlterTableHandler::InsertFieldAction::debugString const DebugOptions &  debugOptions = DebugOptions()  )  [virtual]
 

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 562 of file alter.cpp.

References KexiDB::Field::debugString(), KexiDB::AlterTableHandler::FieldActionBase::m_fieldUID, m_index, and KexiDB::Field::name().

Referenced by simplifyActions().

tristate AlterTableHandler::InsertFieldAction::execute Connection conn,
TableSchema table
[protected, virtual]
 

Performs physical execution of this action.

Todo:

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 657 of file alter.cpp.

KexiDB::Field& KexiDB::AlterTableHandler::InsertFieldAction::field  )  const [inline]
 

Definition at line 332 of file alter.h.

Referenced by InsertFieldAction(), and simplifyActions().

int KexiDB::AlterTableHandler::InsertFieldAction::index  )  const [inline]
 

Definition at line 330 of file alter.h.

Referenced by KexiTableDesignerCommands::InsertFieldCommand::debugString(), KexiTableDesignerCommands::InsertFieldCommand::execute(), KexiDB::AlterTableHandler::execute(), KexiTableDesignerCommands::InsertFieldCommand::unexecute(), and updateTableSchema().

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

Definition at line 546 of file alter.cpp.

References KexiDB::Field::name(), and KexiDB::AlterTableHandler::FieldActionBase::setFieldName().

Referenced by InsertFieldAction(), and simplifyActions().

void KexiDB::AlterTableHandler::InsertFieldAction::setIndex int  index  )  [inline]
 

Definition at line 331 of file alter.h.

Referenced by KexiDB::AlterTableHandler::execute().

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 585 of file alter.cpp.

References createActionDict(), debugString(), field(), KexiDBWarn, setField(), KexiDB::AlterTableHandler::FieldActionBase::setFieldName(), KexiDB::setFieldProperties(), and KexiDB::AlterTableHandler::FieldActionBase::uid().

void AlterTableHandler::InsertFieldAction::updateAlteringRequirements  )  [protected, virtual]
 

Todo:
sometimes add DataConversionRequired (e.g. when relationships require removing orphaned records) ?
Todo:

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 554 of file alter.cpp.

References KexiDB::AlterTableHandler::PhysicalAlteringRequired, and KexiDB::AlterTableHandler::ActionBase::setAlteringRequirements().

tristate AlterTableHandler::InsertFieldAction::updateTableSchema TableSchema table,
Field field,
QMap< QString, QString > &  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 646 of file alter.cpp.

References index().


Member Data Documentation

int KexiDB::AlterTableHandler::InsertFieldAction::m_index [protected]
 

Definition at line 347 of file alter.h.

Referenced by debugString().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:50:38 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003