AUI Framework  master
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AModelMeta< T > Struct Template Reference

Defines model metadata (list of fields, name of appropriate sql table, etc...) More...

#include <AUI/Data/AModelMeta.h>

Static Public Member Functions#

static AMap< AString, _< AField< T > > > getFields ()
 
static AString getSqlTable ()
 

Additional Inherited Members#

- Public Types inherited from AModelMetaBase< T >
using Model = T
 

Detailed Description#

template<class T>
struct AModelMeta< T >
Template Parameters
    
TModel
// user model
struct User: ASqlModel<User> {
  id_t id;
  AString username;
  AString password;
};
// metadata
A_META(User) {
  // appropriate sql table
  A_SQL_TABLE("users")
  // appropriate fields
  A_FIELDS {
    return {
      A_FIELD(id)
      A_FIELD(username)
      A_FIELD(password)
    };
  }
};
Represents a Unicode character string.
Definition AString.h:38
Defines a model that can be stored in an SQL database. Implements queries for this type to the databa...
Definition ASqlModel.h:26