Samchon Framework for CPP
1.0.0
|
An interface supporting DB-I/O. More...
#include <ISQLEntity.hpp>
Public Member Functions | |
virtual void | load (std::shared_ptr< library::SQLStatement > stmt) |
Load data of entity from DB. More... | |
virtual void | archive (std::shared_ptr< library::SQLStatement > stmt) |
Archive data of entity to DB. More... | |
virtual auto | toSQL () const -> std::string |
Get a sql-statement string represents the entity. More... | |
An interface supporting DB-I/O.
ISQLEntity is an interface for interacting with Database. By implementing load() and archive() methods, you can make an entity to interact with a Database.
If an entity implementing the ISQLEntity is a type of EntityGroup and its children also implemented the ISQLEntity, you can realize construction and archiving chain by each child entity to do their I/O procedures by their own.
Definition at line 31 of file ISQLEntity.hpp.
|
inlinevirtual |
Load data of entity from DB.
Loads and constructs data of the entity from a SQLStatement.
If an entity implementing the ISQLEntity is a type of EntityGroup and its children also implemented the ISQLEntity, you can realize construction chain by each child entity fetches data of their own by themselves.
stmt | SQLStatement storing data of the Entity |
Definition at line 48 of file ISQLEntity.hpp.
|
inlinevirtual |
Archive data of entity to DB.
Archives data of the entity to Database by a SQLStatement.
If an entity implementing the ISQLEntity is a type of EntityGroup and its children also implemented the ISQLEntity, you can realize archiving chain by each child entity archives data of their own by themselves.
stmt | SQLStatement would store data of the Entity |
Definition at line 61 of file ISQLEntity.hpp.
|
inlinevirtual |
Get a sql-statement string represents the entity.
ISQLEntity::toSL() is an abstract method returns a sql-statement string.
However, if there's some parameter in a sql-statement string from the toString() method, it is categorized in dynamic sql. In that case, do not access table directly but indirect from sql-procedure. Indirecting procedure is good for performance and security.
Definition at line 75 of file ISQLEntity.hpp.