]>
Commit | Line | Data |
---|---|---|
24f452e8 | 1 | #ifndef __GS__MYSQLITEMDAO_H__\r |
2 | #define __GS__MYSQLITEMDAO_H__\r | |
3 | \r | |
4 | #include <GameServ/GameLayer/GameObjects/ItemGO.h>\r | |
5 | using GameServ::GameLayer::GameObjects::ItemGO;\r | |
6 | #include <GameServ/DataLayer/IItemDAO.h>\r | |
7 | using GameServ::DataLayer::DataAccessObjects::IItemDAO;\r | |
8 | \r | |
33ae7ca7 | 9 | #include <boost/smart_ptr/shared_ptr.hpp>\r |
10 | \r | |
24f452e8 | 11 | \r |
12 | #include <string>\r | |
13 | using std::string;\r | |
14 | \r | |
15 | #include <mysql++.h>\r | |
16 | #include <ssqls.h>\r | |
17 | \r | |
18 | namespace GameServ { namespace DataLayer { namespace MySQL\r | |
19 | {\r | |
20 | //! MySQL implementation of IItemDAO interface\r | |
21 | /*!\r | |
22 | If you're using an MySQL datasource, you will be using this\r | |
23 | DAO to access Items.\r | |
24 | */\r | |
b84b8e7a | 25 | \r |
24f452e8 | 26 | \r |
27 | class MySQLItemDAO : public IItemDAO\r | |
28 | {\r | |
29 | public:\r | |
30 | // Ctors, Dtors ///////////////////////////////////////////////////////\r | |
31 | MySQLItemDAO(void);\r | |
32 | virtual ~MySQLItemDAO();\r | |
33 | \r | |
34 | // Methods ////////////////////////////////////////////////////////////\r | |
33ae7ca7 | 35 | virtual boost::shared_ptr<ItemGO> GetById(const string &Id) const;\r |
24f452e8 | 36 | \r |
37 | virtual bool IdExists(const string &Id) const;\r | |
cdc7e562 | 38 | \r |
33ae7ca7 | 39 | virtual void Insert(boost::shared_ptr<ItemGO> spItem);\r |
40 | virtual void Update(boost::shared_ptr<ItemGO> spItem);\r | |
24f452e8 | 41 | \r |
42 | private:\r | |
43 | //! Data mysql\r | |
44 | string mTableName;\r | |
45 | \r | |
46 | // Helper Methods /////////////////////////////////////////////////////\r | |
47 | \r | |
24f452e8 | 48 | //! Get the Item database mysql path\r |
49 | string GetItemTableName(void) const;\r | |
50 | \r | |
51 | void Initialize(const string &tablename);\r | |
52 | };\r | |
53 | } } } // GameServ.DataLayer.DataAccessObjects.MySQL\r | |
54 | \r | |
55 | #endif // __GS__MYSQLITEMDAO_H__ |