LibEngsas
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ESqlField Class Reference

Represents an field in an sql table.This class is used with ESqlInit to define database schemas. More...

#include <esqlfield.h>

+ Inheritance diagram for ESqlField:
+ Collaboration diagram for ESqlField:

Public Types

enum  Type {
  NoType, Integer, Text, Varchar,
  Boolean, Date, Time, Tinyint,
  Double, Timestamp, Blob, LongBlob
}

Public Member Functions

 ESqlField (QObject *parent=0)
 ESqlField (QString myName, ESqlField::Type myType=ESqlField::NoType, bool notNull=false, bool autoIncrement=false, QObject *parent=0)
bool isValid () const
QString name () const
void setName (QString myName)
bool isPrimaryKey () const
void setIsPrimaryKey (bool status)
bool autoIncrement () const
void setAutoIncrement (bool status)
bool notNull () const
void setNotNull (bool status)
QVariant defaultValue () const
void setDefaultValue (QVariant value)
ESqlField::Type dataType () const
void setDataType (ESqlField::Type myType)
unsigned int length () const
void setLength (unsigned int len)
bool isUnsigned () const
void setIsUnsigned (bool status)
bool isBinary () const
void setIsBinary (bool status)
bool zeroFill () const
void setZeroFill (bool status)
QString sqlFieldType () const
QString createStatement (EngSaS::SQL::DatabaseType type)
 Creates the SQL statement to create the field.
ESqlFieldcopy () const
bool operator== (const ESqlField &field) const
bool operator!= (const ESqlField &field) const
- Public Member Functions inherited from EObject
 EObject (QObject *parent=0)
virtual ~EObject ()
void connectByPass (QObject *object)

Private Member Functions

void init ()

Private Attributes

QString fieldName
bool pk
bool ai
bool nn
QVariant fieldDefValue
ESqlField::Type fieldType
unsigned int fieldLength
bool binary
bool fieldUnsigned
bool zf
QMultiHash< int, QString > convFieldTypes

Additional Inherited Members

- Public Slots inherited from EObject
virtual void reloadSettings ()
 Used to reload the settings.
- Signals inherited from EObject
void error (const QString &message)
void warning (const QString &message)
void information (const QString &message)
void reloadEnableActions ()
 Request reloading of enabled actions in EMainWindow.
void addMenu (QMenu *newMenu, const QString &parent, QString before=QString())
void addAction (QAction *newAction, const QString &parent, QString before=QString())
void addToolBar (QToolBar *newToolBar, Qt::ToolBarArea area=Qt::TopToolBarArea)
void addNewDockWidget (QDockWidget *widget, const Qt::DockWidgetArea &area)
void setCentralWidget (QWidget *centralWidget)
void showSettings ()
void showHelp (const QString &page)
void showStatusWidget (QWidget *widget)
void reloadSettingsRequest ()
 Indicates, that a reload of the settings is needed.
void doReloadSettings ()
 Emitted to bring the reload request back to the farest child.
- Static Public Member Functions inherited from EObject
static void connectByPass (QObject *parent, QObject *child)
- Protected Slots inherited from EObject
virtual void errorByPass (const QString &message)
virtual void warningByPass (const QString &message)
virtual void informationByPass (const QString &message)
virtual void reloadEnableActionsByPass ()
virtual void addMenuByPass (QMenu *newMenu, const QString &parent, QString before=QString())
virtual void addActionByPass (QAction *newAction, const QString &parent, QString before=QString())
virtual void addToolBarByPass (QToolBar *newToolBar, Qt::ToolBarArea area=Qt::TopToolBarArea)
virtual void addNewDockWidgetByPass (QDockWidget *widget, const Qt::DockWidgetArea &area)
virtual void setCentralWidgetByPass (QWidget *centralWidget)
virtual void showSettingsByPass ()
virtual void showHelpByPass (const QString &page)
virtual void showStatusWidgetByPass (QWidget *widget)
virtual void reloadSettingsRequestByPass ()
- Protected Member Functions inherited from EObject
void addManagedDockWidget (QDockWidget *widget, const Qt::DockWidgetArea &area, QString actionLabel=QString(), QString actionParent=QString())
 Adds an dock widget via addNewDockWidget() and adds widget to the list of managed dock widgets.

Detailed Description

Represents an field in an sql table.

This class is used with ESqlInit to define database schemas.

See Also
ESqlTable
ESqlInit

Member Enumeration Documentation

Enumerator:
NoType 
Integer 
Text 
Varchar 
Boolean 
Date 
Time 
Tinyint 
Double 
Timestamp 
Blob 
LongBlob 

Constructor & Destructor Documentation

ESqlField::ESqlField ( QObject *  parent = 0)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ESqlField::ESqlField ( QString  myName,
ESqlField::Type  myType = ESqlField::NoType,
bool  notNull = false,
bool  autoIncrement = false,
QObject *  parent = 0 
)

+ Here is the call graph for this function:

Member Function Documentation

bool ESqlField::autoIncrement ( ) const

+ Here is the caller graph for this function:

ESqlField * ESqlField::copy ( ) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QString ESqlField::createStatement ( EngSaS::SQL::DatabaseType  type)

Creates the SQL statement to create the field.

e.g. a field with name cell2 and varchar(20) not null will result in this statement: cell2 varchar(20) not null

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ESqlField::Type ESqlField::dataType ( ) const

+ Here is the caller graph for this function:

QVariant ESqlField::defaultValue ( ) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ESqlField::init ( )
private

+ Here is the caller graph for this function:

bool ESqlField::isBinary ( ) const

+ Here is the caller graph for this function:

bool ESqlField::isPrimaryKey ( ) const

+ Here is the caller graph for this function:

bool ESqlField::isUnsigned ( ) const

+ Here is the caller graph for this function:

bool ESqlField::isValid ( ) const

+ Here is the caller graph for this function:

unsigned int ESqlField::length ( ) const

+ Here is the caller graph for this function:

QString ESqlField::name ( ) const

+ Here is the caller graph for this function:

bool ESqlField::notNull ( ) const

+ Here is the caller graph for this function:

bool ESqlField::operator!= ( const ESqlField field) const

+ Here is the call graph for this function:

bool ESqlField::operator== ( const ESqlField field) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ESqlField::setAutoIncrement ( bool  status)

+ Here is the caller graph for this function:

void ESqlField::setDataType ( ESqlField::Type  myType)

+ Here is the caller graph for this function:

void ESqlField::setDefaultValue ( QVariant  value)

+ Here is the caller graph for this function:

void ESqlField::setIsBinary ( bool  status)

+ Here is the caller graph for this function:

void ESqlField::setIsPrimaryKey ( bool  status)

+ Here is the caller graph for this function:

void ESqlField::setIsUnsigned ( bool  status)

+ Here is the caller graph for this function:

void ESqlField::setLength ( unsigned int  len)

+ Here is the caller graph for this function:

void ESqlField::setName ( QString  myName)

+ Here is the caller graph for this function:

void ESqlField::setNotNull ( bool  status)
void ESqlField::setZeroFill ( bool  status)

+ Here is the caller graph for this function:

QString ESqlField::sqlFieldType ( ) const

+ Here is the caller graph for this function:

bool ESqlField::zeroFill ( ) const

+ Here is the caller graph for this function:

Member Data Documentation

bool ESqlField::ai
private
bool ESqlField::binary
private
QMultiHash<int, QString> ESqlField::convFieldTypes
private
QVariant ESqlField::fieldDefValue
private
unsigned int ESqlField::fieldLength
private
QString ESqlField::fieldName
private
ESqlField::Type ESqlField::fieldType
private
bool ESqlField::fieldUnsigned
private
bool ESqlField::nn
private
bool ESqlField::pk
private
bool ESqlField::zf
private

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