Samchon Framework for CPP  1.0.0
samchon::protocol::ISQLEntity Class Reference

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...
 

Detailed Description

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.

library_sql.png
Author
Jeongho Nam http://samchon.org

Definition at line 31 of file ISQLEntity.hpp.

Member Function Documentation

virtual void samchon::protocol::ISQLEntity::load ( std::shared_ptr< library::SQLStatement stmt)
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.

Parameters
stmtSQLStatement storing data of the Entity

Definition at line 48 of file ISQLEntity.hpp.

virtual void samchon::protocol::ISQLEntity::archive ( std::shared_ptr< library::SQLStatement stmt)
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.

Parameters
stmtSQLStatement would store data of the Entity

Definition at line 61 of file ISQLEntity.hpp.

virtual auto samchon::protocol::ISQLEntity::toSQL ( ) const -> std::string
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.

Returns
SQL storing record(s) to temporary table of a Procedure

Definition at line 75 of file ISQLEntity.hpp.


The documentation for this class was generated from the following file: