HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_ORMModel< T > Class Template Reference

#include <UT_SQLORM.h>

+ Inheritance diagram for UT_ORMModel< T >:

Public Member Functions

 UT_ORMModel (const UT_ORMModelMeta &meta=T::metaInfo())
 
virtual ~UT_ORMModel ()=default
 
 UT_ORMModel (const UT_ORMModel &)=default
 
UT_ORMModeloperator= (const UT_ORMModel &)=default
 
bool save (UT_ErrorCode &ec, bool force_insert=false, bool force_update=false)
 
void remove (UT_ErrorCode &ec)
 
const UT_ORMModelMetameta () const
 
- Public Member Functions inherited from UT_ORMBaseModel
bool isAdding_ () const
 

Static Public Member Functions

static UT_Array< Tfetch (const std::initializer_list< UT::orm::FilterArg > &args, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=T::metaInfo())
 
template<typename PK >
static UT_Optional< Tfetch (const PK &pk, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=T::metaInfo())
 
static UT_Array< TfetchAll (UT_ErrorCode &ec, const UT_ORMModelMeta &meta=T::metaInfo())
 
static UT_Optional< Tfilter (std::initializer_list< UT::orm::FilterArg > &&args, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=T::metaInfo())
 
static std::pair< T, bool > getOrCreate (const std::initializer_list< UT::orm::FilterArg > &args, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=T::metaInfo())
 
static UT_Optional< Tcreate (const std::initializer_list< UT::orm::FilterArg > &args, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=T::metaInfo())
 
template<typename ArrayT >
static UT_Array< TbulkFetch (const ArrayT &items, UT_ErrorCode &ec, const UT_StringRef &col_name=UT_StringHolder::theEmptyString, const UT_ORMModelMeta &meta=T::metaInfo())
 
static void bulkSave (const UT_Array< T > &items, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=T::metaInfo())
 
template<typename... Args>
static T fromDB (Args &&...args)
 
template<typename... Args>
static T fromDB (const UT_ORMModelMeta &meta, Args &&...args)
 
static bool exists (const std::initializer_list< UT::orm::FilterArg > &args, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=T::metaInfo())
 

Protected Attributes

std::reference_wrapper< const
UT_ORMModelMeta
myModelMeta
 
- Protected Attributes inherited from UT_ORMBaseModel
bool myOrmAdding = true
 

Friends

class UT_ORMModelMeta
 

Detailed Description

template<typename T>
class UT_ORMModel< T >

Definition at line 173 of file UT_SQLORM.h.

Constructor & Destructor Documentation

template<typename T>
UT_ORMModel< T >::UT_ORMModel ( const UT_ORMModelMeta meta = T::metaInfo())
inline

Definition at line 177 of file UT_SQLORM.h.

template<typename T>
virtual UT_ORMModel< T >::~UT_ORMModel ( )
virtualdefault
template<typename T>
UT_ORMModel< T >::UT_ORMModel ( const UT_ORMModel< T > &  )
default

Member Function Documentation

template<typename T>
template<typename ArrayT >
static UT_Array<T> UT_ORMModel< T >::bulkFetch ( const ArrayT &  items,
UT_ErrorCode ec,
const UT_StringRef col_name = UT_StringHolder::theEmptyString,
const UT_ORMModelMeta meta = T::metaInfo() 
)
inlinestatic

Definition at line 258 of file UT_SQLORM.h.

template<typename T>
static void UT_ORMModel< T >::bulkSave ( const UT_Array< T > &  items,
UT_ErrorCode ec,
const UT_ORMModelMeta meta = T::metaInfo() 
)
inlinestatic

Definition at line 265 of file UT_SQLORM.h.

template<typename T>
static UT_Optional<T> UT_ORMModel< T >::create ( const std::initializer_list< UT::orm::FilterArg > &  args,
UT_ErrorCode ec,
const UT_ORMModelMeta meta = T::metaInfo() 
)
inlinestatic

Definition at line 249 of file UT_SQLORM.h.

template<typename T>
static bool UT_ORMModel< T >::exists ( const std::initializer_list< UT::orm::FilterArg > &  args,
UT_ErrorCode ec,
const UT_ORMModelMeta meta = T::metaInfo() 
)
inlinestatic

Definition at line 287 of file UT_SQLORM.h.

template<typename T>
static UT_Array<T> UT_ORMModel< T >::fetch ( const std::initializer_list< UT::orm::FilterArg > &  args,
UT_ErrorCode ec,
const UT_ORMModelMeta meta = T::metaInfo() 
)
inlinestatic

Definition at line 198 of file UT_SQLORM.h.

template<typename T>
template<typename PK >
static UT_Optional<T> UT_ORMModel< T >::fetch ( const PK &  pk,
UT_ErrorCode ec,
const UT_ORMModelMeta meta = T::metaInfo() 
)
inlinestatic

Definition at line 207 of file UT_SQLORM.h.

template<typename T>
static UT_Array<T> UT_ORMModel< T >::fetchAll ( UT_ErrorCode ec,
const UT_ORMModelMeta meta = T::metaInfo() 
)
inlinestatic

Definition at line 213 of file UT_SQLORM.h.

template<typename T>
static UT_Optional<T> UT_ORMModel< T >::filter ( std::initializer_list< UT::orm::FilterArg > &&  args,
UT_ErrorCode ec,
const UT_ORMModelMeta meta = T::metaInfo() 
)
inlinestatic

Definition at line 220 of file UT_SQLORM.h.

template<typename T>
template<typename... Args>
static T UT_ORMModel< T >::fromDB ( Args &&...  args)
inlinestatic

Definition at line 274 of file UT_SQLORM.h.

template<typename T>
template<typename... Args>
static T UT_ORMModel< T >::fromDB ( const UT_ORMModelMeta meta,
Args &&...  args 
)
inlinestatic

Definition at line 281 of file UT_SQLORM.h.

template<typename T>
static std::pair<T, bool> UT_ORMModel< T >::getOrCreate ( const std::initializer_list< UT::orm::FilterArg > &  args,
UT_ErrorCode ec,
const UT_ORMModelMeta meta = T::metaInfo() 
)
inlinestatic

Definition at line 241 of file UT_SQLORM.h.

template<typename T>
const UT_ORMModelMeta& UT_ORMModel< T >::meta ( ) const
inline

Definition at line 196 of file UT_SQLORM.h.

template<typename T>
UT_ORMModel& UT_ORMModel< T >::operator= ( const UT_ORMModel< T > &  )
default
template<typename T>
void UT_ORMModel< T >::remove ( UT_ErrorCode ec)
inline

Definition at line 191 of file UT_SQLORM.h.

template<typename T>
bool UT_ORMModel< T >::save ( UT_ErrorCode ec,
bool  force_insert = false,
bool  force_update = false 
)
inline

Definition at line 184 of file UT_SQLORM.h.

Friends And Related Function Documentation

template<typename T>
friend class UT_ORMModelMeta
friend

Definition at line 175 of file UT_SQLORM.h.

Member Data Documentation

template<typename T>
std::reference_wrapper<const UT_ORMModelMeta> UT_ORMModel< T >::myModelMeta
protected

Definition at line 296 of file UT_SQLORM.h.


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