Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions

stactiverecord::Record< Klass > Class Template Reference

#include <record.h>

Inheritance diagram for stactiverecord::Record< Klass >:
stactiverecord::CUDPropertyRegister

List of all members.

Public Member Functions

void update ()
bool operator== (const Record &other) const
bool operator!= (const Record &other) const
void save ()
void set (std::string key, const char *s)
void set (std::string key, std::string value)
void set (std::string key, int value)
void set (std::string key, DateTime value)
void set (std::string key, bool value)
void get (std::string key, std::string &value, std::string alt)
void get (std::string key, std::string &value)
void get (std::string key, int &value, int alt)
void get (std::string key, int &value)
void get (std::string key, bool &value, bool alt)
void get (std::string key, bool &value)
void get (std::string key, DateTime &value, DateTime alt)
void get (std::string key, DateTime &value)
void del (std::string key)
bool isset (std::string colname)
template<class T >
bool isset ()
coltype type (std::string colname)
void del ()
bool has_been_saved ()
template<class T >
void setOne (Record< T > &r)
template<class T >
void setMany (ObjGroup< T > og)
template<class T >
void del ()
template<class T >
void getOne (T &record)
template<class T >
ObjGroup< T > getMany ()

Static Public Member Functions

static ObjGroup< Klass > find (Q query)
static ObjGroup< Klass > all ()
static bool exists (int id)
static void delete_all ()

Public Attributes

int id
std::string classname

Protected Member Functions

 Record (int _id)

Detailed Description

template<class Klass>
class stactiverecord::Record< Klass >

All objects should extend Record. See the simple example in the examples folder to get started.


Member Function Documentation

template<class Klass>
static ObjGroup<Klass> stactiverecord::Record< Klass >::all (  ) [inline, static]

Get all objects of type T

template<class Klass>
void stactiverecord::Record< Klass >::del (  ) [inline]

Delete Klass record

template<class Klass>
void stactiverecord::Record< Klass >::del ( std::string  key ) [inline]

Delete property with the given key name

template<class Klass>
template<class T >
void stactiverecord::Record< Klass >::del (  ) [inline]

Delete related record (one->one)

template<class Klass>
static void stactiverecord::Record< Klass >::delete_all (  ) [inline, static]

Delete all records of type Klass

template<class Klass>
static bool stactiverecord::Record< Klass >::exists ( int  id ) [inline, static]

Determine if a Klass with the given id exists

template<class Klass>
static ObjGroup<Klass> stactiverecord::Record< Klass >::find ( Q  query ) [inline, static]

Find all objects of type T that match a given query Q

template<class Klass>
template<class T >
ObjGroup<T> stactiverecord::Record< Klass >::getMany (  ) [inline]

Get related records (one->many)

template<class Klass>
template<class T >
void stactiverecord::Record< Klass >::getOne ( T &  record ) [inline]

Get related record (one->one)

template<class Klass>
bool stactiverecord::Record< Klass >::isset ( std::string  colname ) [inline]

Determine if a property is set

template<class Klass>
template<class T >
bool stactiverecord::Record< Klass >::isset (  ) [inline]

Determine if an object relation is set

template<class Klass>
void stactiverecord::Record< Klass >::save (  ) [inline]

Save record changes to DB. If there are no changes, nothing will be done.

template<class Klass>
template<class T >
void stactiverecord::Record< Klass >::setMany ( ObjGroup< T >  og ) [inline]

Assuming here that each member of og is of type T, set record relationship (one->many)

template<class Klass>
template<class T >
void stactiverecord::Record< Klass >::setOne ( Record< T > &  r ) [inline]

Assuming here that r is of type T, set record relationship (one->one)

template<class Klass>
coltype stactiverecord::Record< Klass >::type ( std::string  colname ) [inline]

Determine the column type for the given column. Return coltype if found, NONE if not found

template<class Klass>
void stactiverecord::Record< Klass >::update (  ) [inline]

Update properties of an object. Will overwrite any changes made since the object was created.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Enumerations