GnuCashew ~ GnuCash Enabled Web
GCW
Versions.cpp
Go to the documentation of this file.
1 #line 2 "src/Dbo/Versions/Versions.cpp"
2 
3 #include "../App.h"
4 #include "../Glb/Core.h"
5 
6 #include "Versions.h"
7 
8 const char * GCW::Dbo::Versions::s_tableName = "versions";
9 
10 const Wt::WFormModel::Field GCW::Dbo::Versions::Field::table_name = "table_name" ; // text(50) PRIMARY KEY NOT NULL,
11 const Wt::WFormModel::Field GCW::Dbo::Versions::Field::table_version = "table_version" ; // integer NOT NULL
12 
13 auto
15 load( const std::string & _table_name )-> GCW::Dbo::Versions::Item::Ptr
16 {
18 
19  if( _table_name != "" )
20  {
21 
22  Wt::Dbo::Transaction t( GCW::app()-> gnucashew_session() );
23 
24  try
25  {
26  retVal =
27  GCW::app()-> gnucashew_session().find< GCW::Dbo::Versions::Item >()
28  .where( "table_name = ?" )
29  .bind( _table_name )
30  .resultValue()
31  ;
32  }
33  catch( std::exception & e )
34  {
35  std::cout << __FILE__ << ":" << __LINE__ << " " << e.what() << std::endl;
36  }
37  }
38 
39  return retVal;
40 
41 } // endload( const std::string & _guid )-> GCW::Dbo::Versions::Item::Ptr
42 
43 
44 
Wt::Dbo::ptr< Item > Ptr
Definition: BaseItem.h:39
Versions Class.
Definition: Item.h:70
const Wt::WFormModel::Field table_name
Definition: Versions.cpp:10
const Wt::WFormModel::Field table_version
Definition: Versions.cpp:11
auto load(const std::string &_table_name) -> Item::Ptr
Load Version by Table Name.
Definition: Versions.cpp:15
const char * s_tableName
Definition: Versions.cpp:8
App * app()
Definition: App.cpp:67