-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSession.cpp
More file actions
66 lines (52 loc) · 1.45 KB
/
Session.cpp
File metadata and controls
66 lines (52 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "stdafx.h"
#include "session.h"
#include <algorithm>
#include <functional>
#include <connection.h>
#include <statement.h>
void orm::swap(orm::session &left, orm::session &right)
{
using std::swap;
swap(left._connectionString, right._connectionString);
swap(left._dialect, right._dialect);
swap(left._environment, right._environment);
swap(left._executor, right._executor);
swap(left._registry, right._registry);
}
orm::session::session()
{
}
orm::session::session(const std::shared_ptr<odbc::environment> &environment, const std::string &connectionString, const std::shared_ptr<ISqlDialect> &dialect, const std::shared_ptr<ISqlExecutor> &executor, const MappingRegistry ®istry) :
_environment(environment)
, _connectionString(connectionString)
, _dialect(dialect)
, _executor(executor)
, _registry(registry)
{
}
orm::session::session(const orm::session &other) :
_environment(other._environment)
, _connectionString(other._connectionString)
, _dialect(other._dialect)
, _executor(other._executor)
, _registry(other._registry)
{
}
orm::session::session(orm::session &&other) :
orm::session()
{
swap(*this, other);
}
orm::session::~session()
{
}
orm::session &orm::session::operator =(orm::session other)
{
swap(*this, other);
return *this;
}
std::uint32_t orm::session::ExecuteSql(const orm::sql::statement &statement) const
{
std::uint32_t result = _executor->ExecuteSql(_environment, _connectionString, statement);
return result;
}