13 #ifndef __UT_ORMCOLUMN_H__
14 #define __UT_ORMCOLUMN_H__
47 AutoIncrement = 1 << 5
61 unsigned props = Properties::Empty,
62 OnDelete on_delete = OnDelete::DoNothing)
63 : myName(name), myType(type), myProperties(
props), myOnDelete(on_delete)
87 myProperties |= Properties::NotNull;
92 bool isNotNull()
const {
return myProperties & Properties::NotNull; }
96 myProperties |= Properties::PrimaryKey;
103 return (myProperties & Properties::PrimaryKey)
104 || (myProperties & Properties::Unique);
109 myProperties |= Properties::Unique;
114 bool isUnique()
const {
return myProperties & Properties::Unique; }
118 myProperties |= Properties::AutoIncrement;
125 return myProperties & Properties::AutoIncrement;
136 bool isForeignKey()
const {
return myProperties & Properties::ForeignKey; }
141 myProperties |= ForeignKey;
142 myForeignTable = table_name;
143 myForeignColumns.
clear();
144 myForeignColumns.emplace_back(col);
150 myProperties |= ForeignKey;
151 myForeignTable = table_name;
152 myForeignColumns = cols;
158 unsigned myProperties = Properties::Empty;
167 template <
typename T>
214 #endif // __UT_ORMCOLUMN_H__
const UT_StringHolder & name() const
UT_ORMColumn(const UT_StringHolder &name, Type type, unsigned props=Properties::Empty, OnDelete on_delete=OnDelete::DoNothing)
UT_ORMColumn::Type UTsqlOrmColumnType< const char * >()
UT_ORMColumn & setAutoIncrement(bool inc)
UT_ORMColumn::Type UTsqlOrmColumnType< int >()
void setOnDelete(OnDelete ondelete)
const UT_StringHolder & foreignTable() const
SYS_FORCE_INLINE void clear()
UT_ORMColumn::Type UTsqlOrmColumnType< UT_StringHolder >()
UT_StringArray myForeignColumns
UT_ORMColumn::Type UTsqlOrmColumnType()
UT_StringHolder myForeignTable
bool isForeignKey() const
bool isAutoIncrement() const
bool operator!=(const UT_ORMColumn &rhs) const
UT_ORMColumn & setUnique(bool upk)
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER typedef long long unsigned int Int64
Int64 - unsigned 64-bit integer.
UT_ORMColumn & setNotNull(bool not_null)
UT_ORMColumn & setName(const UT_StringHolder &name)
GLuint const GLchar * name
void setAsForeignKey(const UT_StringHolder &table_name, const UT_StringArray &cols)
bool operator==(const UT_ORMColumn &rhs) const
OnDelete onDelete() const
const UT_StringArray & foreignColumns() const
UT_ORMColumn & setPrimaryKey(bool pk)
UT_ORMColumn::Type UTsqlOrmColumnType< int64 >()
UT_ORMColumn::Type UTsqlOrmColumnType< UT_DateTimeField >()
UT_ORMColumn::Type UTsqlOrmColumnType< bool >()
unsigned properties() const
bool isPrimaryKey() const
void setAsForeignKey(const UT_StringHolder &table_name, const UT_StringHolder &col)
GLenum GLuint GLsizei const GLenum * props