#include <Column.h>
Public Types | |
enum | CONTENTS { CONTENTSunspecified = 0, CONTENTSserviceName = 1, CONTENTSusername = 2, CONTENTSinsertTime = 3, CONTENTSupdateTime = 4 } |
Hints to program in case FROM field is FROMprogram. More... | |
enum | CONTENTS { CONTENTSunspecified = 0, CONTENTSserviceName = 1, CONTENTSusername = 2, CONTENTSinsertTime = 3, CONTENTSupdateTime = 4 } |
Hints to program in case FROM field is FROMprogram. More... | |
enum | FROM { FROMdefault = 1, FROMautoIncrement, FROMnow, FROMprogram, FROMendUser } |
enum | FROM { FROMdefault = 1, FROMautoIncrement, FROMnow, FROMprogram, FROMendUser } |
Public Member Functions | |
Visitor::VisitorState | accept (Visitor *v) |
Visitor::VisitorState | accept (Visitor *v) |
Column (Table *myTable=0) | |
Column (Table *myTable=0) | |
const std::string & | getComment () const |
const std::string & | getComment () const |
CONTENTS | getContentsType () const |
CONTENTS | getContentsType () const |
Datatype * | getDatatype () const |
Datatype * | getDatatype () const |
const std::string & | getDefault () const |
const std::string & | getDefault () const |
Enum * | getEnum () const |
Enum * | getEnum () const |
const std::string & | getName () const |
const std::string & | getName () const |
FROM | getSourceType () const |
FROM | getSourceType () const |
const std::string & | getTableName () const |
const std::string & | getTableName () const |
bool | interpret (const std::string &interpType, std::string &val) |
bool | interpret (const std::string &interpType, std::string &val) |
bool | isAutoIncrement () const |
bool | isAutoIncrement () const |
bool | isCompatible (const Column *otherCol) const |
Return true if otherCol and this have compatible datatypes. | |
bool | isCompatible (const Column *otherCol) const |
Return true if otherCol and this have compatible datatypes. | |
bool | isPrimaryKey () const |
bool | isPrimaryKey () const |
bool | nullAllowed () const |
Returns true if column may take on value NULL. | |
bool | nullAllowed () const |
Returns true if column may take on value NULL. | |
bool | okValue (const std::string &val, bool set=true) const |
bool | okValue (const std::string &val, bool set=true) const |
bool | stickyInsert () const |
bool | stickyInsert () const |
~Column () | |
~Column () | |
Private Attributes | |
std::string | m_comment |
CONTENTS | m_contents |
std::string | m_default |
FROM | m_from |
bool | m_isPrimaryKey |
Is this column a primary key? | |
Table * | m_myTable |
Table * | m_myTable |
std::string | m_name |
bool | m_null |
Can this field have the value NULL? | |
bool | m_stickyInsert |
Datatype * | m_type |
Datatype * | m_type |
Friends | |
class | rdbModel::XercesBuilder |
|
Hints to program in case FROM field is FROMprogram.
00039 { 00040 CONTENTSunspecified = 0, 00041 CONTENTSserviceName = 1, 00042 CONTENTSusername = 2, 00043 CONTENTSinsertTime = 3, 00044 CONTENTSupdateTime = 4 00045 00046 };
|
|
Hints to program in case FROM field is FROMprogram.
00039 { 00040 CONTENTSunspecified = 0, 00041 CONTENTSserviceName = 1, 00042 CONTENTSusername = 2, 00043 CONTENTSinsertTime = 3, 00044 CONTENTSupdateTime = 4 00045 00046 };
|
|
Source of value. Note timestamp with value current time should be indicated by contents value CONTENTSupdateTime or (if only upon insert) CONTENTS enterTime 00030 { 00031 FROMdefault = 1, // enduser can override default, however 00032 FROMautoIncrement, 00033 FROMnow, // datatype must be timestamp - deprecated 00034 FROMprogram, 00035 FROMendUser 00036 };
|
|
Source of value. Note timestamp with value current time should be indicated by contents value CONTENTSupdateTime or (if only upon insert) CONTENTS enterTime 00030 { 00031 FROMdefault = 1, // enduser can override default, however 00032 FROMautoIncrement, 00033 FROMnow, // datatype must be timestamp - deprecated 00034 FROMprogram, 00035 FROMendUser 00036 };
|
|
00048 : m_myTable(myTable), m_type(0), 00049 m_isPrimaryKey(false) { 00050 m_contents = CONTENTSunspecified; 00051 m_default = std::string("");};
|
|
00011 {
00012 delete m_type;
00013 }
|
|
00048 : m_myTable(myTable), m_type(0), 00049 m_isPrimaryKey(false) { 00050 m_contents = CONTENTSunspecified; 00051 m_default = std::string("");};
|
|
|
|
|
|
00058 { 00059 00060 Visitor::VisitorState state = v->visitColumn(this); 00061 if (state == Visitor::VBRANCHDONE) return Visitor::VCONTINUE; 00062 return state; 00063 }
|
|
00057 {return m_comment;};
|
|
00057 {return m_comment;};
|
|
00089 {return m_contents;}
|
|
00089 {return m_contents;}
|
|
00063 {return m_type;};
|
|
00063 {return m_type;};
|
|
00059 {return m_default;}
|
|
00059 {return m_default;}
|
|
Return pointer to Enum object associated with this column (if none, return null pointer). |
|
Return pointer to Enum object associated with this column (if none, return null pointer). 00015 {return m_type->getEnum();}
|
|
00056 {return m_name; };
|
|
00056 {return m_name; };
|
|
00088 {return m_from;}
|
|
00088 {return m_from;}
|
|
|
|
00017 { 00018 return m_myTable->getName(); 00019 }
|
|
Handle special literal values, depending loosely on column datatype. Most Column objects won't do any interpretation, but, for example, timestamp-like columns may substitute for "NOW" Return true if any substitution was done |
|
Handle special literal values, depending loosely on column datatype. Most Column objects won't do any interpretation, but, for example, timestamp-like columns may substitute for "NOW" Return true if any substitution was done 00041 { 00042 // Currently only interpretation is for timestamp-like columns. 00043 // Value of interpType must be "time" and val must be "NOW". 00044 // In this case, substitute ascii current time 00045 if (interpType.compare(std::string("time")) != 0) return false; 00046 00047 Datatype::TYPES dtype = m_type->getType(); 00048 if ((dtype != Datatype::TYPEdatetime) && 00049 (dtype != Datatype::TYPEtimestamp)) { 00050 return false; 00051 } 00052 if (val.compare(std::string("NOW")) != 0) return false; 00053 00054 val = facilities::Timestamp().getString(); 00055 return true; 00056 }
|
|
|
|
00037 { 00038 return (m_from == FROMautoIncrement); 00039 }
|
|
Return true if otherCol and this have compatible datatypes.
|
|
Return true if otherCol and this have compatible datatypes.
00032 { 00033 return m_type->isCompatible(otherCol->m_type); 00034 }
|
|
00084 {return m_isPrimaryKey;}
|
|
00084 {return m_isPrimaryKey;}
|
|
Returns true if column may take on value NULL.
00080 { return m_null;}
|
|
Returns true if column may take on value NULL.
00080 { return m_null;}
|
|
See if supplied value meets constraints of column definition
|
|
See if supplied value meets constraints of column definition
00021 { 00022 // auto increment and datetime values are established by rdbms 00023 if (set) { 00024 00025 if ( (m_from == FROMautoIncrement) || 00026 (m_from == FROMnow)) return false; 00027 } 00028 00029 return m_type->okValue(val); 00030 }
|
|
00082 { return m_stickyInsert;}
|
|
00082 { return m_stickyInsert;}
|
|
|
|
|
|
|
|
|
|
|
|
Is this column a primary key?
|
|
|
|
|
|
|
|
Can this field have the value NULL?
|
|
For multi-insert, does this column normally keep same value for all the inserts? |
|
|
|
|