Last change
on this file since 3580 was
3011,
checked in by kgrading, 15 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 | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using HeuristicLab.DataAccess.ADOHelper;
|
---|
6 | using System.Data.SqlClient;
|
---|
7 | using HeuristicLab.Hive.Contracts.BusinessObjects;
|
---|
8 | using System.Data.Common;
|
---|
9 |
|
---|
10 | namespace HeuristicLab.Hive.Server.ADODataAccess.TableAdapterWrapper {
|
---|
11 | class ProjectAdapterWrapper :
|
---|
12 | TableAdapterWrapperBase<dsHiveServerTableAdapters.ProjectTableAdapter,
|
---|
13 | ProjectDto,
|
---|
14 | dsHiveServer.ProjectRow> {
|
---|
15 | public override void UpdateRow(dsHiveServer.ProjectRow row) {
|
---|
16 | TransactionalAdapter.Update(row);
|
---|
17 | }
|
---|
18 |
|
---|
19 | public override dsHiveServer.ProjectRow
|
---|
20 | InsertNewRow(ProjectDto project) {
|
---|
21 | dsHiveServer.ProjectDataTable data =
|
---|
22 | new dsHiveServer.ProjectDataTable();
|
---|
23 |
|
---|
24 | dsHiveServer.ProjectRow row = data.NewProjectRow();
|
---|
25 | row.ProjectId = project.Id;
|
---|
26 | data.AddProjectRow(row);
|
---|
27 |
|
---|
28 | return row;
|
---|
29 | }
|
---|
30 |
|
---|
31 | public override IEnumerable<dsHiveServer.ProjectRow>
|
---|
32 | FindById(Guid id) {
|
---|
33 | return TransactionalAdapter.GetDataById(id);
|
---|
34 | }
|
---|
35 |
|
---|
36 | public override IEnumerable<dsHiveServer.ProjectRow>
|
---|
37 | FindAll() {
|
---|
38 | return TransactionalAdapter.GetData();
|
---|
39 | }
|
---|
40 |
|
---|
41 | protected override void SetConnection(DbConnection connection) {
|
---|
42 | adapter.Connection = connection as SqlConnection;
|
---|
43 | }
|
---|
44 |
|
---|
45 | protected override void SetTransaction(DbTransaction transaction) {
|
---|
46 | adapter.Transaction = transaction as SqlTransaction;
|
---|
47 | }
|
---|
48 | }
|
---|
49 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.