Wtx ~ Wt Extension Library
WtxLib
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Wtx::Dbo::BaseItemTpl< C > Class Template Reference
+ Inheritance diagram for Wtx::Dbo::BaseItemTpl< C >:

Public Types

using Ptr = Wt::Dbo::ptr< C >
 
using Collection = Wt::Dbo::collection< Ptr >
 
using Vector = std::vector< Ptr >
 

Public Member Functions

 BaseItemTpl (const std::string &key, const std::string &cfy="")
 
bool operator== (const BaseItemTpl< C > &other) const
 
bool operator< (const BaseItemTpl< C > &other) const
 
bool isInitialized () const
 
int lastVersion () const
 
void setLastVersion (int value) const
 
virtual void preWrite ()
 Pre-write. More...
 
virtual void postRead ()
 Post-read. More...
 
const Wtx::Dbo::Field< int > & versionSync () const
 
const Wtx::Dbo::Field< bool > & isActive () const
 
const Wtx::Dbo::Field< bool > & isVisible () const
 
const Wtx::Dbo::Field< bool > & isDeleted () const
 
const Wtx::Dbo::Field< std::string > & xid () const
 
const Wtx::Dbo::Field< std::string > & keyField () const
 
const Wtx::Dbo::Field< std::string > & cfyField () const
 
const Wtx::Dbo::FieldVarvarField () const
 
std::string varField (const std::string &fieldName) const
 
Wtx::Dbo::Field< int > & versionSync ()
 
Wtx::Dbo::Field< bool > & isActive ()
 
Wtx::Dbo::Field< bool > & isVisible ()
 
Wtx::Dbo::Field< bool > & isDeleted ()
 
Wtx::Dbo::Field< std::string > & xid ()
 
Wtx::Dbo::Field< std::string > & keyField ()
 
Wtx::Dbo::Field< std::string > & cfyField ()
 
Wtx::Dbo::FieldVarvarField ()
 
Wtx::Dbo::Field< std::string > & tag ()
 
const Wtx::Dbo::Field< std::string > & tag () const
 
virtual std::unique_ptr< Wt::WWidget > createEditWidget (Wt::WFormModel::Field f) const
 Create an Edit Widget. More...
 
template<class Action >
void persist (Action &a)
 

Static Public Member Functions

static void MapClass (Wt::Dbo::Session &session)
 
static void PostCreateTable (Wt::Dbo::Session &session)
 Post Table Create. More...
 
static BaseTableDefTableDef ()
 

Protected Member Functions

void init ()
 

Detailed Description

template<class C>
class Wtx::Dbo::BaseItemTpl< C >

Definition at line 84 of file BaseItemTpl.h.

Member Function Documentation

template<class C>
virtual std::unique_ptr<Wt::WWidget> Wtx::Dbo::BaseItemTpl< C >::createEditWidget ( Wt::WFormModel::Field  f) const
inlinevirtual

Create an Edit Widget.

This function creates a new edit widget from this item. It calls upon the field definition

Definition at line 404 of file BaseItemTpl.h.

template<class C>
static void Wtx::Dbo::BaseItemTpl< C >::PostCreateTable ( Wt::Dbo::Session &  session)
inlinestatic

Post Table Create.

This procedure will loop through all the fields in the table and in the case of 'unique' fields, it will apply the appropriate sql codes to make the column unique.

Anything else that needs to be done to the table immediately after its creation should be applied here in one of the sub-classes.

Definition at line 141 of file BaseItemTpl.h.

template<class C>
virtual void Wtx::Dbo::BaseItemTpl< C >::postRead ( )
inlinevirtual

Post-read.

Do the things that need to be done after the item is read from the back-end DB.

Definition at line 245 of file BaseItemTpl.h.

template<class C>
virtual void Wtx::Dbo::BaseItemTpl< C >::preWrite ( )
inlinevirtual

Pre-write.

Do the things that need to be done before the item is written to the back-end DB.

Definition at line 234 of file BaseItemTpl.h.


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