29 struct Data_Set :
public std::vector<Self::Data>
34 StringBuffer json_buffer;
35 PrettyWriter<StringBuffer> json_writer(json_buffer);
37 json_writer.StartArray();
38 for (
const auto & item: *
this)
40 json_writer.StartObject();
41 item.as_json(json_writer);
42 json_writer.EndObject();
44 json_writer.EndArray();
46 return json_buffer.GetString();
51 typedef std::vector<Self::Data*>
Cache;
67 std::for_each(cache_.begin(), cache_.end(), std::mem_fn(&
Data::destroy));
79 db->ExecuteUpdate(
"CREATE TABLE ACCOUNTLIST_V1(ACCOUNTID integer primary key, ACCOUNTNAME TEXT COLLATE NOCASE NOT NULL UNIQUE, ACCOUNTTYPE TEXT NOT NULL /* Cash, Checking, Term, Investment, Credit Card, Loan, Asset, Shares */, ACCOUNTNUM TEXT, STATUS TEXT NOT NULL /* Open, Closed */, NOTES TEXT, HELDAT TEXT, WEBSITE TEXT, CONTACTINFO TEXT, ACCESSINFO TEXT, INITIALBAL numeric, INITIALDATE TEXT, FAVORITEACCT TEXT NOT NULL, CURRENCYID integer NOT NULL, STATEMENTLOCKED integer, STATEMENTDATE TEXT, MINIMUMBALANCE numeric, CREDITLIMIT numeric, INTERESTRATE numeric, PAYMENTDUEDATE text, MINIMUMPAYMENT numeric)");
82 catch(
const wxSQLite3Exception &e)
84 wxLogError(
"ACCOUNTLIST_V1: Exception %s", e.GetMessage().utf8_str());
98 db->ExecuteUpdate(
"CREATE INDEX IF NOT EXISTS IDX_ACCOUNTLIST_ACCOUNTTYPE ON ACCOUNTLIST_V1(ACCOUNTTYPE)");
100 catch(
const wxSQLite3Exception &e)
102 wxLogError(
"ACCOUNTLIST_V1: Exception %s", e.GetMessage().utf8_str());
117 static wxString
name() {
return "ACCOUNTID"; }
123 static wxString
name() {
return "ACCOUNTNAME"; }
129 static wxString
name() {
return "ACCOUNTTYPE"; }
135 static wxString
name() {
return "ACCOUNTNUM"; }
141 static wxString
name() {
return "STATUS"; }
147 static wxString
name() {
return "NOTES"; }
153 static wxString
name() {
return "HELDAT"; }
159 static wxString
name() {
return "WEBSITE"; }
165 static wxString
name() {
return "CONTACTINFO"; }
171 static wxString
name() {
return "ACCESSINFO"; }
177 static wxString
name() {
return "INITIALBAL"; }
183 static wxString
name() {
return "INITIALDATE"; }
189 static wxString
name() {
return "FAVORITEACCT"; }
195 static wxString
name() {
return "CURRENCYID"; }
201 static wxString
name() {
return "STATEMENTLOCKED"; }
207 static wxString
name() {
return "STATEMENTDATE"; }
213 static wxString
name() {
return "MINIMUMBALANCE"; }
219 static wxString
name() {
return "CREDITLIMIT"; }
225 static wxString
name() {
return "INTERESTRATE"; }
231 static wxString
name() {
return "PAYMENTDUEDATE"; }
237 static wxString
name() {
return "MINIMUMPAYMENT"; }
307 else if (
"NOTES" == name)
return COL_NOTES;
366 auto operator < (
const Data& other)
const 368 return this->
id() < other.
id();
371 auto operator < (
const Data* other)
const 373 return this->
id() < other->
id();
378 if(ACCOUNTID != r->
ACCOUNTID)
return false;
379 if(!ACCOUNTNAME.IsSameAs(r->
ACCOUNTNAME))
return false;
380 if(!ACCOUNTTYPE.IsSameAs(r->
ACCOUNTTYPE))
return false;
381 if(!ACCOUNTNUM.IsSameAs(r->
ACCOUNTNUM))
return false;
382 if(!STATUS.IsSameAs(r->
STATUS))
return false;
383 if(!NOTES.IsSameAs(r->
NOTES))
return false;
384 if(!HELDAT.IsSameAs(r->
HELDAT))
return false;
385 if(!WEBSITE.IsSameAs(r->
WEBSITE))
return false;
386 if(!CONTACTINFO.IsSameAs(r->
CONTACTINFO))
return false;
387 if(!ACCESSINFO.IsSameAs(r->
ACCESSINFO))
return false;
389 if(!INITIALDATE.IsSameAs(r->
INITIALDATE))
return false;
390 if(!FAVORITEACCT.IsSameAs(r->
FAVORITEACCT))
return false;
402 explicit Data(Self* table =
nullptr )
409 STATEMENTLOCKED = -1;
410 MINIMUMBALANCE = 0.0;
413 MINIMUMPAYMENT = 0.0;
416 explicit Data(wxSQLite3ResultSet& q, Self* table =
nullptr )
420 ACCOUNTID = q.GetInt64(0);
421 ACCOUNTNAME = q.GetString(1);
422 ACCOUNTTYPE = q.GetString(2);
423 ACCOUNTNUM = q.GetString(3);
424 STATUS = q.GetString(4);
425 NOTES = q.GetString(5);
426 HELDAT = q.GetString(6);
427 WEBSITE = q.GetString(7);
428 CONTACTINFO = q.GetString(8);
429 ACCESSINFO = q.GetString(9);
430 INITIALBAL = q.GetDouble(10);
431 INITIALDATE = q.GetString(11);
432 FAVORITEACCT = q.GetString(12);
433 CURRENCYID = q.GetInt64(13);
434 STATEMENTLOCKED = q.GetInt64(14);
435 STATEMENTDATE = q.GetString(15);
436 MINIMUMBALANCE = q.GetDouble(16);
437 CREDITLIMIT = q.GetDouble(17);
438 INTERESTRATE = q.GetDouble(18);
439 PAYMENTDUEDATE = q.GetString(19);
440 MINIMUMPAYMENT = q.GetDouble(20);
447 if (
this == &other)
return *
this;
481 return this->ACCOUNTID == in.
v_;
486 return this->ACCOUNTNAME.CmpNoCase(in.
v_) == 0;
491 return this->ACCOUNTTYPE.CmpNoCase(in.
v_) == 0;
496 return this->ACCOUNTNUM.CmpNoCase(in.
v_) == 0;
501 return this->STATUS.CmpNoCase(in.
v_) == 0;
506 return this->NOTES.CmpNoCase(in.
v_) == 0;
511 return this->HELDAT.CmpNoCase(in.
v_) == 0;
516 return this->WEBSITE.CmpNoCase(in.
v_) == 0;
521 return this->CONTACTINFO.CmpNoCase(in.
v_) == 0;
526 return this->ACCESSINFO.CmpNoCase(in.
v_) == 0;
531 return this->INITIALBAL == in.
v_;
536 return this->INITIALDATE.CmpNoCase(in.
v_) == 0;
541 return this->FAVORITEACCT.CmpNoCase(in.
v_) == 0;
546 return this->CURRENCYID == in.
v_;
551 return this->STATEMENTLOCKED == in.
v_;
556 return this->STATEMENTDATE.CmpNoCase(in.
v_) == 0;
561 return this->MINIMUMBALANCE == in.
v_;
566 return this->CREDITLIMIT == in.
v_;
571 return this->INTERESTRATE == in.
v_;
576 return this->PAYMENTDUEDATE.CmpNoCase(in.
v_) == 0;
581 return this->MINIMUMPAYMENT == in.
v_;
587 StringBuffer json_buffer;
588 PrettyWriter<StringBuffer> json_writer(json_buffer);
590 json_writer.StartObject();
591 this->as_json(json_writer);
592 json_writer.EndObject();
594 return json_buffer.GetString();
598 void as_json(PrettyWriter<StringBuffer>& json_writer)
const 600 json_writer.Key(
"ACCOUNTID");
601 json_writer.Int64(this->ACCOUNTID.GetValue());
602 json_writer.Key(
"ACCOUNTNAME");
603 json_writer.String(this->ACCOUNTNAME.utf8_str());
604 json_writer.Key(
"ACCOUNTTYPE");
605 json_writer.String(this->ACCOUNTTYPE.utf8_str());
606 json_writer.Key(
"ACCOUNTNUM");
607 json_writer.String(this->ACCOUNTNUM.utf8_str());
608 json_writer.Key(
"STATUS");
609 json_writer.String(this->STATUS.utf8_str());
610 json_writer.Key(
"NOTES");
611 json_writer.String(this->NOTES.utf8_str());
612 json_writer.Key(
"HELDAT");
613 json_writer.String(this->HELDAT.utf8_str());
614 json_writer.Key(
"WEBSITE");
615 json_writer.String(this->WEBSITE.utf8_str());
616 json_writer.Key(
"CONTACTINFO");
617 json_writer.String(this->CONTACTINFO.utf8_str());
618 json_writer.Key(
"ACCESSINFO");
619 json_writer.String(this->ACCESSINFO.utf8_str());
620 json_writer.Key(
"INITIALBAL");
621 json_writer.Double(this->INITIALBAL);
622 json_writer.Key(
"INITIALDATE");
623 json_writer.String(this->INITIALDATE.utf8_str());
624 json_writer.Key(
"FAVORITEACCT");
625 json_writer.String(this->FAVORITEACCT.utf8_str());
626 json_writer.Key(
"CURRENCYID");
627 json_writer.Int64(this->CURRENCYID.GetValue());
628 json_writer.Key(
"STATEMENTLOCKED");
629 json_writer.Int64(this->STATEMENTLOCKED.GetValue());
630 json_writer.Key(
"STATEMENTDATE");
631 json_writer.String(this->STATEMENTDATE.utf8_str());
632 json_writer.Key(
"MINIMUMBALANCE");
633 json_writer.Double(this->MINIMUMBALANCE);
634 json_writer.Key(
"CREDITLIMIT");
635 json_writer.Double(this->CREDITLIMIT);
636 json_writer.Key(
"INTERESTRATE");
637 json_writer.Double(this->INTERESTRATE);
638 json_writer.Key(
"PAYMENTDUEDATE");
639 json_writer.String(this->PAYMENTDUEDATE.utf8_str());
640 json_writer.Key(
"MINIMUMPAYMENT");
641 json_writer.Double(this->MINIMUMPAYMENT);
647 row(L
"ACCOUNTID") = ACCOUNTID.GetValue();
648 row(L
"ACCOUNTNAME") = ACCOUNTNAME;
649 row(L
"ACCOUNTTYPE") = ACCOUNTTYPE;
650 row(L
"ACCOUNTNUM") = ACCOUNTNUM;
651 row(L
"STATUS") = STATUS;
652 row(L
"NOTES") = NOTES;
653 row(L
"HELDAT") = HELDAT;
654 row(L
"WEBSITE") = WEBSITE;
655 row(L
"CONTACTINFO") = CONTACTINFO;
656 row(L
"ACCESSINFO") = ACCESSINFO;
657 row(L
"INITIALBAL") = INITIALBAL;
658 row(L
"INITIALDATE") = INITIALDATE;
659 row(L
"FAVORITEACCT") = FAVORITEACCT;
660 row(L
"CURRENCYID") = CURRENCYID.GetValue();
661 row(L
"STATEMENTLOCKED") = STATEMENTLOCKED.GetValue();
662 row(L
"STATEMENTDATE") = STATEMENTDATE;
663 row(L
"MINIMUMBALANCE") = MINIMUMBALANCE;
664 row(L
"CREDITLIMIT") = CREDITLIMIT;
665 row(L
"INTERESTRATE") = INTERESTRATE;
666 row(L
"PAYMENTDUEDATE") = PAYMENTDUEDATE;
667 row(L
"MINIMUMPAYMENT") = MINIMUMPAYMENT;
673 t(L
"ACCOUNTID") = ACCOUNTID.GetValue();
674 t(L
"ACCOUNTNAME") = ACCOUNTNAME;
675 t(L
"ACCOUNTTYPE") = ACCOUNTTYPE;
676 t(L
"ACCOUNTNUM") = ACCOUNTNUM;
677 t(L
"STATUS") = STATUS;
679 t(L
"HELDAT") = HELDAT;
680 t(L
"WEBSITE") = WEBSITE;
681 t(L
"CONTACTINFO") = CONTACTINFO;
682 t(L
"ACCESSINFO") = ACCESSINFO;
683 t(L
"INITIALBAL") = INITIALBAL;
684 t(L
"INITIALDATE") = INITIALDATE;
685 t(L
"FAVORITEACCT") = FAVORITEACCT;
686 t(L
"CURRENCYID") = CURRENCYID.GetValue();
687 t(L
"STATEMENTLOCKED") = STATEMENTLOCKED.GetValue();
688 t(L
"STATEMENTDATE") = STATEMENTDATE;
689 t(L
"MINIMUMBALANCE") = MINIMUMBALANCE;
690 t(L
"CREDITLIMIT") = CREDITLIMIT;
691 t(L
"INTERESTRATE") = INTERESTRATE;
692 t(L
"PAYMENTDUEDATE") = PAYMENTDUEDATE;
693 t(L
"MINIMUMPAYMENT") = MINIMUMPAYMENT;
697 bool save(wxSQLite3Database* db,
bool force_insert =
false)
699 if (db && db->IsReadOnly())
return false;
702 wxLogError(
"can not save ACCOUNTLIST_V1");
706 return table_->
save(
this, db, force_insert);
710 bool remove(wxSQLite3Database* db)
714 wxLogError(
"can not remove ACCOUNTLIST_V1");
718 return table_->
remove(
this, db);
735 wxString
name()
const {
return "ACCOUNTLIST_V1"; }
739 query_ =
"SELECT ACCOUNTID, ACCOUNTNAME, ACCOUNTTYPE, ACCOUNTNUM, STATUS, NOTES, HELDAT, WEBSITE, CONTACTINFO, ACCESSINFO, INITIALBAL, INITIALDATE, FAVORITEACCT, CURRENCYID, STATEMENTLOCKED, STATEMENTDATE, MINIMUMBALANCE, CREDITLIMIT, INTERESTRATE, PAYMENTDUEDATE, MINIMUMPAYMENT FROM ACCOUNTLIST_V1 ";
746 cache_.push_back(entity);
766 wxString sql = wxEmptyString;
767 if (entity->
id() <= 0 || force_insert)
769 sql =
"INSERT INTO ACCOUNTLIST_V1(ACCOUNTNAME, ACCOUNTTYPE, ACCOUNTNUM, STATUS, NOTES, HELDAT, WEBSITE, CONTACTINFO, ACCESSINFO, INITIALBAL, INITIALDATE, FAVORITEACCT, CURRENCYID, STATEMENTLOCKED, STATEMENTDATE, MINIMUMBALANCE, CREDITLIMIT, INTERESTRATE, PAYMENTDUEDATE, MINIMUMPAYMENT, ACCOUNTID) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
773 sql =
"UPDATE ACCOUNTLIST_V1 SET ACCOUNTNAME = ?, ACCOUNTTYPE = ?, ACCOUNTNUM = ?, STATUS = ?, NOTES = ?, HELDAT = ?, WEBSITE = ?, CONTACTINFO = ?, ACCESSINFO = ?, INITIALBAL = ?, INITIALDATE = ?, FAVORITEACCT = ?, CURRENCYID = ?, STATEMENTLOCKED = ?, STATEMENTDATE = ?, MINIMUMBALANCE = ?, CREDITLIMIT = ?, INTERESTRATE = ?, PAYMENTDUEDATE = ?, MINIMUMPAYMENT = ? WHERE ACCOUNTID = ?";
778 wxSQLite3Statement stmt = db->PrepareStatement(sql);
783 stmt.Bind(4, entity->
STATUS);
784 stmt.Bind(5, entity->
NOTES);
785 stmt.Bind(6, entity->
HELDAT);
802 stmt.ExecuteUpdate();
805 if (entity->
id() > 0)
807 for(Cache::iterator it = cache_.begin(); it != cache_.end(); ++ it)
810 if (e->
id() == entity->
id())
815 catch(
const wxSQLite3Exception &e)
817 wxLogError(
"ACCOUNTLIST_V1: Exception %s, %s", e.GetMessage().utf8_str(), entity->
to_json());
821 if (entity->
id() <= 0)
823 entity->
id(db->GetLastRowId());
824 index_by_id_.insert(std::make_pair(entity->
id(), entity));
830 bool remove(
const int64 id, wxSQLite3Database* db)
832 if (
id <= 0)
return false;
835 wxString sql =
"DELETE FROM ACCOUNTLIST_V1 WHERE ACCOUNTID = ?";
836 wxSQLite3Statement stmt = db->PrepareStatement(sql);
838 stmt.ExecuteUpdate();
842 for(Cache::iterator it = cache_.begin(); it != cache_.end(); ++ it)
845 if (entity->
id() ==
id)
847 index_by_id_.erase(entity->
id());
858 catch(
const wxSQLite3Exception &e)
860 wxLogError(
"ACCOUNTLIST_V1: Exception %s", e.GetMessage().utf8_str());
870 if (
remove(entity->id(), db))
879 template<
typename... Args>
882 for (
auto& [_, item] : index_by_id_)
884 if (item->id() > 0 &&
match(item, args...))
908 if (
auto it = index_by_id_.find(
id); it != index_by_id_.end())
916 wxString where = wxString::Format(
" WHERE %s = ?",
PRIMARY::name().utf8_str());
919 wxSQLite3Statement stmt = db->PrepareStatement(this->
query() + where);
922 wxSQLite3ResultSet q = stmt.ExecuteQuery();
926 cache_.push_back(entity);
927 index_by_id_.insert(std::make_pair(
id, entity));
931 catch(
const wxSQLite3Exception &e)
933 wxLogError(
"%s: Exception %s", this->
name().utf8_str(), e.GetMessage().utf8_str());
938 entity = this->
fake_;
956 wxString where = wxString::Format(
" WHERE %s = ?",
PRIMARY::name().utf8_str());
959 wxSQLite3Statement stmt = db->PrepareStatement(this->
query() + where);
962 wxSQLite3ResultSet q = stmt.ExecuteQuery();
969 catch(
const wxSQLite3Exception &e)
971 wxLogError(
"%s: Exception %s", this->
name().utf8_str(), e.GetMessage().utf8_str());
976 entity = this->
fake_;
992 wxSQLite3ResultSet q = db->ExecuteQuery(col ==
COLUMN(0) ? this->
query() : this->
query() +
" ORDER BY " +
column_to_name(col) +
" COLLATE NOCASE " + (asc ?
" ASC " :
" DESC "));
997 result.push_back(std::move(entity));
1002 catch(
const wxSQLite3Exception &e)
1004 wxLogError(
"%s: Exception %s", this->
name().utf8_str(), e.GetMessage().utf8_str());
bool exists(wxSQLite3Database *db) const
Definition: DB_Table.h:65
Definition: DB_Table_Accountlist_V1.h:145
bool match(const DATA *data, const Arg1 &arg1)
Definition: DB_Table.h:170
bool save(Self::Data *entity, wxSQLite3Database *db, bool force_insert=false)
Saves the Data record to the database table.
Definition: DB_Table_Accountlist_V1.h:764
wxString STATUS
Definition: DB_Table_Accountlist_V1.h:338
double MINIMUMBALANCE
Definition: DB_Table_Accountlist_V1.h:350
bool remove(const int64 id, wxSQLite3Database *db)
Remove the Data record from the database and the memory table (cache)
Definition: DB_Table_Accountlist_V1.h:830
static wxString name()
Definition: DB_Table_Accountlist_V1.h:117
Definition: DB_Table_Accountlist_V1.h:255
int64 STATEMENTLOCKED
Definition: DB_Table_Accountlist_V1.h:348
size_t num_columns() const
Definition: DB_Table_Accountlist_V1.h:732
wxString to_json() const
Definition: DB_Table_Accountlist_V1.h:585
bool match(const C &) const
Definition: DB_Table_Accountlist_V1.h:474
Self::Data * create()
Create a new Data record and add to memory table (cache)
Definition: DB_Table_Accountlist_V1.h:743
wxString WEBSITE
Definition: DB_Table_Accountlist_V1.h:341
bool match(const Self::CURRENCYID &in) const
Definition: DB_Table_Accountlist_V1.h:544
STATUS(const wxString &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:142
Copyright: (c) 2013 - 2025 Guan Lisheng (guanlisheng@gmail.com) Copyright: (c) 2017 - 2018 Stefano Gi...
Definition: DB_Table_Accountlist_V1.h:258
V v_
Definition: DB_Table.h:47
Definition: DB_Table_Accountlist_V1.h:23
bool match(const Self::INITIALBAL &in) const
Definition: DB_Table_Accountlist_V1.h:529
double INTERESTRATE
Definition: DB_Table_Accountlist_V1.h:352
size_t hit_
Definition: DB_Table.h:60
static wxString name()
Definition: DB_Table_Accountlist_V1.h:171
Definition: DB_Table_Accountlist_V1.h:263
Definition: DB_Table_Accountlist_V1.h:249
const Data_Set all(wxSQLite3Database *db, const COLUMN col=COLUMN(0), const bool asc=true)
Return a list of Data records (Data_Set) derived directly from the database.
Definition: DB_Table_Accountlist_V1.h:987
Definition: DB_Table_Accountlist_V1.h:264
Data * fake_
Definition: DB_Table_Accountlist_V1.h:55
INITIALBAL(const double &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:178
Definition: DB_Table_Accountlist_V1.h:133
OP
Definition: DB_Table.h:42
Definition: DB_Table_Accountlist_V1.h:193
ACCOUNTID(const int64 &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:118
static wxString name()
Definition: DB_Table_Accountlist_V1.h:153
static wxString name()
Definition: DB_Table_Accountlist_V1.h:189
static wxString column_to_name(const COLUMN col)
Returns the column name as a string.
Definition: DB_Table_Accountlist_V1.h:268
Definition: DB_Table_Accountlist_V1.h:257
Definition: DB_Table_Accountlist_V1.h:121
WEBSITE(const wxString &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:160
Data is a single record in the database table.
Definition: DB_Table_Accountlist_V1.h:328
wxString PAYMENTDUEDATE
Definition: DB_Table_Accountlist_V1.h:353
bool match(const Self::CONTACTINFO &in) const
Definition: DB_Table_Accountlist_V1.h:519
static wxString name()
Definition: DB_Table_Accountlist_V1.h:231
Definition: DB_Table_Accountlist_V1.h:175
Definition: DB_Table_Accountlist_V1.h:151
bool match(const Self::STATEMENTDATE &in) const
Definition: DB_Table_Accountlist_V1.h:554
wxString to_json() const
Return the data records as a json array string.
Definition: DB_Table_Accountlist_V1.h:32
wxString name() const
Name of the table.
Definition: DB_Table_Accountlist_V1.h:735
Definition: DB_Table_Accountlist_V1.h:259
wxString ACCOUNTNUM
Definition: DB_Table_Accountlist_V1.h:337
static int64 newId()
Definition: DB_Table.h:75
ACCOUNTTYPE(const wxString &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:130
id
Definition: constants.h:125
Definition: DB_Table_Accountlist_V1.h:260
Definition: DB_Table_Accountlist_V1.h:253
bool match(const Self::WEBSITE &in) const
Definition: DB_Table_Accountlist_V1.h:514
Definition: DB_Table_Accountlist_V1.h:217
static wxString name()
Definition: DB_Table_Accountlist_V1.h:225
bool equals(const Data *r) const
Definition: DB_Table_Accountlist_V1.h:376
bool match(const Self::CREDITLIMIT &in) const
Definition: DB_Table_Accountlist_V1.h:564
A container to hold list of Data records for the table.
Definition: DB_Table_Accountlist_V1.h:29
Definition: DB_Table_Accountlist_V1.h:211
Definition: DB_Table_Accountlist_V1.h:205
bool match(const Self::MINIMUMPAYMENT &in) const
Definition: DB_Table_Accountlist_V1.h:579
Definition: DB_Table_Accountlist_V1.h:261
static wxString name()
Definition: DB_Table_Accountlist_V1.h:147
void ensure_data(wxSQLite3Database *db)
Definition: DB_Table_Accountlist_V1.h:109
Definition: DB_Table_Accountlist_V1.h:248
Definition: DB_Table_Accountlist_V1.h:244
bool ensure_index(wxSQLite3Database *db)
Definition: DB_Table_Accountlist_V1.h:94
double MINIMUMPAYMENT
Definition: DB_Table_Accountlist_V1.h:354
DB_Table_ACCOUNTLIST_V1()
Definition: DB_Table_Accountlist_V1.h:737
row_t to_row_t() const
Definition: DB_Table_Accountlist_V1.h:644
bool match(const Self::FAVORITEACCT &in) const
Definition: DB_Table_Accountlist_V1.h:539
Definition: DB_Table_Accountlist_V1.h:247
size_t skip_
Definition: DB_Table.h:60
ACCOUNTNUM(const wxString &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:136
void id(const int64 id)
Definition: DB_Table_Accountlist_V1.h:361
bool match(const Self::PAYMENTDUEDATE &in) const
Definition: DB_Table_Accountlist_V1.h:574
int64 CURRENCYID
Definition: DB_Table_Accountlist_V1.h:347
std::map< int64, Self::Data * > Index_By_Id
Definition: DB_Table_Accountlist_V1.h:52
bool match(const Self::INITIALDATE &in) const
Definition: DB_Table_Accountlist_V1.h:534
Definition: DB_Table_Accountlist_V1.h:181
static wxString name()
Definition: DB_Table_Accountlist_V1.h:177
bool ensure(wxSQLite3Database *db)
Creates the database table if the table does not exist.
Definition: DB_Table_Accountlist_V1.h:73
void destroy_cache()
Removes all records stored in memory (cache) for the table.
Definition: DB_Table_Accountlist_V1.h:65
CURRENCYID(const int64 &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:196
Definition: DB_Table_Accountlist_V1.h:157
bool match(const Self::ACCOUNTID &in) const
Definition: DB_Table_Accountlist_V1.h:479
void as_json(PrettyWriter< StringBuffer > &json_writer) const
Definition: DB_Table_Accountlist_V1.h:598
static COLUMN name_to_column(const wxString &name)
Returns the column number from the given column name.
Definition: DB_Table_Accountlist_V1.h:300
static wxString name()
Definition: DB_Table_Accountlist_V1.h:237
~DB_Table_ACCOUNTLIST_V1()
Destructor: clears any data records stored in memory.
Definition: DB_Table_Accountlist_V1.h:58
Data(Self *table=nullptr)
Definition: DB_Table_Accountlist_V1.h:402
ACCESSINFO(const wxString &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:172
Definition: DB_Table_Accountlist_V1.h:729
wxString ACCOUNTTYPE
Definition: DB_Table_Accountlist_V1.h:336
bool match(const Self::STATEMENTLOCKED &in) const
Definition: DB_Table_Accountlist_V1.h:549
Definition: DB_Table.h:42
Definition: DB_Table_Accountlist_V1.h:115
DB_Table_ACCOUNTLIST_V1 Self
Definition: DB_Table_Accountlist_V1.h:25
Definition: DB_Table.h:45
Definition: DB_Table_Accountlist_V1.h:245
double INITIALBAL
Definition: DB_Table_Accountlist_V1.h:344
wxString STATEMENTDATE
Definition: DB_Table_Accountlist_V1.h:349
Definition: DB_Table_Accountlist_V1.h:251
Definition: DB_Table_Accountlist_V1.h:223
virtual wxString query() const
Definition: DB_Table.h:61
Data(wxSQLite3ResultSet &q, Self *table=nullptr)
Definition: DB_Table_Accountlist_V1.h:416
Self::Data * get_one(const Args &... args)
Definition: DB_Table_Accountlist_V1.h:880
INTERESTRATE(const double &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:226
static wxString name()
Definition: DB_Table_Accountlist_V1.h:135
std::vector< Self::Data * > Cache
A container to hold a list of Data record pointers for the table in memory.
Definition: DB_Table_Accountlist_V1.h:51
Definition: DB_Table_Accountlist_V1.h:229
bool match(const Self::NOTES &in) const
Definition: DB_Table_Accountlist_V1.h:504
static wxString name()
Definition: DB_Table_Accountlist_V1.h:141
static wxString name()
Definition: DB_Table_Accountlist_V1.h:213
wxString ACCESSINFO
Definition: DB_Table_Accountlist_V1.h:343
Definition: DB_Table_Accountlist_V1.h:246
double CREDITLIMIT
Definition: DB_Table_Accountlist_V1.h:351
void destroy()
Definition: DB_Table_Accountlist_V1.h:721
wxString INITIALDATE
Definition: DB_Table_Accountlist_V1.h:345
size_t miss_
Definition: DB_Table.h:60
Definition: DB_Table_Accountlist_V1.h:127
bool save(wxSQLite3Database *db, bool force_insert=false)
Save the record instance in memory to the database.
Definition: DB_Table_Accountlist_V1.h:697
bool match(const Self::MINIMUMBALANCE &in) const
Definition: DB_Table_Accountlist_V1.h:559
int64 id() const
Definition: DB_Table_Accountlist_V1.h:356
Self::Data * clone(const Data *e)
Create a copy of the Data record and add to memory table (cache)
Definition: DB_Table_Accountlist_V1.h:751
static wxString name()
Definition: DB_Table_Accountlist_V1.h:195
CREDITLIMIT(const double &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:220
ACCOUNTNAME(const wxString &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:124
wxString ACCOUNTNAME
Definition: DB_Table_Accountlist_V1.h:335
bool match(const Self::ACCOUNTNUM &in) const
Definition: DB_Table_Accountlist_V1.h:494
STATEMENTLOCKED(const int64 &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:202
Definition: DB_Table_Accountlist_V1.h:262
Definition: DB_Table_Accountlist_V1.h:199
wxString CONTACTINFO
Definition: DB_Table_Accountlist_V1.h:342
Definition: DB_Table_Accountlist_V1.h:235
bool match(const Self::HELDAT &in) const
Definition: DB_Table_Accountlist_V1.h:509
void to_template(html_template &t) const
Definition: DB_Table_Accountlist_V1.h:671
FAVORITEACCT(const wxString &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:190
bool match(const Self::INTERESTRATE &in) const
Definition: DB_Table_Accountlist_V1.h:569
static wxString name()
Definition: DB_Table_Accountlist_V1.h:159
static wxString name()
Definition: DB_Table_Accountlist_V1.h:129
Self::Data * get_record(const int64 id, wxSQLite3Database *db)
Search the database for the data record, bypassing the cache.
Definition: DB_Table_Accountlist_V1.h:947
HELDAT(const wxString &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:154
COLUMN
Definition: DB_Table_Accountlist_V1.h:242
wxString NOTES
Definition: DB_Table_Accountlist_V1.h:339
static wxString name()
Definition: DB_Table_Accountlist_V1.h:123
bool match(const Self::ACCOUNTNAME &in) const
Definition: DB_Table_Accountlist_V1.h:484
Definition: DB_Table.h:55
bool match(const Self::STATUS &in) const
Definition: DB_Table_Accountlist_V1.h:499
static wxString name()
Definition: DB_Table_Accountlist_V1.h:219
Data & operator=(const Data &other)
Definition: DB_Table_Accountlist_V1.h:445
Definition: DB_Table_Accountlist_V1.h:252
int64 ACCOUNTID
Definition: DB_Table_Accountlist_V1.h:334
Definition: DB_Table_Accountlist_V1.h:169
MINIMUMPAYMENT(const double &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:238
Definition: DB_Table_Accountlist_V1.h:139
MINIMUMBALANCE(const double &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:214
wxString HELDAT
Definition: DB_Table_Accountlist_V1.h:340
Index_By_Id index_by_id_
Definition: DB_Table_Accountlist_V1.h:54
PAYMENTDUEDATE(const wxString &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:232
wxLongLong int64
Definition: customfieldlistdialog.h:26
ACCOUNTID PRIMARY
Definition: DB_Table_Accountlist_V1.h:241
INITIALDATE(const wxString &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:184
Self * table_
This is a instance pointer to itself in memory.
Definition: DB_Table_Accountlist_V1.h:332
STATEMENTDATE(const wxString &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:208
static wxString name()
Definition: DB_Table_Accountlist_V1.h:201
wxString query_
Definition: DB_Table.h:58
Definition: DB_Table_Accountlist_V1.h:250
NOTES(const wxString &v, OP op=EQUAL)
Definition: DB_Table_Accountlist_V1.h:148
bool match(const Self::ACCOUNTTYPE &in) const
Definition: DB_Table_Accountlist_V1.h:489
bool match(const Self::ACCESSINFO &in) const
Definition: DB_Table_Accountlist_V1.h:524
wxString FAVORITEACCT
Definition: DB_Table_Accountlist_V1.h:346
Cache cache_
Definition: DB_Table_Accountlist_V1.h:53
Definition: DB_Table_Accountlist_V1.h:187
static wxString name()
Definition: DB_Table_Accountlist_V1.h:183
Definition: DB_Table_Accountlist_V1.h:256
Definition: DB_Table_Accountlist_V1.h:254
static wxString name()
Definition: DB_Table_Accountlist_V1.h:207