OR/M mapper for table driftReading.
More...
|
Host | FilterHost [get, set] |
| Gets or sets the host More...
|
|
Peer | FilterPeer [get, set] |
| Gets or sets the peer to use when extracting data. More...
|
|
DateTime | FilterTime [get, set] |
| Gets or sets the time to use when extracting data. Only readings with a timestamp later than FilterTime gets extracted. More...
|
|
OR/M mapper for table driftReading.
Definition at line 35 of file DriftReadingDatabaseMapper.cs.
override IEnumerator<DriftReading> Ntp.Analyzer.Data.Sql.DriftReadingDatabaseMapper.GetEnumerator |
( |
| ) |
|
|
inline |
Read all data from table in a sequential manner.
- Returns
- The enumerator.
Definition at line 72 of file DriftReadingDatabaseMapper.cs.
References e.
82 Command.CommandText = sql;
83 Log.SqlExecute(Command.CommandText);
84 Reader = Command.ExecuteReader();
97 int id = Convert.ToInt32(Reader[
"id"]);
98 var time = Convert.ToDateTime(Reader[
"time"]);
99 int zone = Convert.ToInt32(Reader[
"zone"]);
100 int hostId = Convert.ToInt32(Reader[
"hostId"]);
102 double drift = Convert.ToDouble(Reader[
"drift"]);
103 yield
return new DriftReading(
id, time, zone, host, drift);
readonly HostDatabaseMapper hostMapper
override string TableName
Value from NTP drift file.
override string PrepareSql(string sql)
override void Ntp.Analyzer.Data.Sql.DriftReadingDatabaseMapper.Insert |
( |
DriftReading |
item | ) |
|
|
inlineprotected |
Definition at line 111 of file DriftReadingDatabaseMapper.cs.
References e, Ntp.Analyzer.Objects.Reading.Host, Ntp.Analyzer.Objects.PersistentObject.Id, Ntp.Analyzer.Objects.PersistentObject.SetId(), Ntp.Analyzer.Objects.Reading.Time, Ntp.Analyzer.Objects.Reading.UtcOffset, and Ntp.Analyzer.Objects.DriftReading.Value.
118 Command.CommandText = PrepareInsertSql(
InsertSql);
119 Command.Parameters.Add(CreateParameter(
"@time", item.
Time));
120 Command.Parameters.Add(CreateParameter(
"@zone", item.
UtcOffset));
121 Command.Parameters.Add(CreateParameter(
"@hostId", item.
Host.
Id));
122 Command.Parameters.Add(CreateParameter(
"@drift", item.
Value));
124 Log.SqlExecute(Command.CommandText, Command.Parameters);
125 var idObject = Command.ExecuteScalar();
126 item.
SetId(Convert.ToInt32(idObject));
void SetId(int id)
Sets the identifier after the object have been stored in persistent storage.
override string TableName
double Value
Gets the drift value.
int Id
Gets the identifier.
override void Ntp.Analyzer.Data.Sql.DriftReadingDatabaseMapper.ReadContent |
( |
| ) |
|
|
inlineprotected |
override void Ntp.Analyzer.Data.Sql.DriftReadingDatabaseMapper.Update |
( |
DriftReading |
item | ) |
|
|
inlineprotected |
override string Ntp.Analyzer.Data.Sql.DriftReadingDatabaseMapper.CreateSql |
|
protected |
Initial value:=> "CREATE TABLE driftReading ( " +
" id {0} PRIMARY KEY, " +
" time TIMESTAMP NOT NULL, " +
" zone INT NOT NULL, " +
" hostId INT NOT NULL, " +
" drift DOUBLE PRECISION NOT NULL, " +
" FOREIGN KEY (hostId) REFERENCES host(id) " +
"){1};"
Definition at line 58 of file DriftReadingDatabaseMapper.cs.
const string Ntp.Analyzer.Data.Sql.DriftReadingDatabaseMapper.InsertSql |
|
private |
Initial value:=
"INSERT INTO driftReading ( time, zone, hostId, drift ) " +
"VALUES ( @time, @zone, @hostId, @drift );{0};"
Definition at line 48 of file DriftReadingDatabaseMapper.cs.
const string Ntp.Analyzer.Data.Sql.DriftReadingDatabaseMapper.SelectSql |
|
private |
override string Ntp.Analyzer.Data.Sql.DriftReadingDatabaseMapper.TableName => "driftReading" |
|
protected |
override bool Ntp.Analyzer.Data.Sql.DriftReadingDatabaseMapper.UseCache => false |
|
protected |
The documentation for this class was generated from the following file: