Index: trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/Client.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/Client.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/Client.cs	(revision 995)
@@ -28,5 +28,5 @@
 namespace HeuristicLab.Hive.Contracts.BusinessObjects {
 
-  public enum State { idle, calculating, offline };
+  public enum State { nullState, idle, calculating, offline };
 
   [DataContract]
Index: trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/ClientConfig.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/ClientConfig.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/ClientConfig.cs	(revision 995)
@@ -29,7 +29,7 @@
 
   [DataContract]
-  public class ClientConfig {
+  public class ClientConfig: IHiveObject {
     [DataMember]
-    public long ClientConfigId { get; set; }
+    public long Id { get; set; }
     [DataMember]
     public String UpDownTimeCalendar { get; set; } // TODO define DataStructure
Index: trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/GrantedPermissions.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/GrantedPermissions.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/GrantedPermissions.cs	(revision 995)
@@ -29,7 +29,7 @@
   
   [DataContract]
-  public class GrantedPermissions {
+  public class GrantedPermissions: IHiveObject {
     [DataMember]
-    public long GrantedPermissionsId { get; set; }
+    public long Id { get; set; }
     [DataMember]
     public Permission Permission { get; set; }
Index: trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/IHiveObject.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/IHiveObject.cs	(revision 995)
+++ trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/IHiveObject.cs	(revision 995)
@@ -0,0 +1,31 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HeuristicLab.Hive.Contracts.BusinessObjects {
+  public interface IHiveObject {
+    long Id { get; set;  }
+  }
+}
Index: trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/Job.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/Job.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/Job.cs	(revision 995)
@@ -29,7 +29,7 @@
 
   [DataContract]
-  public class Job {
+  public class Job: IHiveObject {
     [DataMember]
-    public long JobId { get; set; }
+    public long Id { get; set; }
     [DataMember]
     public State State { get; set; }
@@ -38,4 +38,15 @@
     [DataMember]
     public Job ParentJob { get; set; }
+
+    public override bool Equals(object obj) {
+      if (obj is Job) {
+        return (obj as Job).Id.Equals(Id);
+      } else      
+        return base.Equals(obj);
+    }
+
+    public override int GetHashCode() {
+      return Id.GetHashCode();
+    }
   }
 }
Index: trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/JobResult.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/JobResult.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/JobResult.cs	(revision 995)
@@ -29,7 +29,7 @@
 
   [DataContract]
-  public class JobResult {
+  public class JobResult: IHiveObject {
     [DataMember]
-    public long JobResultId { get; set; }
+    public long Id { get; set; }
     [DataMember]
     public long JobId { get; set; }
Index: trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/Permission.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/Permission.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/Permission.cs	(revision 995)
@@ -29,7 +29,7 @@
 
   [DataContract]
-  public class Permission {
+  public class Permission: IHiveObject {
     [DataMember]
-    public long PermissionId { get; set; }
+    public long Id { get; set; }
     [DataMember]
     public String Name { get; set; }
Index: trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/PermissionOwner.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/PermissionOwner.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/PermissionOwner.cs	(revision 995)
@@ -29,7 +29,7 @@
 
   [DataContract]
-  public class PermissionOwner {
+  public class PermissionOwner: IHiveObject {
     [DataMember]
-    public long PermissionOwnerId { get; set; }
+    public long Id { get; set; }
     [DataMember]
     public string Name { get; set; }
@@ -37,6 +37,6 @@
     public override bool Equals(object obj) {
       if (obj is PermissionOwner) 
-        return this.PermissionOwnerId.Equals(
-          (obj as PermissionOwner).PermissionOwnerId);
+        return this.Id.Equals(
+          (obj as PermissionOwner).Id);
       else
         return base.Equals(obj);
@@ -44,5 +44,5 @@
 
     public override int GetHashCode() {
-      return this.PermissionOwnerId.GetHashCode();
+      return this.Id.GetHashCode();
     }
   }
Index: trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/Resource.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/Resource.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/Resource.cs	(revision 995)
@@ -29,10 +29,20 @@
 
   [DataContract]
-  public class Resource {
+  public class Resource: IHiveObject {
     [DataMember]
-    public long ResourceId { get; set; }
+    public long Id { get; set; }
     [DataMember]
     public string Name { get; set; }
 
+    public override bool Equals(object obj) {
+      if (obj is Resource)
+        return (obj as Resource).Id.Equals(Id);
+      else
+        return base.Equals(obj);
+    }
+
+    public override int GetHashCode() {
+      return Id.GetHashCode();
+    }
   }
 }
Index: trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/UpTimeStatistics.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/UpTimeStatistics.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/UpTimeStatistics.cs	(revision 995)
@@ -29,7 +29,7 @@
 
   [DataContract]
-  public class UpTimeStatistics {
+  public class UpTimeStatistics: IHiveObject {
     [DataMember]
-    public long UpTimeStatisticsId { get; set; }
+    public long Id { get; set; }
     [DataMember]
     public ClientInfo Client { get; set; }
Index: trunk/sources/HeuristicLab.Hive.Contracts/HeuristicLab.Hive.Contracts.csproj
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/HeuristicLab.Hive.Contracts.csproj	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Contracts/HeuristicLab.Hive.Contracts.csproj	(revision 995)
@@ -74,4 +74,5 @@
     <Compile Include="BusinessObjects\ClientGroup.cs" />
     <Compile Include="BusinessObjects\HeartBeatData.cs" />
+    <Compile Include="BusinessObjects\IHiveObject.cs" />
     <Compile Include="BusinessObjects\Job.cs" />
     <Compile Include="BusinessObjects\JobResult.cs" />
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/CachedDataAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/CachedDataAdapter.cs	(revision 995)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/CachedDataAdapter.cs	(revision 995)
@@ -0,0 +1,182 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Hive.Contracts.BusinessObjects;
+using System.Runtime.CompilerServices;
+
+namespace HeuristicLab.Hive.Server.ADODataAccess {
+  abstract class CachedDataAdapter<AdapterT, ObjT, RowT, CacheT> :
+    DataAdapterBase<AdapterT, ObjT, RowT>, 
+    ICachedDataAdapter
+    where CacheT: System.Data.TypedTableBase<RowT>, new()
+    where AdapterT : new()
+    where RowT : System.Data.DataRow
+    where ObjT : IHiveObject, new() {
+    protected CacheT cache = 
+      new CacheT();
+
+    protected ICollection<ICachedDataAdapter> parentAdapters =
+      new List<ICachedDataAdapter>();
+
+    protected CachedDataAdapter() {
+      FillCache();
+
+      ServiceLocator.GetTransactionManager().OnUpdate +=
+        new EventHandler(CachedDataAdapter_OnUpdate);
+    }
+
+    protected virtual RowT FindSingleRow(Selector dbSelector, 
+      Selector cacheSelector) {
+      RowT row =
+         FindSingleRow(cacheSelector);
+
+      //not in cache
+      if (row == null) {
+        row =
+          FindSingleRow(dbSelector);
+      }
+
+      return row;
+    }
+
+    protected virtual IEnumerable<RowT> FindMultipleRows(Selector dbSelector,
+        Selector cacheSelector) {
+      IList<RowT> result =
+         new List<RowT>(cacheSelector());
+
+      IEnumerable<RowT> result2 =
+          dbSelector();
+
+      foreach (RowT row in result2) {
+        if (!IsCached(row)) {
+          result.Add(row);
+        }
+      }
+
+      return result;
+    }
+
+    protected virtual ObjT FindSingle(Selector dbSelector,
+      Selector cacheSelector) {
+      RowT row = FindSingleRow(dbSelector, cacheSelector);
+
+      if (row != null) {
+        ObjT obj = new ObjT();
+        Convert(row, obj);
+
+        return obj;
+      } else {
+        return default(ObjT);
+      }
+    }
+
+    protected virtual ICollection<ObjT> FindMultiple(Selector dbSelector,
+      Selector cacheSelector) {
+      ICollection<ObjT> result =
+        FindMultiple(cacheSelector);
+
+      ICollection<ObjT> resultDb =
+        FindMultiple(dbSelector);
+
+      foreach (ObjT obj in resultDb) {
+        if (!result.Contains(obj))
+          result.Add(obj);
+      }
+
+      return result;
+    }
+
+    protected abstract RowT InsertNewRowInCache(ObjT obj);
+
+    protected abstract void FillCache();
+
+    public abstract void SyncWithDb();
+
+    protected abstract bool PutInCache(ObjT obj);
+
+    protected abstract RowT FindCachedById(long id);
+
+    void CachedDataAdapter_OnUpdate(object sender, EventArgs e) {
+      foreach (ICachedDataAdapter parent in this.parentAdapters) {
+        parent.SyncWithDb();
+      }
+
+      this.SyncWithDb();
+    }
+
+    protected virtual void RemoveRowFromCache(RowT row) {
+      cache.Rows.Remove(row);
+    }
+
+    protected virtual bool IsCached(RowT row) {
+      return cache.Contains<RowT>(row);
+    }
+
+    protected override RowT GetRowById(long id) {
+      RowT row =
+        FindCachedById(id);
+      
+      if(row == null)
+        row = FindSingleRow(
+          delegate() {
+            return FindById(id);
+          });
+
+      return row;
+    }
+
+    [MethodImpl(MethodImplOptions.Synchronized)]
+    public override void Update(ObjT obj) {
+      if (obj != null) {
+        RowT row = 
+          GetRowById(obj.Id);
+
+        if (row == null) {
+          if (PutInCache(obj)) {
+            row = InsertNewRowInCache(obj);
+          } else {
+            row = InsertNewRow(obj);
+          }
+
+          UpdateRow(row);
+        }
+
+        Convert(obj, row);
+
+        if (IsCached(row) &&
+            !PutInCache(obj)) {
+          //remove from cache
+          UpdateRow(row);
+          RemoveRowFromCache(row);
+        }
+
+        obj.Id = (long)row[row.Table.PrimaryKey[0]];
+
+        if (!IsCached(row))
+          UpdateRow(row);
+      }
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientAdapter.cs	(revision 995)
@@ -30,10 +30,14 @@
 
 namespace HeuristicLab.Hive.Server.ADODataAccess {
-  class ClientAdapter: DataAdapterBase, IClientAdapter {
-    private dsHiveServerTableAdapters.ClientTableAdapter adapter =
-        new dsHiveServerTableAdapters.ClientTableAdapter();
-
-    private dsHiveServer.ClientDataTable data =
-      new dsHiveServer.ClientDataTable();
+  class ClientAdapter: 
+    CachedDataAdapter<
+      dsHiveServerTableAdapters.ClientTableAdapter, 
+      ClientInfo, 
+      dsHiveServer.ClientRow, 
+      dsHiveServer.ClientDataTable>,
+    IClientAdapter {
+    #region Fields
+    dsHiveServer.ClientDataTable data =
+        new dsHiveServer.ClientDataTable();
 
     private IResourceAdapter resAdapter = null;
@@ -71,22 +75,23 @@
       }
     }
+    #endregion
 
     public ClientAdapter() {
-      adapter.Fill(data);
-    }
-
-    protected override void Update() {
-      this.adapter.Update(this.data);
-    }
-    
-    private ClientInfo Convert(dsHiveServer.ClientRow row, 
+      parentAdapters.Add(this.ResAdapter as ICachedDataAdapter);
+    }
+
+    #region Overrides
+    protected override ClientInfo Convert(dsHiveServer.ClientRow row, 
       ClientInfo client) {
       if(row != null && client != null) {      
         /*Parent - resource*/
-        client.ResourceId = row.ResourceId;
-        ResAdapter.GetResourceById(client);
+        client.Id = row.ResourceId;
+        ResAdapter.GetById(client);
 
         /*ClientInfo*/
-        client.ClientId = row.GUID;
+        if (!row.IsGUIDNull())
+          client.ClientId = row.GUID;
+        else
+          client.ClientId = Guid.Empty;
        
         if (!row.IsCPUSpeedNull())
@@ -108,5 +113,5 @@
           client.State = (State)Enum.Parse(typeof(State), row.Status, true);
         else
-          client.State = State.idle;
+          client.State = State.nullState;
 
         if (!row.IsNumberOfCoresNull())
@@ -123,5 +128,5 @@
     }
 
-    private dsHiveServer.ClientRow Convert(ClientInfo client,
+    protected override dsHiveServer.ClientRow Convert(ClientInfo client,
       dsHiveServer.ClientRow row) {
       if (client != null && row != null) {      
@@ -130,5 +135,8 @@
         row.Memory = client.Memory;
         row.Login = client.Login;
-        row.Status = client.State.ToString();
+        if (client.State != State.nullState)
+          row.Status = client.State.ToString();
+        else
+          row.SetStatusNull();
         row.NumberOfCores = client.NrOfCores;
 
@@ -143,102 +151,93 @@
     }
 
+    protected override void UpdateRow(dsHiveServer.ClientRow row) {
+      adapter.Update(row);
+    }
+
+    protected override dsHiveServer.ClientRow
+      InsertNewRow(ClientInfo client) {
+      dsHiveServer.ClientRow row = data.NewClientRow();
+      row.ResourceId = client.Id;
+      data.AddClientRow(row);
+
+      return row;
+    }
+
+    protected override dsHiveServer.ClientRow
+      InsertNewRowInCache(ClientInfo client) {
+      dsHiveServer.ClientRow row = cache.NewClientRow();
+      row.ResourceId = client.Id;
+      cache.AddClientRow(row);
+
+      return row;
+    }
+
+    protected override void FillCache() {
+      cache = adapter.GetDataByActive();
+    }
+
+    public override void SyncWithDb() {
+      adapter.Update(cache);
+    }
+
+    protected override bool PutInCache(ClientInfo obj) {
+      return (obj.State != State.offline && obj.State != State.nullState);
+    }
+
+    protected override IEnumerable<dsHiveServer.ClientRow>
+      FindById(long id) {
+      return adapter.GetDataByResourceId(id);
+    }
+
+    protected override dsHiveServer.ClientRow
+      FindCachedById(long id) {
+      return cache.FindByResourceId(id);
+    }
+
+    protected override IEnumerable<dsHiveServer.ClientRow>
+      FindAll() {
+      return FindMultipleRows(
+        new Selector(adapter.GetData),
+        new Selector(cache.AsEnumerable<dsHiveServer.ClientRow>));
+    }
+    #endregion
+
     #region IClientAdapter Members
     [MethodImpl(MethodImplOptions.Synchronized)]
-    public void UpdateClient(ClientInfo client) {
+    public override void Update(ClientInfo client) {
       if (client != null) {
-        ResAdapter.UpdateResource(client);
-
-        dsHiveServer.ClientRow row = 
-          data.FindByResourceId(client.ResourceId);
-
-        if (row == null) {
-          row = data.NewClientRow();
-          row.ResourceId = client.ResourceId;
-          data.AddClientRow(row);
-        } 
-
-        Convert(client, row);
-      }
-    }
-
-    public ClientInfo GetClientById(Guid clientId) {
+        ResAdapter.Update(client);
+
+        base.Update(client);
+      }
+    }
+
+    public ClientInfo GetById(Guid clientId) {
+      return base.FindSingle(
+        delegate() {
+          return adapter.GetDataById(clientId);
+        }, 
+        delegate() {
+          return from c in
+                     cache.AsEnumerable<dsHiveServer.ClientRow>()
+                   where !c.IsGUIDNull() && 
+                          c.GUID == clientId
+                   select c; 
+        });
+    }
+
+    public ClientInfo GetByName(string name) {
       ClientInfo client = new ClientInfo();
-
-      dsHiveServer.ClientRow row = null;
-      IEnumerable<dsHiveServer.ClientRow> clients =
-            from c in
-              data.AsEnumerable<dsHiveServer.ClientRow>()
-            where !c.IsGUIDNull() && c.GUID == clientId
-            select c;
-      if (clients.Count<dsHiveServer.ClientRow>() == 1)
-        row = clients.First<dsHiveServer.ClientRow>();
-
-      if (row != null) {
-        Convert(row, client);
-
-        return client;
-      } else {
-        return null;
-      }
-    }
-
-    public ClientInfo GetClientById(long id) {
-      ClientInfo client = new ClientInfo();
-
-      dsHiveServer.ClientRow row = data.FindByResourceId(id);
-
-      if (row != null) {
-        Convert(row, client);
-
-        return client;
-      } else {
-        return null;
-      }
-    }
-
-    public ClientInfo GetClientByName(string name) {
-      ClientInfo client = new ClientInfo();
-
       Resource res =
-        ResAdapter.GetResourceByName(name);
-
-      if (res != null) {
+        ResAdapter.GetByName(name);
+
+      return GetById(res.Id);
+    }
+
+    [MethodImpl(MethodImplOptions.Synchronized)]
+    public override bool Delete(ClientInfo client) {      
+      if (client != null) {
         dsHiveServer.ClientRow row =
-          data.FindByResourceId(res.ResourceId);
-
-        if (row != null) {
-          Convert(row, client);
-
-          return client;
-        }
-      }
-
-      return null;
-    }
-
-    public ICollection<ClientInfo> GetAllClients() {
-      ICollection<ClientInfo> allClients =
-        new List<ClientInfo>();
-
-      foreach (dsHiveServer.ClientRow row in data) {
-        ClientInfo client = new ClientInfo();
-        Convert(row, client);
-        allClients.Add(client);
-      }
-
-      return allClients;
-    }
-
-    [MethodImpl(MethodImplOptions.Synchronized)]
-    public bool DeleteClient(ClientInfo client) {      
-      if (client != null) {
-        dsHiveServer.ClientRow row = null;
-        IEnumerable<dsHiveServer.ClientRow> clients =
-              from c in
-                data.AsEnumerable<dsHiveServer.ClientRow>()
-              where !c.IsGUIDNull() && c.GUID == client.ClientId
-              select c;
-        if (clients.Count<dsHiveServer.ClientRow>() == 1)
-          row = clients.First<dsHiveServer.ClientRow>();
+          GetRowById(client.Id);
 
         if (row != null) {
@@ -248,5 +247,5 @@
           foreach (ClientGroup group in clientGroups) {
             group.Resources.Remove(client);
-            ClientGroupAdapter.UpdateClientGroup(group);
+            ClientGroupAdapter.Update(group);
           }
 
@@ -255,11 +254,9 @@
             JobAdapter.GetJobsOf(client);
           foreach (Job job in jobs) {
-            JobAdapter.DeleteJob(job);
+            JobAdapter.Delete(job);
           }
 
-          row.Delete();
-          adapter.Update(row);
-
-          return ResAdapter.DeleteResource(client);
+          return base.Delete(client) && 
+            ResAdapter.Delete(client);
         }
       }
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientGroupAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientGroupAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientGroupAdapter.cs	(revision 995)
@@ -31,16 +31,15 @@
 
 namespace HeuristicLab.Hive.Server.ADODataAccess {
-  class ClientGroupAdapter : DataAdapterBase, IClientGroupAdapter {
-    private dsHiveServerTableAdapters.ClientGroupTableAdapter adapter =
-        new dsHiveServerTableAdapters.ClientGroupTableAdapter();
-
-    private dsHiveServer.ClientGroupDataTable data =
-      new dsHiveServer.ClientGroupDataTable();
+  class ClientGroupAdapter : 
+    DataAdapterBase<dsHiveServerTableAdapters.ClientGroupTableAdapter, 
+    ClientGroup, 
+    dsHiveServer.ClientGroupRow>, 
+    IClientGroupAdapter {
+    #region Fields
+    dsHiveServer.ClientGroupDataTable data =
+        new dsHiveServer.ClientGroupDataTable();
 
     private dsHiveServerTableAdapters.ClientGroup_ResourceTableAdapter resourceClientGroupAdapter =
       new dsHiveServerTableAdapters.ClientGroup_ResourceTableAdapter();
-
-    private dsHiveServer.ClientGroup_ResourceDataTable resourceClientGroupData =
-      new dsHiveServer.ClientGroup_ResourceDataTable();
 
     private IResourceAdapter resourceAdapter = null;
@@ -65,28 +64,17 @@
       }
     }
-
-    public ClientGroupAdapter() {
-      adapter.Fill(data);
-      resourceClientGroupAdapter.Fill(resourceClientGroupData);
-    }
-
-    protected override void Update() {
-      this.adapter.Update(this.data);
-      this.resourceClientGroupAdapter.Update(resourceClientGroupData);
-    }
-
-    private ClientGroup Convert(dsHiveServer.ClientGroupRow row,
+    #endregion
+
+    #region Overrides
+    protected override ClientGroup Convert(dsHiveServer.ClientGroupRow row,
       ClientGroup clientGroup) {
       if (row != null && clientGroup != null) {
         /*Parent - Permission Owner*/
-        clientGroup.ResourceId = row.ResourceId;
-        ResAdapter.GetResourceById(clientGroup);
+        clientGroup.Id = row.ResourceId;
+        ResAdapter.GetById(clientGroup);
 
         //first check for created references
-        IEnumerable<dsHiveServer.ClientGroup_ResourceRow> clientGroupRows =
-          from resource in
-            resourceClientGroupData.AsEnumerable<dsHiveServer.ClientGroup_ResourceRow>()
-          where resource.ClientGroupId == clientGroup.ResourceId
-          select resource;
+        dsHiveServer.ClientGroup_ResourceDataTable clientGroupRows =
+            resourceClientGroupAdapter.GetDataByClientGroupId(clientGroup.Id);
 
         foreach (dsHiveServer.ClientGroup_ResourceRow resourceClientGroupRow in
@@ -97,5 +85,5 @@
             from p in
               clientGroup.Resources
-            where p.ResourceId == resourceClientGroupRow.ResourceId
+            where p.Id == resourceClientGroupRow.ResourceId
             select p;
           if (resources.Count<Resource>() == 1)
@@ -104,10 +92,10 @@
           if (resource == null) {
             Resource res =
-              ClientAdapter.GetClientById(resourceClientGroupRow.ResourceId);
+              ClientAdapter.GetById(resourceClientGroupRow.ResourceId);
 
             if (res == null) {
               //is a client group
               res =
-                GetClientGroupById(resourceClientGroupRow.ResourceId);
+                GetById(resourceClientGroupRow.ResourceId);
             }
 
@@ -122,10 +110,10 @@
 
         foreach (Resource resource in clientGroup.Resources) {
-          dsHiveServer.ClientGroup_ResourceRow permOwnerUserGroupRow =
-            resourceClientGroupData.FindByClientGroupIdResourceId(
-              clientGroup.ResourceId,
-              resource.ResourceId);
-
-          if (permOwnerUserGroupRow == null) {
+          dsHiveServer.ClientGroup_ResourceDataTable found =
+            resourceClientGroupAdapter.GetDataByClientGroupResourceId(
+            clientGroup.Id,
+            resource.Id);
+
+          if (found.Count != 1) {
             deleted.Add(resource);
           }
@@ -141,8 +129,8 @@
     }
 
-    private dsHiveServer.ClientGroupRow Convert(ClientGroup clientGroup,
+    protected override dsHiveServer.ClientGroupRow Convert(ClientGroup clientGroup,
       dsHiveServer.ClientGroupRow row) {
       if (clientGroup != null && row != null) {
-        row.ResourceId = clientGroup.ResourceId;
+        row.ResourceId = clientGroup.Id;
 
         //update references
@@ -150,25 +138,31 @@
           //first update the member to make sure it exists in the DB
           if (resource is ClientInfo) {
-            ClientAdapter.UpdateClient(resource as ClientInfo);
+            ClientAdapter.Update(resource as ClientInfo);
           } else if (resource is ClientGroup) {
-            UpdateClientGroup(resource as ClientGroup);
+            Update(resource as ClientGroup);
           }
 
           //secondly check for created references
           dsHiveServer.ClientGroup_ResourceRow resourceClientGroupRow =
-            resourceClientGroupData.FindByClientGroupIdResourceId(
-                            clientGroup.ResourceId,
-                            resource.ResourceId);
+            null;
+          dsHiveServer.ClientGroup_ResourceDataTable found =
+            resourceClientGroupAdapter.GetDataByClientGroupResourceId(
+              clientGroup.Id,
+              resource.Id);
+          if (found.Count == 1)
+            resourceClientGroupRow = found[0];
 
           if (resourceClientGroupRow == null) {
             resourceClientGroupRow =
-              resourceClientGroupData.NewClientGroup_ResourceRow();
+              found.NewClientGroup_ResourceRow();
 
             resourceClientGroupRow.ResourceId =
-              resource.ResourceId;
+              resource.Id;
             resourceClientGroupRow.ClientGroupId =
-              clientGroup.ResourceId;
-
-            resourceClientGroupData.AddClientGroup_ResourceRow(
+              clientGroup.Id;
+
+            found.AddClientGroup_ResourceRow(resourceClientGroupRow);
+
+            resourceClientGroupAdapter.Update(
               resourceClientGroupRow);
           }
@@ -176,9 +170,6 @@
 
         //thirdly check for deleted references
-        IEnumerable<dsHiveServer.ClientGroup_ResourceRow> clientGroupRows =
-          from permOwner in
-            resourceClientGroupData.AsEnumerable<dsHiveServer.ClientGroup_ResourceRow>()
-          where permOwner.ClientGroupId == clientGroup.ResourceId
-          select permOwner;
+        dsHiveServer.ClientGroup_ResourceDataTable clientGroupRows =
+          resourceClientGroupAdapter.GetDataByClientGroupId(clientGroup.Id);
 
         ICollection<dsHiveServer.ClientGroup_ResourceRow> deleted =
@@ -192,5 +183,5 @@
             from r in
               clientGroup.Resources
-            where r.ResourceId == resourceClientGroupRow.ResourceId
+            where r.Id == resourceClientGroupRow.ResourceId
             select r;
 
@@ -203,81 +194,62 @@
         }
 
-        foreach (dsHiveServer.ClientGroup_ResourceRow resoruceClientGroupRow in
-          deleted) {
-          resourceClientGroupData.RemoveClientGroup_ResourceRow(
-            resoruceClientGroupRow);
-        }
-
+        foreach (dsHiveServer.ClientGroup_ResourceRow resourceClientGroupRow in deleted) {
+          resourceClientGroupRow.Delete();
+          resourceClientGroupAdapter.Update(resourceClientGroupRow);
+        }
       }
 
       return row;
     }
+
+    protected override dsHiveServer.ClientGroupRow
+      InsertNewRow(ClientGroup group) {
+      dsHiveServer.ClientGroupRow row =
+        data.NewClientGroupRow();
+
+      row.ResourceId = group.Id;
+
+      data.AddClientGroupRow(row);
+      adapter.Update(row);
+
+      return row;
+    }
+
+    protected override void
+      UpdateRow(dsHiveServer.ClientGroupRow row) {
+      adapter.Update(row);
+    }
+
+    protected override IEnumerable<dsHiveServer.ClientGroupRow>
+      FindById(long id) {
+      return adapter.GetDataById(id);
+    }
+
+    protected override IEnumerable<dsHiveServer.ClientGroupRow>
+      FindAll() {
+      return adapter.GetData();
+    }
+    #endregion
 
     #region IClientGroupAdapter Members
     [MethodImpl(MethodImplOptions.Synchronized)]
-    public void UpdateClientGroup(ClientGroup group) {
+    public override void Update(ClientGroup group) {
       if (group != null) {
-        ResAdapter.UpdateResource(group);
-
-        dsHiveServer.ClientGroupRow row =
-          data.FindByResourceId(group.ResourceId);
-
-        if (row == null) {
-          row = data.NewClientGroupRow();
-          row.ResourceId = group.ResourceId;
-          data.AddClientGroupRow(row);
-        }
-
-        Convert(group, row);
-      }
-    }
-
-    public ClientGroup GetClientGroupById(long clientGroupId) {
-      ClientGroup clientGroup = new ClientGroup();
-
-      dsHiveServer.ClientGroupRow row =
-        data.FindByResourceId(clientGroupId);
-
-      if (row != null) {
-        Convert(row, clientGroup);
-
-        return clientGroup;
-      } else {
-        return null;
-      }
-    }
-
-    public ClientGroup GetClientGroupByName(string name) {
+        ResAdapter.Update(group);
+
+        base.Update(group);
+      }
+    }
+
+    public ClientGroup GetByName(string name) {
       ClientGroup group = new ClientGroup();
-
       Resource res =
-        ResAdapter.GetResourceByName(name);
+        ResAdapter.GetByName(name);
 
       if (res != null) {
-        dsHiveServer.ClientGroupRow row =
-          data.FindByResourceId(res.ResourceId);
-
-        if (row != null) {
-          Convert(row, group);
-
-          return group;
-        }
+        return GetById(res.Id);
       }
 
       return null;
-    }
-
-    public ICollection<ClientGroup> GetAllClientGroups() {
-      ICollection<ClientGroup> allClientGroups =
-        new List<ClientGroup>();
-
-      foreach (dsHiveServer.ClientGroupRow row in data) {
-        ClientGroup clientGroup = new ClientGroup();
-
-        Convert(row, clientGroup);
-        allClientGroups.Add(clientGroup);
-      }
-
-      return allClientGroups;
     }
 
@@ -288,13 +260,10 @@
       if (resource != null) {
         IEnumerable<dsHiveServer.ClientGroup_ResourceRow> clientGroupRows =
-         from clientGroup in
-           resourceClientGroupData.AsEnumerable<dsHiveServer.ClientGroup_ResourceRow>()
-         where clientGroup.ResourceId == resource.ResourceId
-         select clientGroup;
+         resourceClientGroupAdapter.GetDataByResourceId(resource.Id);
 
         foreach (dsHiveServer.ClientGroup_ResourceRow clientGroupRow in
           clientGroupRows) {
           ClientGroup clientGroup =
-            GetClientGroupById(clientGroupRow.ClientGroupId);
+            GetById(clientGroupRow.ClientGroupId);
           clientGroups.Add(clientGroup);
         }
@@ -305,32 +274,8 @@
 
     [MethodImpl(MethodImplOptions.Synchronized)]
-    public bool DeleteClientGroup(ClientGroup group) {
+    public override bool Delete(ClientGroup group) {
       if (group != null) {
-        dsHiveServer.ClientGroupRow row =
-          data.FindByResourceId(group.ResourceId);
-
-        if (row != null) {
-          ICollection<dsHiveServer.ClientGroup_ResourceRow> deleted =
-            new List<dsHiveServer.ClientGroup_ResourceRow>();
-
-          foreach (dsHiveServer.ClientGroup_ResourceRow resourceClientGroupRow in
-            resourceClientGroupData) {
-            if (resourceClientGroupRow.ClientGroupId == group.ResourceId ||
-              resourceClientGroupRow.ResourceId == group.ResourceId) {
-              deleted.Add(resourceClientGroupRow);
-            }
-          }
-
-          foreach (dsHiveServer.ClientGroup_ResourceRow resourceClientGroupRow in
-            deleted) {
-            resourceClientGroupData.RemoveClientGroup_ResourceRow(
-              resourceClientGroupRow);
-          }
-
-          row.Delete();
-          adapter.Update(row);
-
-          return ResAdapter.DeleteResource(group);
-        }
+        return base.Delete(group) && 
+          ResAdapter.Delete(group);
       }
 
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/DataAdapterBase.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/DataAdapterBase.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/DataAdapterBase.cs	(revision 995)
@@ -1,18 +1,145 @@
-﻿using System;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using HeuristicLab.Hive.Contracts.BusinessObjects;
+using System.Runtime.CompilerServices;
 
 namespace HeuristicLab.Hive.Server.ADODataAccess {
-  abstract class DataAdapterBase {
-    protected abstract void Update();
+  abstract class DataAdapterBase<AdapterT, ObjT, RowT>
+    where AdapterT: new() 
+    where RowT: System.Data.DataRow
+    where ObjT: IHiveObject, new() {
+    protected AdapterT adapter =
+      new AdapterT();
 
-    protected DataAdapterBase() {
-      ServiceLocator.GetTransactionManager().OnUpdate += 
-        new EventHandler(DataAdapterBase_OnUpdate);
+    #region Abstract methods
+    protected abstract RowT Convert(ObjT obj, RowT row);
+
+    protected abstract ObjT Convert(RowT row, ObjT obj);
+
+    protected abstract RowT InsertNewRow(ObjT obj);
+
+    protected abstract void UpdateRow(RowT row);
+
+    protected abstract IEnumerable<RowT> FindById(long id);
+
+    protected abstract IEnumerable<RowT> FindAll();
+    #endregion
+
+    protected delegate IEnumerable<RowT> Selector();
+
+    protected virtual RowT FindSingleRow(Selector selector) {
+      RowT row = default(RowT);
+
+      IEnumerable<RowT> found =
+        selector();
+
+      if (found.Count<RowT>() == 1)
+        row = found.First<RowT>();
+
+      return row;
     }
 
-    void DataAdapterBase_OnUpdate(object sender, EventArgs e) {
-      this.Update();
+    protected virtual ObjT FindSingle(Selector selector) {
+      RowT row = FindSingleRow(selector);
+
+      if (row != null) {
+        ObjT obj = new ObjT();
+        Convert(row, obj);
+
+        return obj;
+      } else {
+        return default(ObjT);
+      }
+    }
+
+    protected virtual ICollection<ObjT> FindMultiple(Selector selector) {
+      IEnumerable<RowT> found =
+        selector();
+
+      IList<ObjT> result =
+        new List<ObjT>();
+
+      foreach (RowT row in found) {
+        ObjT obj = new ObjT();
+        Convert(row, obj);
+        result.Add(obj);
+      }
+
+      return result;
+    }
+
+    protected virtual RowT GetRowById(long id) {
+      return FindSingleRow(
+        delegate() {
+          return FindById(id);
+        });
+    }
+
+    [MethodImpl(MethodImplOptions.Synchronized)]
+    public virtual void Update(ObjT obj) {
+      if (obj != null) {
+        RowT row =
+          GetRowById(obj.Id);
+
+        if (row == null) {
+          row = InsertNewRow(obj);
+        }
+
+        Convert(obj, row);
+
+        UpdateRow(row);
+
+        obj.Id = (long)row[row.Table.PrimaryKey[0]];
+      }
+    }
+
+    public virtual ObjT GetById(long id) {
+      return FindSingle(delegate() {
+        return FindById(id);
+      });
+    }
+
+    public virtual ICollection<ObjT> GetAll() {
+      return new List<ObjT>(
+        FindMultiple(
+          new Selector(FindAll)));
+    }
+
+    [MethodImpl(MethodImplOptions.Synchronized)]
+    public virtual bool Delete(ObjT obj) {
+      if (obj != null) {
+        RowT row =
+          GetRowById(obj.Id);
+
+        if (row != null) {
+          row.Delete();
+          UpdateRow(row);
+        }
+      }
+
+      return false;
     }
   }
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/HeuristicLab.Hive.Server.ADODataAccess.csproj
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/HeuristicLab.Hive.Server.ADODataAccess.csproj	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/HeuristicLab.Hive.Server.ADODataAccess.csproj	(revision 995)
@@ -64,4 +64,5 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="CachedDataAdapter.cs" />
     <Compile Include="ClientAdapter.cs" />
     <Compile Include="ClientGroupAdapter.cs" />
@@ -77,4 +78,5 @@
     </Compile>
     <Compile Include="HiveServerADODataAccessPlugin.cs" />
+    <Compile Include="ICachedDataAdapter.cs" />
     <Compile Include="JobAdapter.cs" />
     <Compile Include="PermissionOwnerAdapter.cs" />
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ICachedDataAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ICachedDataAdapter.cs	(revision 995)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ICachedDataAdapter.cs	(revision 995)
@@ -0,0 +1,31 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HeuristicLab.Hive.Server.ADODataAccess {
+  internal interface ICachedDataAdapter {
+    void SyncWithDb();
+  }
+}
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/JobAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/JobAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/JobAdapter.cs	(revision 995)
@@ -30,10 +30,13 @@
 
 namespace HeuristicLab.Hive.Server.ADODataAccess {
-  class JobAdapter : DataAdapterBase, IJobAdapter {
-    private dsHiveServerTableAdapters.JobTableAdapter adapter =
-        new dsHiveServerTableAdapters.JobTableAdapter();
-
-    private dsHiveServer.JobDataTable data =
-      new dsHiveServer.JobDataTable();
+  class JobAdapter :
+    CachedDataAdapter<dsHiveServerTableAdapters.JobTableAdapter,
+                      Job, 
+                      dsHiveServer.JobRow, 
+                      dsHiveServer.JobDataTable>, 
+    IJobAdapter {
+    #region Fields
+    dsHiveServer.JobDataTable data =
+        new dsHiveServer.JobDataTable();
 
     private IClientAdapter clientAdapter = null;
@@ -59,25 +62,19 @@
       }
     }
-
-    public JobAdapter() {
-      adapter.Fill(data);
-    }
-
-    protected override void Update() {
-      this.adapter.Update(this.data);
-    }
-
-    private Job Convert(dsHiveServer.JobRow row,
+    #endregion
+
+    #region Overrides
+    protected override Job Convert(dsHiveServer.JobRow row,
       Job job) {
       if (row != null && job != null) {
-        job.JobId = row.JobId;
+        job.Id = row.JobId;
 
         if (!row.IsParentJobIdNull())
-          job.ParentJob = GetJobById(row.ParentJobId);
+          job.ParentJob = GetById(row.ParentJobId);
         else
           job.ParentJob = null;
 
         if (!row.IsResourceIdNull())
-          job.Client = ClientAdapter.GetClientById(row.ResourceId);
+          job.Client = ClientAdapter.GetById(row.ResourceId);
         else
           job.Client = null;
@@ -86,5 +83,5 @@
           job.State = (State)Enum.Parse(job.State.GetType(), row.Status);
         else
-          job.State = State.idle;
+          job.State = State.nullState;
 
         return job;
@@ -93,20 +90,23 @@
     }
 
-    private dsHiveServer.JobRow Convert(Job job,
+    protected override dsHiveServer.JobRow Convert(Job job,
       dsHiveServer.JobRow row) {
       if (job != null && row != null) {
         if (job.Client != null) {
-          ClientAdapter.UpdateClient(job.Client);
-          row.ResourceId = job.Client.ResourceId;
+          ClientAdapter.Update(job.Client);
+          row.ResourceId = job.Client.Id;
         } else
           row.SetResourceIdNull();
 
         if (job.ParentJob != null) {
-          UpdateJob(job.ParentJob);
-          row.ParentJobId = job.ParentJob.JobId;
+          Update(job.ParentJob);
+          row.ParentJobId = job.ParentJob.Id;
         } else
           row.SetParentJobIdNull();
 
-        row.Status = job.State.ToString();
+        if (job.State != State.nullState)
+          row.Status = job.State.ToString();
+        else
+          row.SetStatusNull();
       }
 
@@ -114,72 +114,75 @@
     }
 
+    protected override void UpdateRow(dsHiveServer.JobRow row) {
+      adapter.Update(row);
+    }
+
+    protected override dsHiveServer.JobRow 
+      InsertNewRow(Job job) {      
+      dsHiveServer.JobRow row = data.NewJobRow();
+      data.AddJobRow(row);
+
+      return row;
+    }
+
+    protected override dsHiveServer.JobRow 
+      InsertNewRowInCache(Job job) {
+      dsHiveServer.JobRow row = cache.NewJobRow();
+      cache.AddJobRow(row);
+
+      return row;
+    }
+
+    protected override void FillCache() {
+      adapter.FillByActive(cache);
+    }
+
+    public override void SyncWithDb() {
+      this.adapter.Update(this.cache);
+    }
+
+    protected override bool PutInCache(Job job) {
+      return job != null
+        && job.State != State.offline 
+        && job.State != State.nullState;
+    }
+
+    protected override IEnumerable<dsHiveServer.JobRow>
+      FindById(long id) {
+      return adapter.GetDataById(id);
+    }
+
+    protected override dsHiveServer.JobRow
+      FindCachedById(long id) {
+      return cache.FindByJobId(id);
+    }
+
+    protected override IEnumerable<dsHiveServer.JobRow>
+      FindAll() {
+      return FindMultipleRows(
+        new Selector(adapter.GetData),
+        new Selector(cache.AsEnumerable<dsHiveServer.JobRow>));
+    }
+
+    #endregion
+
     #region IJobAdapter Members
-    [MethodImpl(MethodImplOptions.Synchronized)]
-    public void UpdateJob(Job job) {
+    public ICollection<Job> GetAllSubjobs(Job job) {
       if (job != null) {
-        dsHiveServer.JobRow row =
-          data.FindByJobId(job.JobId);
-
-        if (row == null) {
-          row = data.NewJobRow();
-          data.AddJobRow(row);
-
-          //write row to db to get primary key
-          adapter.Update(row);
-        }
-
-        Convert(job, row);
-        job.JobId = row.JobId;
-      }
-    }
-
-    public Job GetJobById(long id) {
-      dsHiveServer.JobRow row =
-        data.FindByJobId(id);
-
-      if (row != null) {
-        Job job = new Job();
-        
-        Convert(row, job);
-
-        return job;
+        return
+          base.FindMultiple(
+            delegate() {
+              return adapter.GetDataBySubjobs(job.Id);
+            },
+            delegate() {
+              return from j in
+                   cache.AsEnumerable<dsHiveServer.JobRow>()
+                 where  !j.IsParentJobIdNull() && 
+                        j.ParentJobId == job.Id
+                 select j;
+            });
       }
 
       return null;
-    }
-
-    public ICollection<Job> GetAllJobs() {
-      IList<Job> allJobs =
-        new List<Job>();
-
-      foreach (dsHiveServer.JobRow row in data) {
-        Job job = new Job();
-        Convert(row, job);
-        allJobs.Add(job);
-      }
-
-      return allJobs;
-    }
-
-    public ICollection<Job> GetAllSubjobs(Job job) {
-      IList<Job> allJobs =
-        new List<Job>();
-
-      if (job != null) {
-        IEnumerable<dsHiveServer.JobRow> clientJobs =
-         from j in
-           data.AsEnumerable<dsHiveServer.JobRow>()
-         where j.ParentJobId == job.JobId
-         select j;
-
-        foreach (dsHiveServer.JobRow row in
-          clientJobs) {
-          Job j = new Job();
-          Convert(row, j);
-          allJobs.Add(j);
-        }
-      }
-
-      return allJobs;
     }
 
@@ -189,67 +192,40 @@
 
     public ICollection<Job> GetJobsOf(ClientInfo client) {
-      IList<Job> allJobs =
-        new List<Job>();
-
       if (client != null) {
-        IEnumerable<dsHiveServer.JobRow> clientJobs =
-         from job in
-           data.AsEnumerable<dsHiveServer.JobRow>()
-         where !job.IsResourceIdNull() && 
-          job.ResourceId == client.ResourceId
-         select job;
-
-        foreach (dsHiveServer.JobRow row in
-          clientJobs) {
-          Job job = new Job();
-          Convert(row, job);
-          allJobs.Add(job);
-        }
-      }
-
-      return allJobs;
+        return
+          base.FindMultiple(
+            delegate() {
+              return adapter.GetDataByClient(client.Id);
+            },
+            delegate() {
+              return from job in
+                 cache.AsEnumerable<dsHiveServer.JobRow>()
+               where !job.IsResourceIdNull() && 
+                      job.ResourceId == client.Id
+               select job;
+            });
+      }
+
+      return null;
     }
 
     public ICollection<Job> GetJobsOf(User user) {
-      IList<Job> allJobs =
-        new List<Job>();
-
       if (user != null) {
-        IEnumerable<dsHiveServer.JobRow> userJobs =
-        from job in
-          data.AsEnumerable<dsHiveServer.JobRow>()
-        where
-          !job.IsPermissionOwnerIdNull() &&
-          job.PermissionOwnerId == user.PermissionOwnerId
-        select job;
-
-        foreach (dsHiveServer.JobRow row in
-          userJobs) {
-          Job job = new Job();
-          Convert(row, job);
-          allJobs.Add(job);
-        }
-      }
-
-      return allJobs;
-    }
-
-    [MethodImpl(MethodImplOptions.Synchronized)]
-    public bool DeleteJob(Job job) {
-      if (job != null) {
-        dsHiveServer.JobRow row =
-          data.FindByJobId(job.JobId);
-
-        if (row != null) {
-          row.Delete();
-          adapter.Update(row);
-
-          return true;
-        }
-      }
-
-      return false;
-    }
-
+        return 
+          base.FindMultiple(
+            delegate() {
+              return adapter.GetDataByUser(user.Id);
+            },
+            delegate() {
+              return from job in
+                cache.AsEnumerable<dsHiveServer.JobRow>()
+              where !job.IsPermissionOwnerIdNull() &&
+                job.PermissionOwnerId == user.Id
+              select job;
+            });
+      }
+
+      return null;
+    }
     #endregion
   }
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/PermissionOwnerAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/PermissionOwnerAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/PermissionOwnerAdapter.cs	(revision 995)
@@ -30,23 +30,20 @@
 
 namespace HeuristicLab.Hive.Server.ADODataAccess {
-  class PermissionOwnerAdapter: DataAdapterBase, IPermissionOwnerAdapter {
-    private dsHiveServerTableAdapters.PermissionOwnerTableAdapter adapter =
-     new dsHiveServerTableAdapters.PermissionOwnerTableAdapter();
+  class PermissionOwnerAdapter: 
+    DataAdapterBase<
+      dsHiveServerTableAdapters.PermissionOwnerTableAdapter, 
+      PermissionOwner, 
+      dsHiveServer.PermissionOwnerRow>, 
+    IPermissionOwnerAdapter {
+    #region Fields
+    dsHiveServer.PermissionOwnerDataTable data =
+        new dsHiveServer.PermissionOwnerDataTable();
+    #endregion
 
-    private dsHiveServer.PermissionOwnerDataTable data =
-      new dsHiveServer.PermissionOwnerDataTable();
-
-    public PermissionOwnerAdapter() {
-      adapter.Fill(data);
-    }
-
-    protected override void Update() {
-      this.adapter.Update(this.data);
-    }
-
-    private PermissionOwner Convert(dsHiveServer.PermissionOwnerRow row,
+    #region Overrides
+    protected override PermissionOwner Convert(dsHiveServer.PermissionOwnerRow row,
       PermissionOwner permOwner) {
       if (row != null && permOwner != null) {
-        permOwner.PermissionOwnerId = row.PermissionOwnerId;
+        permOwner.Id = row.PermissionOwnerId;
 
         if (!row.IsNameNull())
@@ -60,5 +57,5 @@
     }
 
-    private dsHiveServer.PermissionOwnerRow Convert(PermissionOwner permOwner,
+    protected override dsHiveServer.PermissionOwnerRow Convert(PermissionOwner permOwner,
       dsHiveServer.PermissionOwnerRow row) {
       if (row != null && permOwner != null) {
@@ -69,29 +66,37 @@
         return null;
     }
-    
+
+    protected override dsHiveServer.PermissionOwnerRow
+      InsertNewRow(PermissionOwner permOwner) {
+      dsHiveServer.PermissionOwnerRow row =
+        data.NewPermissionOwnerRow();
+
+      data.AddPermissionOwnerRow(row);
+
+      return row;
+    }
+
+    protected override void
+      UpdateRow(dsHiveServer.PermissionOwnerRow row) {
+      adapter.Update(row);
+    }
+
+    protected override IEnumerable<dsHiveServer.PermissionOwnerRow>
+      FindById(long id) {
+      return adapter.GetDataById(id);
+    }
+
+    protected override IEnumerable<dsHiveServer.PermissionOwnerRow>
+      FindAll() {
+      return adapter.GetData();
+    }
+    #endregion
+
     #region IPermissionOwner Members
-    [MethodImpl(MethodImplOptions.Synchronized)]
-    public void UpdatePermissionOwner(PermissionOwner permOwner) {
+
+    public bool GetById(PermissionOwner permOwner) {
       if (permOwner != null) {
         dsHiveServer.PermissionOwnerRow row = 
-          data.FindByPermissionOwnerId(permOwner.PermissionOwnerId);
-        
-        if (row == null) {
-          row = data.NewPermissionOwnerRow();
-          data.AddPermissionOwnerRow(row);
-
-          //write row to db to get primary key
-          adapter.Update(row);
-        }
-
-        Convert(permOwner, row);
-        permOwner.PermissionOwnerId = row.PermissionOwnerId;
-      }
-    }
-
-    public bool GetPermissionOwnerById(PermissionOwner permOwner) {
-      if (permOwner != null) {
-          dsHiveServer.PermissionOwnerRow row =
-            data.FindByPermissionOwnerId(permOwner.PermissionOwnerId);
+          base.GetRowById(permOwner.Id);
 
         if(row != null) {
@@ -104,65 +109,14 @@
       return false;
     }
-
-    public PermissionOwner GetPermissionOwnerById(long permOwnerId) {
-      PermissionOwner permOwner = new PermissionOwner();
-      permOwner.PermissionOwnerId = permOwnerId;
-
-      if (GetPermissionOwnerById(permOwner))
-        return permOwner;
-      else
-        return null;
-    }
-
-    public PermissionOwner GetPermissionOwnerByName(String name) {
-       dsHiveServer.PermissionOwnerRow row = null;
-
-      IEnumerable<dsHiveServer.PermissionOwnerRow> permOwners =
-        from r in
-          data.AsEnumerable<dsHiveServer.PermissionOwnerRow>()
-        where !r.IsNameNull() && r.Name == name
-        select r;
-
-      if (permOwners.Count<dsHiveServer.PermissionOwnerRow>() == 1)
-        row = permOwners.First<dsHiveServer.PermissionOwnerRow>();
-
-      if (row != null) {
-        PermissionOwner permOwner = new PermissionOwner();
-        Convert(row, permOwner);
-
-        return permOwner;
-      } else {
-        return null;
-      }
-    }
-
-    public ICollection<PermissionOwner> GetAllPermissionOwners() {
-      ICollection<PermissionOwner> allPermissionOwners =
-        new List<PermissionOwner>();
-
-      foreach (dsHiveServer.PermissionOwnerRow row in data) {
-        PermissionOwner permOwner = new PermissionOwner();
-        Convert(row, permOwner);
-        allPermissionOwners.Add(permOwner);
+    
+    public PermissionOwner GetByName(String name) {
+      if (name != null) {
+        return base.FindSingle(
+          delegate() {
+            return adapter.GetDataByName(name);
+          });
       }
 
-      return allPermissionOwners;
-    }
-
-    [MethodImpl(MethodImplOptions.Synchronized)]
-    public bool DeletePermissionOwner(PermissionOwner permOwner) {
-      if (permOwner != null) {
-          dsHiveServer.PermissionOwnerRow row = 
-            data.FindByPermissionOwnerId(permOwner.PermissionOwnerId);
-
-          if(row != null) {
-            row.Delete();
-            adapter.Update(row);
-          
-            return true;
-          }
-        }
-
-      return false;
+      return null;
     }
 
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ResourceAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ResourceAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ResourceAdapter.cs	(revision 995)
@@ -29,23 +29,32 @@
 
 namespace HeuristicLab.Hive.Server.ADODataAccess {
-  class ResourceAdapter: DataAdapterBase, IResourceAdapter {
-    private dsHiveServerTableAdapters.ResourceTableAdapter adapter =
-        new dsHiveServerTableAdapters.ResourceTableAdapter();
-
-    private dsHiveServer.ResourceDataTable data =
+  class ResourceAdapter: 
+    CachedDataAdapter<
+      dsHiveServerTableAdapters.ResourceTableAdapter, 
+      Resource, 
+      dsHiveServer.ResourceRow, 
+      dsHiveServer.ResourceDataTable>,  
+    IResourceAdapter {
+    #region Fields
+    dsHiveServer.ResourceDataTable data =
         new dsHiveServer.ResourceDataTable();
 
-    public ResourceAdapter() {
-      adapter.Fill(data);
+    private IClientAdapter clientAdapter = null;
+
+    private IClientAdapter ClientAdapter {
+      get {
+        if (clientAdapter == null)
+          clientAdapter = ServiceLocator.GetClientAdapter();
+        
+        return clientAdapter;
+      }
     }
+    #endregion
 
-    protected override void Update() {
-      this.adapter.Update(this.data);
-    }
-
-    private Resource Convert(dsHiveServer.ResourceRow row,
+    #region Overrides
+    protected override Resource Convert(dsHiveServer.ResourceRow row,
       Resource resource) {
       if (row != null && resource != null) {
-        resource.ResourceId = row.ResourceId;
+        resource.Id = row.ResourceId;
         if (!row.IsNameNull())
           resource.Name = row.Name;
@@ -58,5 +67,5 @@
     }
 
-    private dsHiveServer.ResourceRow Convert(Resource resource,
+    protected override dsHiveServer.ResourceRow Convert(Resource resource,
       dsHiveServer.ResourceRow row) {
       if (resource != null && row != null) {
@@ -68,28 +77,61 @@
     }
 
+    protected override void UpdateRow(dsHiveServer.ResourceRow row) {
+      adapter.Update(row);
+    }
+
+    protected override dsHiveServer.ResourceRow
+      InsertNewRow(Resource resource) {
+      dsHiveServer.ResourceRow row = data.NewResourceRow();
+      data.AddResourceRow(row);
+
+      return row;
+    }
+
+    protected override dsHiveServer.ResourceRow
+      InsertNewRowInCache(Resource resource) {
+      dsHiveServer.ResourceRow row = cache.NewResourceRow();
+      cache.AddResourceRow(row);
+
+      return row;
+    }
+
+    protected override void FillCache() {
+      cache = adapter.GetDataByActive();
+    }
+
+    public override void SyncWithDb() {
+      adapter.Update(cache);
+    }
+
+    protected override bool PutInCache(Resource obj) {
+      return (obj is ClientInfo &&
+        (obj as ClientInfo).State != State.offline);
+    }
+
+    protected override IEnumerable<dsHiveServer.ResourceRow>
+      FindById(long id) {
+      return adapter.GetDataById(id);
+    }
+
+    protected override dsHiveServer.ResourceRow
+      FindCachedById(long id) {
+      return cache.FindByResourceId(id);
+    }
+
+    protected override IEnumerable<dsHiveServer.ResourceRow>
+      FindAll() {
+      return FindMultipleRows(
+        new Selector(adapter.GetData),
+        new Selector(cache.AsEnumerable<dsHiveServer.ResourceRow>));
+    }
+    #endregion
+
     #region IResourceAdapter Members
-    [MethodImpl(MethodImplOptions.Synchronized)]
-    public void UpdateResource(Resource resource) {
+    public bool GetById(Resource resource) {
       if (resource != null) {
         dsHiveServer.ResourceRow row =
-          data.FindByResourceId(resource.ResourceId);
+          GetRowById(resource.Id);
 
-        if (row == null) {
-          row = data.NewResourceRow();
-          data.AddResourceRow(row);
-
-          //write row to db to get primary key
-          adapter.Update(row);
-        } 
-
-        Convert(resource, row);
-        resource.ResourceId = row.ResourceId;
-      }
-    }
-
-    public bool GetResourceById(Resource resource) {
-      if (resource != null) {
-        dsHiveServer.ResourceRow row =
-          data.FindByResourceId(resource.ResourceId);
         if (row != null) {
           Convert(row, resource);
@@ -102,25 +144,17 @@
     }
 
-    public Resource GetResourceById(long resourceId) {
-      Resource resource = new Resource();
-      resource.ResourceId = resourceId;
-
-      if(GetResourceById(resource)) 
-        return resource;
-      else 
-        return null;
-    }
-
-    public Resource GetResourceByName(string name) {
-      dsHiveServer.ResourceRow row = null;
-
-      IEnumerable<dsHiveServer.ResourceRow> permOwners =
-        from r in
-          data.AsEnumerable<dsHiveServer.ResourceRow>()
-        where !r.IsNameNull() && r.Name == name
-        select r;
-
-      if (permOwners.Count<dsHiveServer.ResourceRow>() == 1)
-        row = permOwners.First<dsHiveServer.ResourceRow>();
+    public Resource GetByName(string name) {
+      dsHiveServer.ResourceRow row =
+        base.FindSingleRow(
+          delegate() {
+            return adapter.GetDataByName(name);
+          },
+          delegate() {
+            return from r in
+                     cache.AsEnumerable<dsHiveServer.ResourceRow>()
+                   where !r.IsNameNull() && 
+                          r.Name == name
+                   select r;
+          });
 
       if (row != null) {
@@ -134,34 +168,4 @@
     }
 
-    public ICollection<Resource> GetAllResources() {
-      IList<Resource> allResources =
-        new List<Resource>();
-      
-      foreach (dsHiveServer.ResourceRow row in data) {
-        Resource resource = new Resource();
-        Convert(row, resource);
-        allResources.Add(resource);
-      }
-
-      return allResources;
-    }
-
-    [MethodImpl(MethodImplOptions.Synchronized)]
-    public bool DeleteResource(Resource resource) {
-      if(resource != null) {
-        dsHiveServer.ResourceRow row =
-          data.FindByResourceId(resource.ResourceId);
-
-        if (row != null) {
-          row.Delete();
-          adapter.Update(row);
-
-          return true;
-        } 
-      }
-       
-      return false;
-    }
-
     #endregion
   }
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserAdapter.cs	(revision 995)
@@ -30,9 +30,12 @@
 
 namespace HeuristicLab.Hive.Server.ADODataAccess {
-  class UserAdapter : DataAdapterBase, IUserAdapter {
-    private dsHiveServerTableAdapters.HiveUserTableAdapter adapter =
-        new dsHiveServerTableAdapters.HiveUserTableAdapter();
-
-    private dsHiveServer.HiveUserDataTable data =
+  class UserAdapter :
+    DataAdapterBase<
+      dsHiveServerTableAdapters.HiveUserTableAdapter,
+      User,
+      dsHiveServer.HiveUserRow>,
+    IUserAdapter {
+    #region Fields
+    dsHiveServer.HiveUserDataTable data =
         new dsHiveServer.HiveUserDataTable();
 
@@ -52,7 +55,6 @@
     private IUserGroupAdapter UserGroupAdapter {
       get {
-        if(userGroupAdapter == null) {
+        if (userGroupAdapter == null)
           userGroupAdapter = ServiceLocator.GetUserGroupAdapter();
-        }
 
         return userGroupAdapter;
@@ -64,26 +66,19 @@
     private IJobAdapter JobAdapter {
       get {
-        if (jobAdapter == null) {
+        if (jobAdapter == null)
           jobAdapter = ServiceLocator.GetJobAdapter();
-        }
 
         return jobAdapter;
       }
     }
+    #endregion
 
-    public UserAdapter() {
-      adapter.Fill(data);
-    }
-
-    protected override void Update() {
-      this.adapter.Update(this.data);
-    }
-
-    private User Convert(dsHiveServer.HiveUserRow row, 
+    #region Overrides
+    protected override User Convert(dsHiveServer.HiveUserRow row,
       User user) {
       if (row != null && user != null) {
         /*Parent - PermissionOwner*/
-        user.PermissionOwnerId = row.PermissionOwnerId;
-        PermOwnerAdapter.GetPermissionOwnerById(user);
+        user.Id = row.PermissionOwnerId;
+        PermOwnerAdapter.GetById(user);
 
         /*User*/
@@ -98,63 +93,62 @@
     }
 
-    private dsHiveServer.HiveUserRow Convert(User user,
+    protected override dsHiveServer.HiveUserRow Convert(User user,
       dsHiveServer.HiveUserRow row) {
       if (user != null && row != null) {
-        row.Password = user.Password;
+        if (user.Password == null)
+          row.SetPasswordNull();
+        else
+          row.Password = user.Password;
 
         return row;
       } else
-        return null;     
+        return null;
     }
+
+    protected override dsHiveServer.HiveUserRow
+      InsertNewRow(User user) {
+      dsHiveServer.HiveUserRow row =
+        data.NewHiveUserRow();
+
+      row.PermissionOwnerId = user.Id;
+
+      data.AddHiveUserRow(row);
+
+      return row;
+    }
+
+    protected override void
+      UpdateRow(dsHiveServer.HiveUserRow row) {
+      adapter.Update(row);
+    }
+
+    protected override IEnumerable<dsHiveServer.HiveUserRow>
+      FindById(long id) {
+      return adapter.GetDataById(id);
+    }
+
+    protected override IEnumerable<dsHiveServer.HiveUserRow>
+      FindAll() {
+      return adapter.GetData();
+    }
+    #endregion
 
     #region IUserAdapter Members
 
     [MethodImpl(MethodImplOptions.Synchronized)]
-    public void UpdateUser(User user) {
+    public override void Update(User user) {
       if (user != null) {
-        PermOwnerAdapter.UpdatePermissionOwner(user);
+        PermOwnerAdapter.Update(user);
 
-        dsHiveServer.HiveUserRow row = 
-          data.FindByPermissionOwnerId(user.PermissionOwnerId);
-        if (row == null) {
-          row = data.NewHiveUserRow();
-          row.PermissionOwnerId = user.PermissionOwnerId;
-          data.AddHiveUserRow(row);
-        } 
-
-        Convert(user, row);
+        base.Update(user);
       }
     }
 
-    public User GetUserById(long userId) {
-      User user = new User();
-
-      dsHiveServer.HiveUserRow row =
-          data.FindByPermissionOwnerId(userId);
-
-      if(row != null) {
-        Convert(row, user);
-
-        return user;
-      } else {
-        return null;
-      }
-    }
-
-    public User GetUserByName(String name) {
-      User user = new User();
-
-      PermissionOwner permOwner =
-        PermOwnerAdapter.GetPermissionOwnerByName(name);
-
-      if (permOwner != null) {
-        dsHiveServer.HiveUserRow row =
-          data.FindByPermissionOwnerId(permOwner.PermissionOwnerId);
-
-        if (row != null) {
-          Convert(row, user);
-
-          return user;
-        }
+    public User GetByName(String name) {
+      if (name != null) {
+        return base.FindSingle(
+          delegate() {
+            return adapter.GetDataByName(name);
+          });
       }
 
@@ -162,44 +156,24 @@
     }
 
-    public ICollection<User> GetAllUsers() {
-      ICollection<User> allUsers =
-        new List<User>();
+    [MethodImpl(MethodImplOptions.Synchronized)]
+    public override bool Delete(User user) {
+      if (user != null) {
+        //Referential integrity with user groups
+        ICollection<UserGroup> userGroups =
+          UserGroupAdapter.MemberOf(user);
+        foreach (UserGroup group in userGroups) {
+          group.Members.Remove(user);
+          UserGroupAdapter.Update(group);
+        }
 
-      foreach (dsHiveServer.HiveUserRow row in data) {
-        User user = new User();
-        Convert(row, user);
-        allUsers.Add(user);
-      }
+        //Referential integrity with jobs
+        ICollection<Job> jobs =
+          JobAdapter.GetJobsOf(user);
+        foreach (Job job in jobs) {
+          JobAdapter.Delete(job);
+        }
 
-      return allUsers;
-    }
-
-    [MethodImpl(MethodImplOptions.Synchronized)]
-    public bool DeleteUser(User user) {
-      if (user != null) {
-        dsHiveServer.HiveUserRow row =
-          data.FindByPermissionOwnerId(user.PermissionOwnerId);
-
-        if (row != null) {
-          //Referential integrity with user groups
-          ICollection<UserGroup> userGroups =
-            UserGroupAdapter.MemberOf(user);
-          foreach (UserGroup group in userGroups) {
-            group.Members.Remove(user);
-            UserGroupAdapter.UpdateUserGroup(group);
-          }
-
-          //Referential integrity with jobs
-          ICollection<Job> jobs =
-            JobAdapter.GetJobsOf(user);
-          foreach (Job job in jobs) {
-            JobAdapter.DeleteJob(job);
-          }
-
-          row.Delete();
-          adapter.Update(row);
-
-          return PermOwnerAdapter.DeletePermissionOwner(user);
-        }
+        return base.Delete(user) &&
+            PermOwnerAdapter.Delete(user);
       }
 
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserGroupAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserGroupAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserGroupAdapter.cs	(revision 995)
@@ -31,16 +31,17 @@
 
 namespace HeuristicLab.Hive.Server.ADODataAccess {
-  class UserGroupAdapter: DataAdapterBase, IUserGroupAdapter {
-    private dsHiveServerTableAdapters.UserGroupTableAdapter adapter =
-        new dsHiveServerTableAdapters.UserGroupTableAdapter();
-
-    private dsHiveServer.UserGroupDataTable data =
-      new dsHiveServer.UserGroupDataTable();
+  class UserGroupAdapter: 
+    DataAdapterBase<
+      dsHiveServerTableAdapters.UserGroupTableAdapter, 
+      UserGroup, 
+      dsHiveServer.UserGroupRow>,
+    IUserGroupAdapter {
+
+    #region Fields
+    dsHiveServer.UserGroupDataTable data =
+        new dsHiveServer.UserGroupDataTable();
 
     private dsHiveServerTableAdapters.PermissionOwner_UserGroupTableAdapter permOwnerUserGroupAdapter =
       new dsHiveServerTableAdapters.PermissionOwner_UserGroupTableAdapter();
-
-    private dsHiveServer.PermissionOwner_UserGroupDataTable permOwnerUserGroupData =
-      new dsHiveServer.PermissionOwner_UserGroupDataTable();
 
     private IPermissionOwnerAdapter permOwnerAdapter = null;
@@ -65,28 +66,17 @@
       }
     }
-
-    public UserGroupAdapter() {
-      adapter.Fill(data);
-      permOwnerUserGroupAdapter.Fill(permOwnerUserGroupData);
-    }
-
-    protected override void Update() {
-      this.adapter.Update(this.data);
-      this.permOwnerUserGroupAdapter.Update(permOwnerUserGroupData);
-    }
-
-    private UserGroup Convert(dsHiveServer.UserGroupRow row,
+    #endregion
+
+    #region Overrides
+    protected override UserGroup Convert(dsHiveServer.UserGroupRow row,
       UserGroup userGroup) {
       if (row != null && userGroup != null) {
         /*Parent - Permission Owner*/
-        userGroup.PermissionOwnerId = row.PermissionOwnerId;
-        PermOwnerAdapter.GetPermissionOwnerById(userGroup);
+        userGroup.Id = row.PermissionOwnerId;
+        PermOwnerAdapter.GetById(userGroup);
 
         //first check for created references
-        IEnumerable<dsHiveServer.PermissionOwner_UserGroupRow> userGroupRows =
-          from permOwner in
-            permOwnerUserGroupData.AsEnumerable<dsHiveServer.PermissionOwner_UserGroupRow>()
-          where permOwner.UserGroupId == userGroup.PermissionOwnerId
-          select permOwner;
+        dsHiveServer.PermissionOwner_UserGroupDataTable userGroupRows =
+          permOwnerUserGroupAdapter.GetDataByUserGroupId(userGroup.Id);
 
         foreach (dsHiveServer.PermissionOwner_UserGroupRow permOwnerUserGroupRow in
@@ -97,5 +87,5 @@
             from p in
               userGroup.Members
-            where p.PermissionOwnerId == permOwnerUserGroupRow.PermissionOwnerId
+            where p.Id == permOwnerUserGroupRow.PermissionOwnerId
             select p;
           if (permOwners.Count<PermissionOwner>() == 1)
@@ -104,10 +94,10 @@
           if (permOwner == null) {
             PermissionOwner permissionOwner = 
-              UserAdapter.GetUserById(permOwnerUserGroupRow.PermissionOwnerId);
+              UserAdapter.GetById(permOwnerUserGroupRow.PermissionOwnerId);
 
             if (permissionOwner == null) {
               //is a user group
               permissionOwner =
-                GetUserGroupById(permOwnerUserGroupRow.PermissionOwnerId);
+                GetById(permOwnerUserGroupRow.PermissionOwnerId);
             }
 
@@ -122,10 +112,9 @@
 
         foreach (PermissionOwner permOwner in userGroup.Members) {
-          dsHiveServer.PermissionOwner_UserGroupRow permOwnerUserGroupRow =
-            permOwnerUserGroupData.FindByPermissionOwnerIdUserGroupId(
-              permOwner.PermissionOwnerId,
-              userGroup.PermissionOwnerId);
-
-          if (permOwnerUserGroupRow == null) {
+          dsHiveServer.PermissionOwner_UserGroupDataTable found =
+            permOwnerUserGroupAdapter.GetDataByPermownerUsergroupId(
+              permOwner.Id,
+              userGroup.Id);
+          if (found.Count != 1) {
             deleted.Add(permOwner);
           }
@@ -141,8 +130,8 @@
     }
 
-    private dsHiveServer.UserGroupRow Convert(UserGroup userGroup,
+    protected override dsHiveServer.UserGroupRow Convert(UserGroup userGroup,
       dsHiveServer.UserGroupRow row) {
       if (userGroup != null && row != null) {
-        row.PermissionOwnerId = userGroup.PermissionOwnerId;
+        row.PermissionOwnerId = userGroup.Id;
       
         //update references
@@ -150,35 +139,37 @@
           //first update the member to make sure it exists in the DB
           if (permOwner is User) {
-            UserAdapter.UpdateUser(permOwner as User);
+            UserAdapter.Update(permOwner as User);
           } else if (permOwner is UserGroup) {
-            UpdateUserGroup(permOwner as UserGroup);
+            Update(permOwner as UserGroup);
           }
 
           //secondly check for created references
           dsHiveServer.PermissionOwner_UserGroupRow permOwnerUserGroupRow =
-            permOwnerUserGroupData.FindByPermissionOwnerIdUserGroupId(
-              permOwner.PermissionOwnerId,
-              userGroup.PermissionOwnerId);
+            null;
+          dsHiveServer.PermissionOwner_UserGroupDataTable found = 
+            permOwnerUserGroupAdapter.GetDataByPermownerUsergroupId(
+              permOwner.Id,
+              userGroup.Id);
+          if (found.Count == 1)
+            permOwnerUserGroupRow = found[0];
 
           if (permOwnerUserGroupRow == null) {
             permOwnerUserGroupRow = 
-              permOwnerUserGroupData.NewPermissionOwner_UserGroupRow();
+              found.NewPermissionOwner_UserGroupRow();
 
             permOwnerUserGroupRow.PermissionOwnerId =
-              permOwner.PermissionOwnerId;
+              permOwner.Id;
             permOwnerUserGroupRow.UserGroupId =
-              userGroup.PermissionOwnerId;
-
-            permOwnerUserGroupData.AddPermissionOwner_UserGroupRow(
-              permOwnerUserGroupRow);
+              userGroup.Id;
+
+            found.AddPermissionOwner_UserGroupRow(permOwnerUserGroupRow);
+
+            permOwnerUserGroupAdapter.Update(permOwnerUserGroupRow);
           }
         }
 
         //thirdly check for deleted references
-        IEnumerable<dsHiveServer.PermissionOwner_UserGroupRow> userGroupRows = 
-          from permOwner in 
-            permOwnerUserGroupData.AsEnumerable<dsHiveServer.PermissionOwner_UserGroupRow>()
-          where permOwner.UserGroupId == userGroup.PermissionOwnerId  
-          select permOwner;
+        dsHiveServer.PermissionOwner_UserGroupDataTable userGroupRows =
+            permOwnerUserGroupAdapter.GetDataByUserGroupId(userGroup.Id);
 
         ICollection<dsHiveServer.PermissionOwner_UserGroupRow> deleted =
@@ -192,5 +183,5 @@
             from p in
               userGroup.Members
-            where p.PermissionOwnerId == permOwnerUserGroupRow.PermissionOwnerId
+            where p.Id == permOwnerUserGroupRow.PermissionOwnerId
             select p;
 
@@ -203,81 +194,62 @@
         }
 
-        foreach (dsHiveServer.PermissionOwner_UserGroupRow permOwnerUserGroupRow in
-          deleted) {
-          permOwnerUserGroupData.RemovePermissionOwner_UserGroupRow(
-            permOwnerUserGroupRow);
-        }
-
+        foreach (dsHiveServer.PermissionOwner_UserGroupRow 
+          permOwnerUserGroupRow in deleted) {
+          permOwnerUserGroupRow.Delete();
+          permOwnerUserGroupAdapter.Update(permOwnerUserGroupRow);
+        }
       }
 
       return row;
     }
+
+    protected override dsHiveServer.UserGroupRow
+      InsertNewRow(UserGroup group) {
+      dsHiveServer.UserGroupRow row =
+        data.NewUserGroupRow();
+
+      row.PermissionOwnerId = group.Id;
+
+      data.AddUserGroupRow(row);
+      adapter.Update(row);
+
+      return row;
+    }
+
+    protected override void
+     UpdateRow(dsHiveServer.UserGroupRow row) {
+      adapter.Update(row);
+    }
+
+    protected override IEnumerable<dsHiveServer.UserGroupRow>
+      FindById(long id) {
+      return adapter.GetDataById(id);
+    }
+
+    protected override IEnumerable<dsHiveServer.UserGroupRow>
+      FindAll() {
+      return adapter.GetData();
+    }
+    #endregion
 
     #region IUserGroupAdapter Members
     [MethodImpl(MethodImplOptions.Synchronized)]
-    public void UpdateUserGroup(UserGroup group) {
+    public override void Update(UserGroup group) {
       if (group != null) {
-        PermOwnerAdapter.UpdatePermissionOwner(group);
-
-        dsHiveServer.UserGroupRow row =
-          data.FindByPermissionOwnerId(group.PermissionOwnerId);
-
-        if (row == null) {
-          row = data.NewUserGroupRow();
-          row.PermissionOwnerId = group.PermissionOwnerId;
-          data.AddUserGroupRow(row);
-        }
-
-        Convert(group, row);
-      }
-    }
-
-    public UserGroup GetUserGroupById(long userGroupId) {
-      UserGroup userGroup = new UserGroup();
-
-      dsHiveServer.UserGroupRow row =
-        data.FindByPermissionOwnerId(userGroupId);
-
-      if (row != null) {
-        Convert(row, userGroup);
-
-        return userGroup;
-      } else {
-        return null;
-      }
-    }
-
-    public UserGroup GetUserGroupByName(string name) {
-      UserGroup group = new UserGroup();
-
-      PermissionOwner permOwner =
-        PermOwnerAdapter.GetPermissionOwnerByName(name);
-
-      if (permOwner != null) {
-        dsHiveServer.UserGroupRow row =
-          data.FindByPermissionOwnerId(permOwner.PermissionOwnerId);
-
-        if (row != null) {
-          Convert(row, group);
-
-          return group;
-        }
+        PermOwnerAdapter.Update(group);
+
+        base.Update(group);
+      }
+    }
+
+    public UserGroup GetByName(String name) {
+      if (name != null) {
+        return base.FindSingle(
+          delegate() {
+            return adapter.GetDataByName(name);
+          });
       }
 
       return null;
-    }
-
-    public ICollection<UserGroup> GetAllUserGroups() {
-      ICollection<UserGroup> allUserGroups =
-        new List<UserGroup>();
-
-      foreach (dsHiveServer.UserGroupRow row in data) {
-        UserGroup userGroup = new UserGroup();
-
-        Convert(row, userGroup);
-        allUserGroups.Add(userGroup);
-      }
-
-      return allUserGroups;
     }
 
@@ -287,14 +259,11 @@
       
       if (permOwner != null) {
-        IEnumerable<dsHiveServer.PermissionOwner_UserGroupRow> userGroupRows =
-         from userGroup in
-           permOwnerUserGroupData.AsEnumerable<dsHiveServer.PermissionOwner_UserGroupRow>()
-         where userGroup.PermissionOwnerId == permOwner.PermissionOwnerId
-         select userGroup;
+        dsHiveServer.PermissionOwner_UserGroupDataTable userGroupRows =
+          permOwnerUserGroupAdapter.GetDataByPermissionOwnerId(permOwner.Id);
 
         foreach (dsHiveServer.PermissionOwner_UserGroupRow userGroupRow in
           userGroupRows) {
           UserGroup userGroup = 
-            GetUserGroupById(userGroupRow.UserGroupId);
+            GetById(userGroupRow.UserGroupId);
           userGroups.Add(userGroup);
         }
@@ -305,31 +274,8 @@
 
     [MethodImpl(MethodImplOptions.Synchronized)]
-    public bool DeleteUserGroup(UserGroup group) {
+    public override bool Delete(UserGroup group) {
       if (group != null) {
-        dsHiveServer.UserGroupRow row =
-          data.FindByPermissionOwnerId(group.PermissionOwnerId);
-
-        if (row != null) {
-          ICollection<dsHiveServer.PermissionOwner_UserGroupRow> deleted =
-            new List<dsHiveServer.PermissionOwner_UserGroupRow>();
-          
-          foreach (dsHiveServer.PermissionOwner_UserGroupRow permOwnerUserGroupRow in
-            permOwnerUserGroupData) {
-            if (permOwnerUserGroupRow.UserGroupId == group.PermissionOwnerId || 
-              permOwnerUserGroupRow.PermissionOwnerId == group.PermissionOwnerId) {
-              deleted.Add(permOwnerUserGroupRow);
-            }
-          }
-
-          foreach (dsHiveServer.PermissionOwner_UserGroupRow permOwnerUserGroupRow in
-            deleted) {
-            permOwnerUserGroupData.RemovePermissionOwner_UserGroupRow(
-              permOwnerUserGroupRow);
-          }
-
-          row.Delete();
-          adapter.Update(row);
-          return PermOwnerAdapter.DeletePermissionOwner(group);
-        }
+        return base.Delete(group) && 
+          PermOwnerAdapter.Delete(group);
       }
 
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.Designer.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.Designer.cs	(revision 995)
@@ -4168,5 +4168,5 @@
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         private void InitCommandCollection() {
-            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4];
             this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[0].Connection = this.Connection;
@@ -4175,7 +4175,17 @@
             this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[1].Connection = this.Connection;
-            this._commandCollection[1].CommandText = "SELECT * FROM dbo.Resource WHERE ResourceId = @ID";
+            this._commandCollection[1].CommandText = "SELECT Resource.* FROM \r\n  Resource INNER JOIN Client ON Resource.ResourceId = Cl" +
+                "ient.ResourceId\r\n  WHERE Client.Status <> \'offline\'";
             this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
-            this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ID", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[2].Connection = this.Connection;
+            this._commandCollection[2].CommandText = "SELECT * FROM dbo.Resource WHERE ResourceId = @ID";
+            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ID", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[3].Connection = this.Connection;
+            this._commandCollection[3].CommandText = "SELECT * FROM dbo.Resource WHERE Name = @Name";
+            this._commandCollection[3].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Name", global::System.Data.SqlDbType.VarChar, 18, global::System.Data.ParameterDirection.Input, 0, 0, "Name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
         }
         
@@ -4205,6 +4215,28 @@
         [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
         [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByActive(dsHiveServer.ResourceDataTable dataTable) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.ResourceDataTable GetDataByActive() {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            dsHiveServer.ResourceDataTable dataTable = new dsHiveServer.ResourceDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
         public virtual int FillById(dsHiveServer.ResourceDataTable dataTable, long ID) {
-            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand = this.CommandCollection[2];
             this.Adapter.SelectCommand.Parameters[0].Value = ((long)(ID));
             if ((this.ClearBeforeFill == true)) {
@@ -4219,6 +4251,40 @@
         [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
         public virtual dsHiveServer.ResourceDataTable GetDataById(long ID) {
-            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand = this.CommandCollection[2];
             this.Adapter.SelectCommand.Parameters[0].Value = ((long)(ID));
+            dsHiveServer.ResourceDataTable dataTable = new dsHiveServer.ResourceDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByName(dsHiveServer.ResourceDataTable dataTable, string Name) {
+            this.Adapter.SelectCommand = this.CommandCollection[3];
+            if ((Name == null)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(Name));
+            }
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.ResourceDataTable GetDataByName(string Name) {
+            this.Adapter.SelectCommand = this.CommandCollection[3];
+            if ((Name == null)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(Name));
+            }
             dsHiveServer.ResourceDataTable dataTable = new dsHiveServer.ResourceDataTable();
             this.Adapter.Fill(dataTable);
@@ -4544,5 +4610,5 @@
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         private void InitCommandCollection() {
-            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4];
             this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[0].Connection = this.Connection;
@@ -4552,7 +4618,16 @@
             this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[1].Connection = this.Connection;
-            this._commandCollection[1].CommandText = "SELECT * FROM dbo.Client WHERE GUID = @ID";
+            this._commandCollection[1].CommandText = "SELECT * FROM dbo.Client WHERE Status <> \'offline\'";
             this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
-            this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ID", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "GUID", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[2].Connection = this.Connection;
+            this._commandCollection[2].CommandText = "SELECT * FROM dbo.Client WHERE GUID = @ID";
+            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ID", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "GUID", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[3].Connection = this.Connection;
+            this._commandCollection[3].CommandText = "SELECT * FROM dbo.Client WHERE ResourceId = @Id";
+            this._commandCollection[3].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
         }
         
@@ -4582,6 +4657,28 @@
         [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
         [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByActive(dsHiveServer.ClientDataTable dataTable) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.ClientDataTable GetDataByActive() {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            dsHiveServer.ClientDataTable dataTable = new dsHiveServer.ClientDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
         public virtual int FillById(dsHiveServer.ClientDataTable dataTable, global::System.Nullable<global::System.Guid> ID) {
-            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand = this.CommandCollection[2];
             if ((ID.HasValue == true)) {
                 this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(ID.Value));
@@ -4601,5 +4698,5 @@
         [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
         public virtual dsHiveServer.ClientDataTable GetDataById(global::System.Nullable<global::System.Guid> ID) {
-            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand = this.CommandCollection[2];
             if ((ID.HasValue == true)) {
                 this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(ID.Value));
@@ -4608,4 +4705,28 @@
                 this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
             }
+            dsHiveServer.ClientDataTable dataTable = new dsHiveServer.ClientDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByResourceId(dsHiveServer.ClientDataTable dataTable, long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[3];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.ClientDataTable GetDataByResourceId(long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[3];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
             dsHiveServer.ClientDataTable dataTable = new dsHiveServer.ClientDataTable();
             this.Adapter.Fill(dataTable);
@@ -5454,5 +5575,5 @@
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         private void InitCommandCollection() {
-            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3];
             this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[0].Connection = this.Connection;
@@ -5464,4 +5585,9 @@
             this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
             this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[2].Connection = this.Connection;
+            this._commandCollection[2].CommandText = "SELECT * FROM dbo.PermissionOwner WHERE Name = @Name";
+            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Name", global::System.Data.SqlDbType.VarChar, 18, global::System.Data.ParameterDirection.Input, 0, 0, "Name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
         }
         
@@ -5507,4 +5633,38 @@
             this.Adapter.SelectCommand = this.CommandCollection[1];
             this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
+            dsHiveServer.PermissionOwnerDataTable dataTable = new dsHiveServer.PermissionOwnerDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByName(dsHiveServer.PermissionOwnerDataTable dataTable, string Name) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            if ((Name == null)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(Name));
+            }
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.PermissionOwnerDataTable GetDataByName(string Name) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            if ((Name == null)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(Name));
+            }
             dsHiveServer.PermissionOwnerDataTable dataTable = new dsHiveServer.PermissionOwnerDataTable();
             this.Adapter.Fill(dataTable);
@@ -5784,9 +5944,21 @@
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         private void InitCommandCollection() {
-            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3];
             this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[0].Connection = this.Connection;
             this._commandCollection[0].CommandText = "SELECT PermissionOwnerId FROM dbo.UserGroup";
             this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[1].Connection = this.Connection;
+            this._commandCollection[1].CommandText = "SELECT * FROM dbo.UserGroup WHERE PermissionOwnerId  = @Id";
+            this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[2].Connection = this.Connection;
+            this._commandCollection[2].CommandText = "SELECT     UserGroup.*\r\nFROM         UserGroup INNER JOIN\r\n                   Per" +
+                "missionOwner ON UserGroup.PermissionOwnerId = PermissionOwner.PermissionOwnerId\r" +
+                "\nWHERE     (PermissionOwner.Name = @Name)";
+            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Name", global::System.Data.SqlDbType.VarChar, 18, global::System.Data.ParameterDirection.Input, 0, 0, "Name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
         }
         
@@ -5808,4 +5980,62 @@
         public virtual dsHiveServer.UserGroupDataTable GetData() {
             this.Adapter.SelectCommand = this.CommandCollection[0];
+            dsHiveServer.UserGroupDataTable dataTable = new dsHiveServer.UserGroupDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillById(dsHiveServer.UserGroupDataTable dataTable, long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.UserGroupDataTable GetDataById(long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
+            dsHiveServer.UserGroupDataTable dataTable = new dsHiveServer.UserGroupDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByName(dsHiveServer.UserGroupDataTable dataTable, string Name) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            if ((Name == null)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(Name));
+            }
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.UserGroupDataTable GetDataByName(string Name) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            if ((Name == null)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(Name));
+            }
             dsHiveServer.UserGroupDataTable dataTable = new dsHiveServer.UserGroupDataTable();
             this.Adapter.Fill(dataTable);
@@ -6061,5 +6291,5 @@
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         private void InitCommandCollection() {
-            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4];
             this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[0].Connection = this.Connection;
@@ -6068,7 +6298,19 @@
             this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[1].Connection = this.Connection;
-            this._commandCollection[1].CommandText = "SELECT * FROM dbo.PermissionOwner_UserGroup WHERE UserGroupId = @UserGroupId";
+            this._commandCollection[1].CommandText = "SELECT * FROM dbo.PermissionOwner_UserGroup WHERE PermissionOwnerId = @Id";
             this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
-            this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UserGroupId", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "UserGroupId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[2].Connection = this.Connection;
+            this._commandCollection[2].CommandText = "SELECT * FROM dbo.PermissionOwner_UserGroup WHERE PermissionOwnerId = @Permission" +
+                "OwnerId AND UserGroupId = @UserGroupId";
+            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionOwnerId", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UserGroupId", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "UserGroupId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[3].Connection = this.Connection;
+            this._commandCollection[3].CommandText = "SELECT * FROM dbo.PermissionOwner_UserGroup WHERE UserGroupId = @UserGroupId";
+            this._commandCollection[3].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UserGroupId", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "UserGroupId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
         }
         
@@ -6098,6 +6340,56 @@
         [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
         [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByPermissionOwnerId(dsHiveServer.PermissionOwner_UserGroupDataTable dataTable, long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.PermissionOwner_UserGroupDataTable GetDataByPermissionOwnerId(long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
+            dsHiveServer.PermissionOwner_UserGroupDataTable dataTable = new dsHiveServer.PermissionOwner_UserGroupDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByPermownerUsergroupId(dsHiveServer.PermissionOwner_UserGroupDataTable dataTable, long PermissionOwnerId, long UserGroupId) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(PermissionOwnerId));
+            this.Adapter.SelectCommand.Parameters[1].Value = ((long)(UserGroupId));
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.PermissionOwner_UserGroupDataTable GetDataByPermownerUsergroupId(long PermissionOwnerId, long UserGroupId) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(PermissionOwnerId));
+            this.Adapter.SelectCommand.Parameters[1].Value = ((long)(UserGroupId));
+            dsHiveServer.PermissionOwner_UserGroupDataTable dataTable = new dsHiveServer.PermissionOwner_UserGroupDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
         public virtual int FillByUserGroupId(dsHiveServer.PermissionOwner_UserGroupDataTable dataTable, long UserGroupId) {
-            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand = this.CommandCollection[3];
             this.Adapter.SelectCommand.Parameters[0].Value = ((long)(UserGroupId));
             if ((this.ClearBeforeFill == true)) {
@@ -6112,5 +6404,5 @@
         [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
         public virtual dsHiveServer.PermissionOwner_UserGroupDataTable GetDataByUserGroupId(long UserGroupId) {
-            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand = this.CommandCollection[3];
             this.Adapter.SelectCommand.Parameters[0].Value = ((long)(UserGroupId));
             dsHiveServer.PermissionOwner_UserGroupDataTable dataTable = new dsHiveServer.PermissionOwner_UserGroupDataTable();
@@ -6366,9 +6658,14 @@
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         private void InitCommandCollection() {
-            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
             this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[0].Connection = this.Connection;
             this._commandCollection[0].CommandText = "SELECT ResourceId FROM dbo.ClientGroup";
             this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[1].Connection = this.Connection;
+            this._commandCollection[1].CommandText = "SELECT * FROM dbo.ClientGroup WHERE ResourceId = @Id";
+            this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
         }
         
@@ -6390,4 +6687,28 @@
         public virtual dsHiveServer.ClientGroupDataTable GetData() {
             this.Adapter.SelectCommand = this.CommandCollection[0];
+            dsHiveServer.ClientGroupDataTable dataTable = new dsHiveServer.ClientGroupDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillById(dsHiveServer.ClientGroupDataTable dataTable, long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.ClientGroupDataTable GetDataById(long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
             dsHiveServer.ClientGroupDataTable dataTable = new dsHiveServer.ClientGroupDataTable();
             this.Adapter.Fill(dataTable);
@@ -6664,9 +6985,33 @@
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         private void InitCommandCollection() {
-            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[6];
             this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[0].Connection = this.Connection;
             this._commandCollection[0].CommandText = "SELECT JobId, ParentJobId, Status, PermissionOwnerId, ResourceId FROM dbo.Job";
             this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[1].Connection = this.Connection;
+            this._commandCollection[1].CommandText = "SELECT * FROM dbo.Job WHERE Status <> \'offline\'";
+            this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[2].Connection = this.Connection;
+            this._commandCollection[2].CommandText = "SELECT * FROM dbo.Job WHERE ResourceId = @ResourceId";
+            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResourceId", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[3].Connection = this.Connection;
+            this._commandCollection[3].CommandText = "SELECT * FROM dbo.Job WHERE JobId = @Id";
+            this._commandCollection[3].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "JobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[4].Connection = this.Connection;
+            this._commandCollection[4].CommandText = "SELECT * FROM dbo.Job WHERE ParentJobId = @Id";
+            this._commandCollection[4].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "ParentJobId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[5] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[5].Connection = this.Connection;
+            this._commandCollection[5].CommandText = "SELECT * FROM dbo.Job WHERE PermissionOwnerId = @PermissionOwnerId ";
+            this._commandCollection[5].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionOwnerId", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
         }
         
@@ -6688,4 +7033,152 @@
         public virtual dsHiveServer.JobDataTable GetData() {
             this.Adapter.SelectCommand = this.CommandCollection[0];
+            dsHiveServer.JobDataTable dataTable = new dsHiveServer.JobDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByActive(dsHiveServer.JobDataTable dataTable) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.JobDataTable GetDataByActive() {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            dsHiveServer.JobDataTable dataTable = new dsHiveServer.JobDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByClient(dsHiveServer.JobDataTable dataTable, global::System.Nullable<long> ResourceId) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            if ((ResourceId.HasValue == true)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((long)(ResourceId.Value));
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.JobDataTable GetDataByClient(global::System.Nullable<long> ResourceId) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            if ((ResourceId.HasValue == true)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((long)(ResourceId.Value));
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            dsHiveServer.JobDataTable dataTable = new dsHiveServer.JobDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillById(dsHiveServer.JobDataTable dataTable, long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[3];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.JobDataTable GetDataById(long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[3];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
+            dsHiveServer.JobDataTable dataTable = new dsHiveServer.JobDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillBySubjobs(dsHiveServer.JobDataTable dataTable, global::System.Nullable<long> Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[4];
+            if ((Id.HasValue == true)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id.Value));
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.JobDataTable GetDataBySubjobs(global::System.Nullable<long> Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[4];
+            if ((Id.HasValue == true)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id.Value));
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            dsHiveServer.JobDataTable dataTable = new dsHiveServer.JobDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByUser(dsHiveServer.JobDataTable dataTable, global::System.Nullable<long> PermissionOwnerId) {
+            this.Adapter.SelectCommand = this.CommandCollection[5];
+            if ((PermissionOwnerId.HasValue == true)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((long)(PermissionOwnerId.Value));
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.JobDataTable GetDataByUser(global::System.Nullable<long> PermissionOwnerId) {
+            this.Adapter.SelectCommand = this.CommandCollection[5];
+            if ((PermissionOwnerId.HasValue == true)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((long)(PermissionOwnerId.Value));
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
             dsHiveServer.JobDataTable dataTable = new dsHiveServer.JobDataTable();
             this.Adapter.Fill(dataTable);
@@ -7053,9 +7546,26 @@
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         private void InitCommandCollection() {
-            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4];
             this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[0].Connection = this.Connection;
             this._commandCollection[0].CommandText = "SELECT ClientGroupId, ResourceId FROM dbo.ClientGroup_Resource";
             this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[1].Connection = this.Connection;
+            this._commandCollection[1].CommandText = "SELECT * FROM dbo.ClientGroup_Resource WHERE ClientGroupId = @Id";
+            this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "ClientGroupId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[2].Connection = this.Connection;
+            this._commandCollection[2].CommandText = "SELECT * FROM dbo.ClientGroup_Resource WHERE ClientGroupId = @ClientGroupId AND  " +
+                "ResourceId = @ResourceId";
+            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ClientGroupId", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "ClientGroupId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ResourceId", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[3].Connection = this.Connection;
+            this._commandCollection[3].CommandText = "SELECT * FROM dbo.ClientGroup_Resource WHERE ResourceId = @Id";
+            this._commandCollection[3].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "ResourceId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
         }
         
@@ -7077,4 +7587,78 @@
         public virtual dsHiveServer.ClientGroup_ResourceDataTable GetData() {
             this.Adapter.SelectCommand = this.CommandCollection[0];
+            dsHiveServer.ClientGroup_ResourceDataTable dataTable = new dsHiveServer.ClientGroup_ResourceDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByClientGroupId(dsHiveServer.ClientGroup_ResourceDataTable dataTable, long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.ClientGroup_ResourceDataTable GetDataByClientGroupId(long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
+            dsHiveServer.ClientGroup_ResourceDataTable dataTable = new dsHiveServer.ClientGroup_ResourceDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByClientGroupResourceId(dsHiveServer.ClientGroup_ResourceDataTable dataTable, long ClientGroupId, long ResourceId) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(ClientGroupId));
+            this.Adapter.SelectCommand.Parameters[1].Value = ((long)(ResourceId));
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.ClientGroup_ResourceDataTable GetDataByClientGroupResourceId(long ClientGroupId, long ResourceId) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(ClientGroupId));
+            this.Adapter.SelectCommand.Parameters[1].Value = ((long)(ResourceId));
+            dsHiveServer.ClientGroup_ResourceDataTable dataTable = new dsHiveServer.ClientGroup_ResourceDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByResourceId(dsHiveServer.ClientGroup_ResourceDataTable dataTable, long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[3];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsHiveServer.ClientGroup_ResourceDataTable GetDataByResourceId(long Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[3];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
             dsHiveServer.ClientGroup_ResourceDataTable dataTable = new dsHiveServer.ClientGroup_ResourceDataTable();
             this.Adapter.Fill(dataTable);
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.cs	(revision 995)
@@ -3,4 +3,6 @@
     
     public partial class dsHiveServer {
+      partial class ClientGroup_ResourceDataTable {
+      }
     }
 }
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xsd
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xsd	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xsd	(revision 995)
@@ -56,4 +56,14 @@
             </Mappings>
             <Sources>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.Resource" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByActive" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByActive" GeneratorSourceName="FillByActive" GetMethodModifier="Public" GetMethodName="GetDataByActive" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByActive" UserSourceName="FillByActive">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT Resource.* FROM 
+  Resource INNER JOIN Client ON Resource.ResourceId = Client.ResourceId
+  WHERE Client.Status &lt;&gt; 'offline'</CommandText>
+                    <Parameters />
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
               <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.Resource" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillById" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataById" GeneratorSourceName="FillById" GetMethodModifier="Public" GetMethodName="GetDataById" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataById" UserSourceName="FillById">
                 <SelectCommand>
@@ -62,4 +72,14 @@
                     <Parameters>
                       <Parameter AllowDbNull="false" AutogeneratedName="ID" ColumnName="ResourceId" DataSourceName="HiveServer.dbo.Resource" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@ID" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="ResourceId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.Resource" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByName" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByName" GeneratorSourceName="FillByName" GetMethodModifier="Public" GetMethodName="GetDataByName" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByName" UserSourceName="FillByName">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.Resource WHERE Name = @Name</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="true" AutogeneratedName="Name" ColumnName="Name" DataSourceName="HiveServer.dbo.Resource" DataTypeServer="varchar(18)" DbType="AnsiString" Direction="Input" ParameterName="@Name" Precision="0" ProviderType="VarChar" Scale="0" Size="18" SourceColumn="Name" SourceColumnNullMapping="false" SourceVersion="Current" />
                     </Parameters>
                   </DbCommand>
@@ -159,4 +179,12 @@
             </Mappings>
             <Sources>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.Client" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByActive" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByActive" GeneratorSourceName="FillByActive" GetMethodModifier="Public" GetMethodName="GetDataByActive" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByActive" UserSourceName="FillByActive">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.Client WHERE Status &lt;&gt; 'offline'</CommandText>
+                    <Parameters />
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
               <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.Client" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillById" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataById" GeneratorSourceName="FillById" GetMethodModifier="Public" GetMethodName="GetDataById" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataById" UserSourceName="FillById">
                 <SelectCommand>
@@ -165,4 +193,14 @@
                     <Parameters>
                       <Parameter AllowDbNull="true" AutogeneratedName="ID" ColumnName="GUID" DataSourceName="HiveServer.dbo.Client" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@ID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="GUID" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.Client" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByResourceId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByResourceId" GeneratorSourceName="FillByResourceId" GetMethodModifier="Public" GetMethodName="GetDataByResourceId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByResourceId" UserSourceName="FillByResourceId">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.Client WHERE ResourceId = @Id</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="ResourceId" DataSourceName="HiveServer.dbo.Client" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="ResourceId" SourceColumnNullMapping="false" SourceVersion="Current" />
                     </Parameters>
                   </DbCommand>
@@ -303,4 +341,14 @@
                 </SelectCommand>
               </DbSource>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.PermissionOwner" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByName" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByName" GeneratorSourceName="FillByName" GetMethodModifier="Public" GetMethodName="GetDataByName" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByName" UserSourceName="FillByName">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.PermissionOwner WHERE Name = @Name</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="true" AutogeneratedName="Name" ColumnName="Name" DataSourceName="HiveServer.dbo.PermissionOwner" DataTypeServer="varchar(18)" DbType="AnsiString" Direction="Input" ParameterName="@Name" Precision="0" ProviderType="VarChar" Scale="0" Size="18" SourceColumn="Name" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
             </Sources>
           </TableAdapter>
@@ -346,5 +394,29 @@
               <Mapping SourceColumn="PermissionOwnerId" DataSetColumn="PermissionOwnerId" />
             </Mappings>
-            <Sources />
+            <Sources>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.UserGroup" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillById" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataById" GeneratorSourceName="FillById" GetMethodModifier="Public" GetMethodName="GetDataById" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataById" UserSourceName="FillById">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.UserGroup WHERE PermissionOwnerId  = @Id</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="PermissionOwnerId" DataSourceName="HiveServer.dbo.UserGroup" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.UserGroup" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByName" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByName" GeneratorSourceName="FillByName" GetMethodModifier="Public" GetMethodName="GetDataByName" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByName" UserSourceName="FillByName">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT     UserGroup.*
+FROM         UserGroup INNER JOIN
+                   PermissionOwner ON UserGroup.PermissionOwnerId = PermissionOwner.PermissionOwnerId
+WHERE     (PermissionOwner.Name = @Name)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="true" AutogeneratedName="Name" ColumnName="Name" DataSourceName="HiveServer.dbo.PermissionOwner" DataTypeServer="varchar(18)" DbType="AnsiString" Direction="Input" ParameterName="@Name" Precision="0" ProviderType="VarChar" Scale="0" Size="18" SourceColumn="Name" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+            </Sources>
           </TableAdapter>
           <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="PermissionOwner_UserGroupTableAdapter" GeneratorDataComponentClassName="PermissionOwner_UserGroupTableAdapter" Name="PermissionOwner_UserGroup" UserDataComponentName="PermissionOwner_UserGroupTableAdapter">
@@ -395,4 +467,25 @@
             </Mappings>
             <Sources>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.PermissionOwner_UserGroup" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByPermissionOwnerId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByPermissionOwnerId" GeneratorSourceName="FillByPermissionOwnerId" GetMethodModifier="Public" GetMethodName="GetDataByPermissionOwnerId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByPermissionOwnerId" UserSourceName="FillByPermissionOwnerId">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.PermissionOwner_UserGroup WHERE PermissionOwnerId = @Id</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="PermissionOwnerId" DataSourceName="HiveServer.dbo.PermissionOwner_UserGroup" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.PermissionOwner_UserGroup" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByPermownerUsergroupId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByPermownerUsergroupId" GeneratorSourceName="FillByPermownerUsergroupId" GetMethodModifier="Public" GetMethodName="GetDataByPermownerUsergroupId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByPermownerUsergroupId" UserSourceName="FillByPermownerUsergroupId">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.PermissionOwner_UserGroup WHERE PermissionOwnerId = @PermissionOwnerId AND UserGroupId = @UserGroupId</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="PermissionOwnerId" ColumnName="PermissionOwnerId" DataSourceName="HiveServer.dbo.PermissionOwner_UserGroup" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="UserGroupId" ColumnName="UserGroupId" DataSourceName="HiveServer.dbo.PermissionOwner_UserGroup" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@UserGroupId" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="UserGroupId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
               <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.PermissionOwner_UserGroup" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByUserGroupId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByUserGroupId" GeneratorSourceName="FillByUserGroupId" GetMethodModifier="Public" GetMethodName="GetDataByUserGroupId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByUserGroupId" UserSourceName="FillByUserGroupId">
                 <SelectCommand>
@@ -448,5 +541,16 @@
               <Mapping SourceColumn="ResourceId" DataSetColumn="ResourceId" />
             </Mappings>
-            <Sources />
+            <Sources>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.ClientGroup" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillById" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataById" GeneratorSourceName="FillById" GetMethodModifier="Public" GetMethodName="GetDataById" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataById" UserSourceName="FillById">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.ClientGroup WHERE ResourceId = @Id</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="ResourceId" DataSourceName="HiveServer.dbo.ClientGroup" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="ResourceId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+            </Sources>
           </TableAdapter>
           <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="JobTableAdapter" GeneratorDataComponentClassName="JobTableAdapter" Name="Job" UserDataComponentName="JobTableAdapter">
@@ -518,5 +622,54 @@
               <Mapping SourceColumn="ResourceId" DataSetColumn="ResourceId" />
             </Mappings>
-            <Sources />
+            <Sources>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.Job" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByActive" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByActive" GeneratorSourceName="FillByActive" GetMethodModifier="Public" GetMethodName="GetDataByActive" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByActive" UserSourceName="FillByActive">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.Job WHERE Status &lt;&gt; 'offline'</CommandText>
+                    <Parameters />
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.Job" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByClient" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByClient" GeneratorSourceName="FillByClient" GetMethodModifier="Public" GetMethodName="GetDataByClient" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByClient" UserSourceName="FillByClient">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.Job WHERE ResourceId = @ResourceId</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="true" AutogeneratedName="ResourceId" ColumnName="ResourceId" DataSourceName="HiveServer.dbo.Job" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@ResourceId" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="ResourceId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.Job" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillById" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataById" GeneratorSourceName="FillById" GetMethodModifier="Public" GetMethodName="GetDataById" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataById" UserSourceName="FillById">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.Job WHERE JobId = @Id</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="JobId" DataSourceName="HiveServer.dbo.Job" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="JobId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.Job" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillBySubjobs" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataBySubjobs" GeneratorSourceName="FillBySubjobs" GetMethodModifier="Public" GetMethodName="GetDataBySubjobs" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBySubjobs" UserSourceName="FillBySubjobs">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.Job WHERE ParentJobId = @Id</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="true" AutogeneratedName="Id" ColumnName="ParentJobId" DataSourceName="HiveServer.dbo.Job" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="ParentJobId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.Job" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByUser" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByUser" GeneratorSourceName="FillByUser" GetMethodModifier="Public" GetMethodName="GetDataByUser" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByUser" UserSourceName="FillByUser">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.Job WHERE PermissionOwnerId = @PermissionOwnerId </CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="true" AutogeneratedName="PermissionOwnerId" ColumnName="PermissionOwnerId" DataSourceName="HiveServer.dbo.Job" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+            </Sources>
           </TableAdapter>
           <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ClientGroup_ResourceTableAdapter" GeneratorDataComponentClassName="ClientGroup_ResourceTableAdapter" Name="ClientGroup_Resource" UserDataComponentName="ClientGroup_ResourceTableAdapter">
@@ -566,5 +719,37 @@
               <Mapping SourceColumn="ResourceId" DataSetColumn="ResourceId" />
             </Mappings>
-            <Sources />
+            <Sources>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.ClientGroup_Resource" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByClientGroupId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByClientGroupId" GeneratorSourceName="FillByClientGroupId" GetMethodModifier="Public" GetMethodName="GetDataByClientGroupId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByClientGroupId" UserSourceName="FillByClientGroupId">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.ClientGroup_Resource WHERE ClientGroupId = @Id</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="ClientGroupId" DataSourceName="HiveServer.dbo.ClientGroup_Resource" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="ClientGroupId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.ClientGroup_Resource" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByClientGroupResourceId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByClientGroupResourceId" GeneratorSourceName="FillByClientGroupResourceId" GetMethodModifier="Public" GetMethodName="GetDataByClientGroupResourceId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByClientGroupResourceId" UserSourceName="FillByClientGroupResourceId">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.ClientGroup_Resource WHERE ClientGroupId = @ClientGroupId AND  ResourceId = @ResourceId</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="ClientGroupId" ColumnName="ClientGroupId" DataSourceName="HiveServer.dbo.ClientGroup_Resource" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@ClientGroupId" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="ClientGroupId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="ResourceId" ColumnName="ResourceId" DataSourceName="HiveServer.dbo.ClientGroup_Resource" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@ResourceId" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="ResourceId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.ClientGroup_Resource" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByResourceId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByResourceId" GeneratorSourceName="FillByResourceId" GetMethodModifier="Public" GetMethodName="GetDataByResourceId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByResourceId" UserSourceName="FillByResourceId">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.ClientGroup_Resource WHERE ResourceId = @Id</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="ResourceId" DataSourceName="HiveServer.dbo.ClientGroup_Resource" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="ResourceId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+            </Sources>
           </TableAdapter>
         </Tables>
Index: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xss
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xss	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xss	(revision 995)
@@ -5,15 +5,15 @@
      the code is regenerated.
 </autogenerated>-->
-<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="-99" ViewPortY="80" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
+<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="31" ViewPortY="128" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
   <Shapes>
-    <Shape ID="DesignTable:Resource" ZOrder="18" X="31" Y="-16" Height="122" Width="194" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
-    <Shape ID="DesignTable:Client" ZOrder="17" X="-89" Y="148" Height="224" Width="176" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="160" />
-    <Shape ID="DesignTable:HiveUser" ZOrder="14" X="885" Y="224" Height="139" Width="226" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
-    <Shape ID="DesignTable:PermissionOwner" ZOrder="13" X="572" Y="-7" Height="122" Width="242" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
-    <Shape ID="DesignTable:UserGroup" ZOrder="12" X="566" Y="409" Height="88" Width="202" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="42" />
-    <Shape ID="DesignTable:PermissionOwner_UserGroup" ZOrder="9" X="456" Y="215" Height="122" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
-    <Shape ID="DesignTable:ClientGroup" ZOrder="10" X="78" Y="417" Height="88" Width="176" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="42" />
-    <Shape ID="DesignTable:Job" ZOrder="6" X="-22" Y="543" Height="156" Width="161" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="109" />
-    <Shape ID="DesignTable:ClientGroup_Resource" ZOrder="3" X="173" Y="222" Height="105" Width="269" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
+    <Shape ID="DesignTable:Resource" ZOrder="18" X="31" Y="-16" Height="156" Width="226" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
+    <Shape ID="DesignTable:Client" ZOrder="5" X="-210" Y="176" Height="258" Width="265" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="160" />
+    <Shape ID="DesignTable:HiveUser" ZOrder="15" X="885" Y="224" Height="139" Width="226" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
+    <Shape ID="DesignTable:PermissionOwner" ZOrder="14" X="572" Y="-7" Height="139" Width="242" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
+    <Shape ID="DesignTable:UserGroup" ZOrder="8" X="566" Y="409" Height="123" Width="226" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="42" />
+    <Shape ID="DesignTable:PermissionOwner_UserGroup" ZOrder="6" X="456" Y="215" Height="156" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
+    <Shape ID="DesignTable:ClientGroup" ZOrder="7" X="78" Y="417" Height="106" Width="209" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="42" />
+    <Shape ID="DesignTable:Job" ZOrder="9" X="-22" Y="543" Height="224" Width="281" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="109" />
+    <Shape ID="DesignTable:ClientGroup_Resource" ZOrder="4" X="150" Y="207" Height="156" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
   </Shapes>
   <Connectors>
@@ -21,18 +21,18 @@
       <RoutePoints>
         <Point>
-          <X>59</X>
-          <Y>106</Y>
+          <X>31</X>
+          <Y>140</Y>
         </Point>
         <Point>
-          <X>59</X>
-          <Y>148</Y>
+          <X>31</X>
+          <Y>176</Y>
         </Point>
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:User_is_a_PermissionOwner" ZOrder="7" LineWidth="11">
+    <Connector ID="DesignRelation:User_is_a_PermissionOwner" ZOrder="11" LineWidth="11">
       <RoutePoints>
         <Point>
           <X>797</X>
-          <Y>115</Y>
+          <Y>132</Y>
         </Point>
         <Point>
@@ -46,25 +46,25 @@
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:UserGroup_is_a_PermissionOwner" ZOrder="15" LineWidth="11">
+    <Connector ID="DesignRelation:UserGroup_is_a_PermissionOwner" ZOrder="16" LineWidth="11">
       <RoutePoints>
         <Point>
-          <X>779</X>
-          <Y>115</Y>
+          <X>800</X>
+          <Y>132</Y>
         </Point>
         <Point>
-          <X>779</X>
+          <X>800</X>
           <Y>426</Y>
         </Point>
         <Point>
-          <X>768</X>
+          <X>792</X>
           <Y>426</Y>
         </Point>
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:R_44" ZOrder="8" LineWidth="11">
+    <Connector ID="DesignRelation:R_44" ZOrder="12" LineWidth="11">
       <RoutePoints>
         <Point>
           <X>754</X>
-          <Y>115</Y>
+          <Y>132</Y>
         </Point>
         <Point>
@@ -74,5 +74,5 @@
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:R_57" ZOrder="16" LineWidth="11">
+    <Connector ID="DesignRelation:R_57" ZOrder="17" LineWidth="11">
       <RoutePoints>
         <Point>
@@ -82,13 +82,13 @@
         <Point>
           <X>652</X>
-          <Y>337</Y>
+          <Y>371</Y>
         </Point>
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:ClientGroup_is_a_Resource" ZOrder="11" LineWidth="11">
+    <Connector ID="DesignRelation:ClientGroup_is_a_Resource" ZOrder="13" LineWidth="11">
       <RoutePoints>
         <Point>
           <X>122</X>
-          <Y>106</Y>
+          <Y>140</Y>
         </Point>
         <Point>
@@ -98,17 +98,17 @@
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:R_21" ZOrder="5" LineWidth="11">
+    <Connector ID="DesignRelation:R_21" ZOrder="10" LineWidth="11">
       <RoutePoints>
         <Point>
-          <X>32</X>
-          <Y>372</Y>
+          <X>4</X>
+          <Y>434</Y>
         </Point>
         <Point>
-          <X>32</X>
+          <X>4</X>
           <Y>543</Y>
         </Point>
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:R_35" ZOrder="4" LineWidth="11">
+    <Connector ID="DesignRelation:R_35" ZOrder="1" LineWidth="11">
       <RoutePoints>
         <Point>
@@ -121,38 +121,38 @@
         </Point>
         <Point>
-          <X>139</X>
+          <X>259</X>
           <Y>560</Y>
         </Point>
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:R_52" ZOrder="2" LineWidth="11">
+    <Connector ID="DesignRelation:R_52" ZOrder="3" LineWidth="11">
       <RoutePoints>
         <Point>
-          <X>165</X>
+          <X>142</X>
           <Y>417</Y>
         </Point>
         <Point>
-          <X>165</X>
-          <Y>295</Y>
+          <X>142</X>
+          <Y>280</Y>
         </Point>
         <Point>
-          <X>173</X>
-          <Y>295</Y>
+          <X>150</X>
+          <Y>280</Y>
         </Point>
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:R_59" ZOrder="1" LineWidth="11">
+    <Connector ID="DesignRelation:R_59" ZOrder="2" LineWidth="11">
       <RoutePoints>
         <Point>
-          <X>165</X>
-          <Y>106</Y>
+          <X>142</X>
+          <Y>140</Y>
         </Point>
         <Point>
-          <X>165</X>
-          <Y>239</Y>
+          <X>142</X>
+          <Y>224</Y>
         </Point>
         <Point>
-          <X>173</X>
-          <Y>239</Y>
+          <X>150</X>
+          <Y>224</Y>
         </Point>
       </RoutePoints>
Index: trunk/sources/HeuristicLab.Hive.Server.Console/AddNewForm.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Console/AddNewForm.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Console/AddNewForm.cs	(revision 995)
@@ -69,5 +69,5 @@
               if (cbGroups.SelectedItem.ToString().Equals(ug.Name)) {
                 Response resp = userRoleManager.AddUserToGroup
-                  (ug.PermissionOwnerId, u.PermissionOwnerId);
+                  (ug.Id, u.Id);
               }
             }
@@ -82,5 +82,5 @@
             if (cbGroups.SelectedText.Equals(ugs.Name)) {
               Response resp = userRoleManager.AddUserGroupToGroup
-                (ug.PermissionOwnerId, ugs.PermissionOwnerId);
+                (ug.Id, ugs.Id);
             }
           }
Index: trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs	(revision 995)
@@ -80,5 +80,5 @@
 
       foreach (Job job in jobs.List) {
-        tvJobControl.Nodes.Add(job.JobId.ToString());
+        tvJobControl.Nodes.Add(job.Id.ToString());
       } // Jobs
 
Index: trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs	(revision 995)
@@ -27,7 +27,7 @@
       for (int i = 0; i < 10; i++) {
         Job job = new Job();
-        job.JobId = i;
+        job.Id = i;
         job.State = State.offline;
-        jobAdapter.UpdateJob(job);
+        jobAdapter.Update(job);
       }
 
@@ -40,6 +40,6 @@
       response.Success = true;
 
-      ICollection<ClientInfo> allClients = clientAdapter.GetAllClients();
-      ClientInfo client = clientAdapter.GetClientById(clientInfo.ClientId);
+      ICollection<ClientInfo> allClients = clientAdapter.GetAll();
+      ClientInfo client = clientAdapter.GetById(clientInfo.ClientId);
       if (client != null) {
         if (client.State != State.offline) {
@@ -50,5 +50,5 @@
 
       if (response.Success) {
-        clientAdapter.UpdateClient(clientInfo);
+        clientAdapter.Update(clientInfo);
         response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_LOGIN_SUCCESS;
       }
@@ -63,5 +63,5 @@
       response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_HARDBEAT_RECEIVED;
       response.ActionRequest = new List<MessageContainer>();
-      List<Job> allJobs = new List<Job>(jobAdapter.GetAllJobs());
+      List<Job> allJobs = new List<Job>(jobAdapter.GetAll());
       if (allJobs.Count > 0 && hbData.freeCores > 0) 
         response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.FetchJob));
@@ -75,8 +75,8 @@
       ResponseJob response = new ResponseJob();
       lock (this) {
-        LinkedList<Job> allJobs = new LinkedList<Job>(jobAdapter.GetAllJobs());
+        LinkedList<Job> allJobs = new LinkedList<Job>(jobAdapter.GetAll());
         if (allJobs.Last != null) {
-          response.JobId = allJobs.Last.Value.JobId;
-          jobAdapter.DeleteJob(allJobs.Last.Value);   
+          response.JobId = allJobs.Last.Value.Id;
+          jobAdapter.Delete(allJobs.Last.Value);   
           response.SerializedJob = PersistenceManager.SaveToGZip(new TestJob());
           response.Success = true;
@@ -102,5 +102,5 @@
       Response response = new Response();
       
-      ClientInfo client = clientAdapter.GetClientById(clientId);
+      ClientInfo client = clientAdapter.GetById(clientId);
       if (client == null) {
         response.Success = false;
@@ -109,5 +109,5 @@
       }
       client.State = State.offline;
-      clientAdapter.UpdateClient(client);
+      clientAdapter.Update(client);
 
       response.Success = true;
Index: trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs	(revision 995)
@@ -43,5 +43,5 @@
       clientGroups = new List<ClientGroup>();
 
-      ClientGroup cg = new ClientGroup { ResourceId = 4, Name = "SuperGroup" };
+      ClientGroup cg = new ClientGroup { Id = 4, Name = "SuperGroup" };
       cg.Resources = new List<Resource>();
 
@@ -54,5 +54,5 @@
       ResponseList<ClientInfo> response = new ResponseList<ClientInfo>();
 
-      response.List = new List<ClientInfo>(clientAdapter.GetAllClients());
+      response.List = new List<ClientInfo>(clientAdapter.GetAll());
       response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_GET_ALL_CLIENTS;
       response.Success = true;
@@ -64,5 +64,5 @@
       ResponseList<ClientGroup> response = new ResponseList<ClientGroup>();
 
-      response.List = new List<ClientGroup>(clientGroupAdapter.GetAllClientGroups());
+      response.List = new List<ClientGroup>(clientGroupAdapter.GetAll());
       response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_GET_ALL_CLIENTGROUPS;
       response.Success = true;
@@ -80,10 +80,10 @@
       Response response = new Response();
 
-      if (clientGroup.ResourceId != 0) {
+      if (clientGroup.Id != 0) {
         response.Success = false;
         response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_ID_MUST_NOT_BE_SET;
         return response;
       }
-      clientGroupAdapter.UpdateClientGroup(clientGroup);
+      clientGroupAdapter.Update(clientGroup);
       response.Success = true;
       response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_CLIENTGROUP_ADDED;
@@ -95,5 +95,5 @@
       Response response = new Response();
 
-      if (resource.ResourceId != 0) {
+      if (resource.Id != 0) {
         response.Success = false;
         response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_ID_MUST_NOT_BE_SET;
@@ -101,5 +101,5 @@
       }
 
-      ClientGroup clientGroup = clientGroupAdapter.GetClientGroupById(clientGroupId);
+      ClientGroup clientGroup = clientGroupAdapter.GetById(clientGroupId);
       if (clientGroup == null) {
         response.Success = false;
@@ -118,5 +118,5 @@
       Response response = new Response();
 
-      ClientGroup clientGroup = clientGroupAdapter.GetClientGroupById(clientGroupId);
+      ClientGroup clientGroup = clientGroupAdapter.GetById(clientGroupId);
       if (clientGroup == null) {
         response.Success = false;
@@ -125,5 +125,5 @@
       }
       foreach (Resource resource in clientGroup.Resources) {
-        if (resource.ResourceId == resourceId) {
+        if (resource.Id == resourceId) {
           clientGroup.Resources.Remove(resource);
           response.Success = true;
Index: trunk/sources/HeuristicLab.Hive.Server.Core/DbTestApp.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/DbTestApp.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/DbTestApp.cs	(revision 995)
@@ -43,8 +43,8 @@
       client.Login = DateTime.Now;
       client.ClientId = Guid.NewGuid();
-      clientAdapter.UpdateClient(client);
+      clientAdapter.Update(client);
 
       ClientInfo clientRead =
-        clientAdapter.GetClientById(client.ClientId);
+        clientAdapter.GetById(client.ClientId);
       Debug.Assert(
         clientRead != null &&
@@ -52,7 +52,7 @@
 
       client.CpuSpeedPerCore = 2000;
-      clientAdapter.UpdateClient(client);
+      clientAdapter.Update(client);
       clientRead =
-        clientAdapter.GetClientById(client.ClientId);
+        clientAdapter.GetById(client.ClientId);
       Debug.Assert(
        clientRead != null &&
@@ -60,10 +60,11 @@
        clientRead.CpuSpeedPerCore == 2000);
 
-      ICollection<ClientInfo> clients = clientAdapter.GetAllClients();
+      ICollection<ClientInfo> clients = 
+        clientAdapter.GetAll();
       int count = clients.Count;
 
-      clientAdapter.DeleteClient(client);
-
-      clients = clientAdapter.GetAllClients();
+      clientAdapter.Delete(client);
+
+      clients = clientAdapter.GetAll();
       Debug.Assert(count - 1 == clients.Count);
     }
@@ -74,18 +75,18 @@
 
       User user = new User();
-      user.Name = "Stefan";
-
-      userAdapter.UpdateUser(user);
+      user.Name = "TestDummy";
+
+      userAdapter.Update(user);
 
       User userRead =
-        userAdapter.GetUserById(user.PermissionOwnerId);
+        userAdapter.GetById(user.Id);
       Debug.Assert(
         userRead != null &&
-        user.PermissionOwnerId == userRead.PermissionOwnerId);
+        user.Id == userRead.Id);
 
       user.Password = "passme";
-      userAdapter.UpdateUser(user);
+      userAdapter.Update(user);
       userRead =
-        userAdapter.GetUserByName(user.Name);
+        userAdapter.GetByName(user.Name);
       Debug.Assert(
        userRead != null &&
@@ -93,10 +94,11 @@
        userRead.Password == user.Password);
 
-      ICollection<User> users = userAdapter.GetAllUsers();
+      ICollection<User> users = 
+       userAdapter.GetAll();
       int count = users.Count;
 
-      userAdapter.DeleteUser(user);
-
-      users = userAdapter.GetAllUsers();
+      userAdapter.Delete(user);
+
+      users = userAdapter.GetAll();
       Debug.Assert(count - 1 == users.Count);
     }
@@ -129,35 +131,35 @@
       group.Members.Add(subGroup);
 
-      userGroupAdapter.UpdateUserGroup(group);
+      userGroupAdapter.Update(group);
 
       UserGroup read =
-        userGroupAdapter.GetUserGroupById(group.PermissionOwnerId);
+        userGroupAdapter.GetById(group.Id);
 
       ICollection<UserGroup> userGroups =
-        userGroupAdapter.GetAllUserGroups();
+        userGroupAdapter.GetAll();
 
       IUserAdapter userAdapter =
         ServiceLocator.GetUserAdapter();
 
-      userAdapter.DeleteUser(user3);
+      userAdapter.Delete(user3);
       
       read =
-         userGroupAdapter.GetUserGroupById(group.PermissionOwnerId);
-
-      userGroupAdapter.DeleteUserGroup(subGroup);
-
-      read =
-         userGroupAdapter.GetUserGroupById(group.PermissionOwnerId);
+         userGroupAdapter.GetById(group.Id);
+
+      userGroupAdapter.Delete(subGroup);
+
+      read =
+         userGroupAdapter.GetById(group.Id);
 
       userGroups =
-        userGroupAdapter.GetAllUserGroups();
-
-      userGroupAdapter.DeleteUserGroup(group);
+        userGroupAdapter.GetAll();
+
+      userGroupAdapter.Delete(group);
 
       userGroups =
-        userGroupAdapter.GetAllUserGroups();
-
-      userAdapter.DeleteUser(user);
-      userAdapter.DeleteUser(user2);
+        userGroupAdapter.GetAll();
+
+      userAdapter.Delete(user);
+      userAdapter.Delete(user2);
     }
 
@@ -195,35 +197,35 @@
       group.Resources.Add(subGroup);
 
-      clientGroupAdapter.UpdateClientGroup(group);
+      clientGroupAdapter.Update(group);
 
       ClientGroup read =
-        clientGroupAdapter.GetClientGroupById(group.ResourceId);
+        clientGroupAdapter.GetById(group.Id);
 
       ICollection<ClientGroup> clientGroups =
-        clientGroupAdapter.GetAllClientGroups();
+        clientGroupAdapter.GetAll();
 
       IClientAdapter clientAdapter =
         ServiceLocator.GetClientAdapter();
 
-      clientAdapter.DeleteClient(client3);
-
-      read =
-         clientGroupAdapter.GetClientGroupById(group.ResourceId);
-
-      clientGroupAdapter.DeleteClientGroup(subGroup);
-
-      read =
-         clientGroupAdapter.GetClientGroupById(group.ResourceId);
+      clientAdapter.Delete(client3);
+
+      read =
+         clientGroupAdapter.GetById(group.Id);
+
+      clientGroupAdapter.Delete(subGroup);
+
+      read =
+         clientGroupAdapter.GetById(group.Id);
 
       clientGroups =
-        clientGroupAdapter.GetAllClientGroups();
-
-      clientGroupAdapter.DeleteClientGroup(group);
+        clientGroupAdapter.GetAll();
+
+      clientGroupAdapter.Delete(group);
 
       clientGroups =
-        clientGroupAdapter.GetAllClientGroups();
-
-      clientAdapter.DeleteClient(client);
-      clientAdapter.DeleteClient(client2);
+        clientGroupAdapter.GetAll();
+
+      clientAdapter.Delete(client);
+      clientAdapter.Delete(client2);
     }
 
@@ -238,24 +240,31 @@
 
       job.Client = client;
-      jobAdapter.UpdateJob(job);
-
-      ICollection<Job> jobs = jobAdapter.GetAllJobs();
-
-      jobAdapter.DeleteJob(job);
-
-      jobs = jobAdapter.GetAllJobs();
+      jobAdapter.Update(job);
+
+      ICollection<Job> jobs = jobAdapter.GetAll();
+
+      jobAdapter.Delete(job);
+
+      jobs = jobAdapter.GetAll();
     }
 
     public override void Run() {
-      TestClientAdapter();
-      TestUserAdapter();
-      TestUserGroupAdapter();
-      TestClientGroupAdapter();
-      TestJobAdapter();
-
       ITransactionManager transactionManager =
         ServiceLocator.GetTransactionManager();
-
+      
+      TestClientAdapter();
       transactionManager.UpdateDB();
+
+      TestUserAdapter();
+      transactionManager.UpdateDB();
+
+      TestUserGroupAdapter();
+      transactionManager.UpdateDB();
+
+      TestClientGroupAdapter();
+      transactionManager.UpdateDB();  
+
+      TestJobAdapter();
+      transactionManager.UpdateDB();     
     }
   }
Index: trunk/sources/HeuristicLab.Hive.Server.Core/HeuristicLab.Hive.Server.Core.csproj
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/HeuristicLab.Hive.Server.Core.csproj	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/HeuristicLab.Hive.Server.Core.csproj	(revision 995)
@@ -73,4 +73,5 @@
     <Compile Include="InternalInterfaces\DataAccess\IClientAdapter.cs" />
     <Compile Include="InternalInterfaces\DataAccess\IClientGroupAdapter.cs" />
+    <Compile Include="InternalInterfaces\DataAccess\IDataAdapter.cs" />
     <Compile Include="InternalInterfaces\DataAccess\IJobAdapter.cs" />
     <Compile Include="InternalInterfaces\DataAccess\IPermissionOwnerAdapter.cs" />
Index: trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IClientAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IClientAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IClientAdapter.cs	(revision 995)
@@ -30,18 +30,5 @@
   /// The client database adapter
   /// </summary>
-  public interface IClientAdapter {
-    /// <summary>
-    /// Save or update the client
-    /// </summary>
-    /// <param name="client"></param>
-    void UpdateClient(ClientInfo client);
-
-    /// <summary>
-    /// Get the client with the specified ID
-    /// </summary>
-    /// <param name="clientId"></param>
-    /// <returns></returns>
-    ClientInfo GetClientById(Guid clientId);
-
+  public interface IClientAdapter : IDataAdapter<ClientInfo> {
     /// <summary>
     /// Get the client with the specified name
@@ -49,24 +36,12 @@
     /// <param name="clientId"></param>
     /// <returns></returns>
-    ClientInfo GetClientByName(string name);
+    ClientInfo GetByName(string name);
 
     /// <summary>
-    /// Get the client with the specified ID
+    /// Get the client with the specified id
     /// </summary>
     /// <param name="clientId"></param>
     /// <returns></returns>
-    ClientInfo GetClientById(long id);
-
-    /// <summary>
-    /// Get all clients
-    /// </summary>
-    /// <returns></returns>
-    ICollection<ClientInfo> GetAllClients();
-
-    /// <summary>
-    /// Deletes the client
-    /// </summary>
-    /// <param name="client"></param>
-    bool DeleteClient(ClientInfo client);
+    ClientInfo GetById(Guid id);
   }
 }
Index: trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IClientGroupAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IClientGroupAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IClientGroupAdapter.cs	(revision 995)
@@ -30,18 +30,5 @@
   /// The client group database adapter
   /// </summary>
-  public interface IClientGroupAdapter {
-    /// <summary>
-    /// Save or update the client group
-    /// </summary>
-    /// <param name="client"></param>
-    void UpdateClientGroup(ClientGroup group);
-
-    /// <summary>
-    /// Get the client group with the specified ID
-    /// </summary>
-    /// <param name="clientId"></param>
-    /// <returns></returns>
-    ClientGroup GetClientGroupById(long clientGroupId);
-
+  public interface IClientGroupAdapter: IDataAdapter<ClientGroup> {
     /// <summary>
     /// Get the client group with the specified name
@@ -49,11 +36,5 @@
     /// <param name="clientId"></param>
     /// <returns></returns>
-    ClientGroup GetClientGroupByName(string name);
-
-    /// <summary>
-    /// Get all client groups
-    /// </summary>
-    /// <returns></returns>
-    ICollection<ClientGroup> GetAllClientGroups();
+    ClientGroup GetByName(string name);
 
     /// <summary>
@@ -63,10 +44,4 @@
     /// <returns></returns>
     ICollection<ClientGroup> MemberOf(Resource resource);
-
-    /// <summary>
-    /// Deletes the client group
-    /// </summary>
-    /// <param name="client"></param>
-    bool DeleteClientGroup(ClientGroup group);
   }
 }
Index: trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IDataAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IDataAdapter.cs	(revision 995)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IDataAdapter.cs	(revision 995)
@@ -0,0 +1,54 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess {
+  public interface IDataAdapter<ObjT> {
+    /// <summary>
+    /// Save or update the object
+    /// </summary>
+    /// <param name="user"></param>
+    void Update(ObjT ob);
+
+    /// <summary>
+    /// Get the object with the specified ID
+    /// </summary>
+    /// <param name="userId"></param>
+    /// <returns></returns>
+    ObjT GetById(long id);
+
+    /// <summary>
+    /// Get all objects
+    /// </summary>
+    /// <returns></returns>
+    ICollection<ObjT> GetAll();
+
+    /// <summary>
+    /// Deletes the object
+    /// </summary>
+    /// <param name="user"></param>
+    bool Delete(ObjT obj);
+  }
+}
Index: trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IJobAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IJobAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IJobAdapter.cs	(revision 995)
@@ -27,24 +27,5 @@
 
 namespace HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess {
-  public interface IJobAdapter {
-    /// <summary>
-    /// Save or update the job
-    /// </summary>
-    /// <param name="client"></param>
-    void UpdateJob(Job job);
-
-    /// <summary>
-    /// Get the job with the specified ID
-    /// </summary>
-    /// <param name="clientId"></param>
-    /// <returns></returns>
-    Job GetJobById(long id);
-
-    /// <summary>
-    /// Get all jobs
-    /// </summary>
-    /// <returns></returns>
-    ICollection<Job> GetAllJobs();
-
+  public interface IJobAdapter: IDataAdapter<Job> {
     /// <summary>
     /// Gets all subjobs of the specified job
@@ -73,10 +54,4 @@
     /// <returns></returns>
     ICollection<Job> GetJobsOf(User user);
-
-    /// <summary>
-    /// Deletes the job
-    /// </summary>
-    /// <param name="client"></param>
-    bool DeleteJob(Job job);
   }
 }
Index: trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IPermissionOwnerAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IPermissionOwnerAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IPermissionOwnerAdapter.cs	(revision 995)
@@ -30,11 +30,5 @@
   /// The permission owner database adapter
   /// </summary>
-  public interface IPermissionOwnerAdapter {
-    /// <summary>
-    /// Save or update the permission owner
-    /// </summary>
-    /// <param name="client"></param>
-    void UpdatePermissionOwner(PermissionOwner permOwner);
-
+  public interface IPermissionOwnerAdapter: IDataAdapter<PermissionOwner> {
     /// <summary>
     /// Gets the permission owner and updates the values of the object
@@ -42,12 +36,5 @@
     /// <param name="resource"></param>
     /// <returns></returns>
-    bool GetPermissionOwnerById(PermissionOwner permOwner);
-
-    /// <summary>
-    /// Get the permission owner with the specified ID
-    /// </summary>
-    /// <param name="clientId"></param>
-    /// <returns></returns>
-    PermissionOwner GetPermissionOwnerById(long permOwnerId);
+    bool GetById(PermissionOwner permOwner);
 
     /// <summary>
@@ -56,17 +43,5 @@
     /// <param name="clientId"></param>
     /// <returns></returns>
-    PermissionOwner GetPermissionOwnerByName(String name);
-
-    /// <summary>
-    /// Get all permission owners
-    /// </summary>
-    /// <returns></returns>
-    ICollection<PermissionOwner> GetAllPermissionOwners();
-
-    /// <summary>
-    /// Deletes the permission owner
-    /// </summary>
-    /// <param name="permOwner"></param>
-    bool DeletePermissionOwner(PermissionOwner permOwner);
+    PermissionOwner GetByName(String name);
   }
 }
Index: trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IResourceAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IResourceAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IResourceAdapter.cs	(revision 995)
@@ -30,17 +30,11 @@
   /// The resource database adapter
   /// </summary>
-  public interface IResourceAdapter {
+  public interface IResourceAdapter: IDataAdapter<Resource> {
     /// <summary>
-    /// Save or update the resource
+    /// Gets the resource and updates the values of the object
     /// </summary>
-    /// <param name="client"></param>
-    void UpdateResource(Resource resource);
-
-    /// <summary>
-    /// Get the resource with the specified ID
-    /// </summary>
-    /// <param name="clientId"></param>
+    /// <param name="resource"></param>
     /// <returns></returns>
-    Resource GetResourceById(long resourceId);
+    bool GetById(Resource resource);
 
     /// <summary>
@@ -49,24 +43,5 @@
     /// <param name="clientId"></param>
     /// <returns></returns>
-    Resource GetResourceByName(string name);
-
-    /// <summary>
-    /// Gets the resource and updates the values of the object
-    /// </summary>
-    /// <param name="resource"></param>
-    /// <returns></returns>
-    bool GetResourceById(Resource resource);
-
-    /// <summary>
-    /// Get all resuorces
-    /// </summary>
-    /// <returns></returns>
-    ICollection<Resource> GetAllResources();
-
-    /// <summary>
-    /// Deletes the resource
-    /// </summary>
-    /// <param name="client"></param>
-    bool DeleteResource(Resource resource);
+    Resource GetByName(string name);
   }
 }
Index: trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IUserAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IUserAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IUserAdapter.cs	(revision 995)
@@ -30,18 +30,5 @@
   /// The user database adapter
   /// </summary>
-  public interface IUserAdapter {
-    /// <summary>
-    /// Save or update the user
-    /// </summary>
-    /// <param name="user"></param>
-    void UpdateUser(User user);
-
-    /// <summary>
-    /// Get the user with the specified ID
-    /// </summary>
-    /// <param name="userId"></param>
-    /// <returns></returns>
-    User GetUserById(long userId);
-
+  public interface IUserAdapter: IDataAdapter<User> {
     /// <summary>
     /// Get the user with the specified name
@@ -49,17 +36,5 @@
     /// <param name="userId"></param>
     /// <returns></returns>
-    User GetUserByName(string name);
-
-    /// <summary>
-    /// Get all users
-    /// </summary>
-    /// <returns></returns>
-    ICollection<User> GetAllUsers();
-
-    /// <summary>
-    /// Deletes the user
-    /// </summary>
-    /// <param name="user"></param>
-    bool DeleteUser(User user);
+    User GetByName(string name);
   }
 }
Index: trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IUserGroupAdapter.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IUserGroupAdapter.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IUserGroupAdapter.cs	(revision 995)
@@ -30,18 +30,5 @@
   /// The user group database adapter
   /// </summary>
-  public interface IUserGroupAdapter {
-    /// <summary>
-    /// Save or update the user group
-    /// </summary>
-    /// <param name="client"></param>
-    void UpdateUserGroup(UserGroup group);
-
-    /// <summary>
-    /// Get the user group with the specified ID
-    /// </summary>
-    /// <param name="clientId"></param>
-    /// <returns></returns>
-    UserGroup GetUserGroupById(long userGroupId);
-
+  public interface IUserGroupAdapter: IDataAdapter<UserGroup> {
     /// <summary>
     /// Get the user group with the specified name
@@ -49,11 +36,5 @@
     /// <param name="clientId"></param>
     /// <returns></returns>
-    UserGroup GetUserGroupByName(string name);
-
-    /// <summary>
-    /// Get all user groups
-    /// </summary>
-    /// <returns></returns>
-    ICollection<UserGroup> GetAllUserGroups();
+    UserGroup GetByName(String name);
 
     /// <summary>
@@ -63,10 +44,4 @@
     /// <returns></returns>
     ICollection<UserGroup> MemberOf(PermissionOwner permOwner);
-
-    /// <summary>
-    /// Deletes the user group
-    /// </summary>
-    /// <param name="client"></param>
-    bool DeleteUserGroup(UserGroup group);
   }
 }
Index: trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs	(revision 995)
@@ -43,5 +43,5 @@
       ResponseList<Job> response = new ResponseList<Job>();
 
-      response.List = new List<Job>(jobAdapter.GetAllJobs());
+      response.List = new List<Job>(jobAdapter.GetAll());
       response.Success = true;
       response.StatusMessage = ApplicationConstants.RESPONSE_JOB_ALL_JOBS;
@@ -54,10 +54,10 @@
 
       if (job != null) {
-        if (job.JobId != 0) {
+        if (job.Id != 0) {
           response.Success = false;
           response.StatusMessage = ApplicationConstants.RESPONSE_JOB_ID_MUST_NOT_BE_SET;
           return response;
         }
-        jobAdapter.UpdateJob(job);
+        jobAdapter.Update(job);
         response.Success = true;
         response.Obj = job;
@@ -74,5 +74,5 @@
       Response response = new Response();
 
-      Job job = jobAdapter.GetJobById(jobId);
+      Job job = jobAdapter.GetById(jobId);
       if (job == null) {
         response.Success = false;
@@ -80,5 +80,5 @@
         return response;
       }
-      jobAdapter.DeleteJob(job);
+      jobAdapter.Delete(job);
       response.Success = false;
       response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_REMOVED;
Index: trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs	(revision 994)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs	(revision 995)
@@ -27,5 +27,5 @@
       ResponseList<User> response = new ResponseList<User>();
 
-      List<User> allUsers = new List<User>(userAdapter.GetAllUsers());
+      List<User> allUsers = new List<User>(userAdapter.GetAll());
       response.List = allUsers;
       response.Success = true;
@@ -38,10 +38,10 @@
       ResponseObject<User> response = new ResponseObject<User>();
 
-      if (user.PermissionOwnerId != 0) {
+      if (user.Id != 0) {
         response.Success = false;
         response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_ID_MUST_NOT_BE_SET;
         return response;
       }
-      if (userAdapter.GetUserByName(user.Name) != null) {
+      if (userAdapter.GetByName(user.Name) != null) {
         response.Success = false;
         response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_USERNAME_EXISTS_ALLREADY;
@@ -49,5 +49,5 @@
       }
 
-      userAdapter.UpdateUser(user);
+      userAdapter.Update(user);
       response.Obj = user;
       response.Success = true;
@@ -60,5 +60,5 @@
       ResponseList<UserGroup> response = new ResponseList<UserGroup>();
 
-      response.List = new List<UserGroup>(userGroupAdapter.GetAllUserGroups());
+      response.List = new List<UserGroup>(userGroupAdapter.GetAll());
       response.Success = true;
       response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_GET_ALL_USERGROUPS;
@@ -69,5 +69,5 @@
     public Response RemoveUser(long userId) {
       Response response = new Response();
-      User user = userAdapter.GetUserById(userId);
+      User user = userAdapter.GetById(userId);
       if (user == null) {
         response.Success = false;
@@ -75,5 +75,5 @@
         return response;
       }
-      userAdapter.DeleteUser(user);
+      userAdapter.Delete(user);
       response.Success = true;
       response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_USER_REMOVED;
@@ -85,5 +85,5 @@
       ResponseObject<UserGroup> response = new ResponseObject<UserGroup>();
       
-      if (userGroup.PermissionOwnerId != 0) {
+      if (userGroup.Id != 0) {
         response.Success = false;
         response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_ID_MUST_NOT_BE_SET;
@@ -91,5 +91,5 @@
       }
 
-      userGroupAdapter.UpdateUserGroup(userGroup);
+      userGroupAdapter.Update(userGroup);
       response.Obj = userGroup;
       response.Success = false;
@@ -102,5 +102,5 @@
       Response response = new Response();
 
-      UserGroup userGroupFromDb = userGroupAdapter.GetUserGroupById(groupId);
+      UserGroup userGroupFromDb = userGroupAdapter.GetById(groupId);
       if (userGroupFromDb == null) {
         response.Success = false;
@@ -108,5 +108,5 @@
         return response;
       }
-      userGroupAdapter.DeleteUserGroup(userGroupFromDb);
+      userGroupAdapter.Delete(userGroupFromDb);
       response.Success = false;
       response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_USERGROUP_ADDED;
@@ -118,5 +118,5 @@
       Response response = new Response();
 
-      User user = userAdapter.GetUserById(userId);
+      User user = userAdapter.GetById(userId);
       if (user == null) {
         response.Success = false;
@@ -125,5 +125,5 @@
       }
 
-      UserGroup userGroup = userGroupAdapter.GetUserGroupById(groupId);
+      UserGroup userGroup = userGroupAdapter.GetById(groupId);
       if (userGroup == null) {
         response.Success = false;
@@ -132,5 +132,5 @@
       }
       userGroup.Members.Add(user);
-      userGroupAdapter.UpdateUserGroup(userGroup);
+      userGroupAdapter.Update(userGroup);
 
       response.Success = true;
@@ -143,6 +143,6 @@
       Response response = new Response();
 
-      UserGroup userGroup = userGroupAdapter.GetUserGroupById(groupId);
-      UserGroup userGroupToAdd = userGroupAdapter.GetUserGroupById(groupToAddId);
+      UserGroup userGroup = userGroupAdapter.GetById(groupId);
+      UserGroup userGroupToAdd = userGroupAdapter.GetById(groupToAddId);
 
       if (userGroup == null || userGroupToAdd == null) {
@@ -161,5 +161,5 @@
       Response response = new Response();
 
-      UserGroup userGroup = userGroupAdapter.GetUserGroupById(groupId);
+      UserGroup userGroup = userGroupAdapter.GetById(groupId);
       if (userGroup == null) {
         response.Success = false;
@@ -167,5 +167,5 @@
         return response;
       }
-      User user = userAdapter.GetUserById(permissionOwnerId);
+      User user = userAdapter.GetById(permissionOwnerId);
       if (user == null) {
         response.Success = false;
@@ -174,7 +174,7 @@
       }
       foreach (PermissionOwner permissionOwner in userGroup.Members) {
-        if (permissionOwner.PermissionOwnerId == permissionOwnerId) {
+        if (permissionOwner.Id == permissionOwnerId) {
           userGroup.Members.Remove(permissionOwner);
-          userGroupAdapter.UpdateUserGroup(userGroup);
+          userGroupAdapter.Update(userGroup);
           response.Success = true;
           response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_PERMISSIONOWNER_REMOVED;
