Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/TableAdapterWrapper/PluginInfoAdapterWrapper.cs @ 3011

Last change on this file since 3011 was 3011, checked in by kgrading, 14 years ago

changed the complete DAL to LINQ 2 SQL (with the exception of the job streaming), did a lot of refactoring, Introduced DTOs (that are named DTOs for better understanding), added the spring.NET Interceptor, reintroduced transactions and cleaned up the whole JobResult thing and updated a part of the config merger (#830)

File size: 1.5 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.DataAccess.ADOHelper;
6using System.Data.SqlClient;
7using HeuristicLab.Hive.Contracts.BusinessObjects;
8using System.Data.Common;
9
10namespace HeuristicLab.Hive.Server.ADODataAccess.TableAdapterWrapper {
11  class PluginInfoAdapterWrapper :
12   TableAdapterWrapperBase<
13       dsHiveServerTableAdapters.PluginInfoTableAdapter,
14   HivePluginInfoDto,
15   dsHiveServer.PluginInfoRow> {
16    public override void UpdateRow(dsHiveServer.PluginInfoRow row) {
17      TransactionalAdapter.Update(row);
18    }
19
20    public override dsHiveServer.PluginInfoRow
21      InsertNewRow(HivePluginInfoDto pluginInfo) {
22      dsHiveServer.PluginInfoDataTable data =
23        new dsHiveServer.PluginInfoDataTable();
24
25      dsHiveServer.PluginInfoRow row = data.NewPluginInfoRow();
26      row.PluginId = pluginInfo.Id;
27      data.AddPluginInfoRow(row);
28
29      return row;
30    }
31
32    public override IEnumerable<dsHiveServer.PluginInfoRow>
33      FindById(Guid id) {
34      return TransactionalAdapter.GetDataById(id);
35    }
36
37    public override IEnumerable<dsHiveServer.PluginInfoRow>
38      FindAll() {
39      return TransactionalAdapter.GetData();
40    }
41
42    protected override void SetConnection(DbConnection connection) {
43      adapter.Connection = connection as SqlConnection;
44    }
45
46    protected override void SetTransaction(DbTransaction transaction) {
47      adapter.Transaction = transaction as SqlTransaction;
48    }
49  }
50}
Note: See TracBrowser for help on using the repository browser.