Index: /trunk/sources/HeuristicLab.Hive.Contracts/3.2/BusinessObjects/JobDto.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Contracts/3.2/BusinessObjects/JobDto.cs	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Contracts/3.2/BusinessObjects/JobDto.cs	(revision 3018)
@@ -48,5 +48,5 @@
     public DateTime? DateCalculated { get; set; }
     [DataMember]
-    public int? Priority { get; set; }
+    public int Priority { get; set; }
     [DataMember]
     public int CoresNeeded { get; set; }
Index: /trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngine.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngine.cs	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngine.cs	(revision 3018)
@@ -52,4 +52,5 @@
     public string HiveServerUrl { get; set; }
     public string MultiSubmitCount { get; set; }
+    public string RessourceIds { get; set; }
 
     public HiveEngine() {
@@ -94,4 +95,16 @@
       IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl);
       
+      if(!String.Empty.Equals(RessourceIds)) {
+        String[] ids = RessourceIds.Split(';');
+        foreach (string sid in ids) {        
+          try {
+            System.Guid gid = new Guid(sid);
+            jobObj.JobInfo.AssignedResourceIds.Add(gid);
+          } catch(Exception ex) {
+            
+          }   
+        }
+      }      
+
       int loops = 1;
       
Index: /trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngineEditor.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngineEditor.Designer.cs	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngineEditor.Designer.cs	(revision 3018)
@@ -45,8 +45,10 @@
     /// </summary>
     private void InitializeComponent() {
-      this.urlTextBox = new System.Windows.Forms.TextBox();
       this.urlLabel = new System.Windows.Forms.Label();
       this.snapshotButton = new System.Windows.Forms.Button();
       this.multiSubmitTextbox = new System.Windows.Forms.TextBox();
+      this.urlTextBox = new System.Windows.Forms.TextBox();
+      this.assignedRessourceTextBox = new System.Windows.Forms.TextBox();
+      this.label1 = new System.Windows.Forms.Label();
       this.splitContainer1.Panel1.SuspendLayout();
       this.splitContainer1.Panel2.SuspendLayout();
@@ -85,12 +87,4 @@
       this.scopeView.Size = new System.Drawing.Size(178, 422);
       // 
-      // urlTextBox
-      // 
-      this.urlTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-      this.urlTextBox.Location = new System.Drawing.Point(526, 459);
-      this.urlTextBox.Name = "urlTextBox";
-      this.urlTextBox.Size = new System.Drawing.Size(154, 20);
-      this.urlTextBox.TabIndex = 7;
-      // 
       // urlLabel
       // 
@@ -124,4 +118,29 @@
       this.multiSubmitTextbox.Text = "1";
       // 
+      // urlTextBox
+      // 
+      this.urlTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+      this.urlTextBox.Location = new System.Drawing.Point(526, 459);
+      this.urlTextBox.Name = "urlTextBox";
+      this.urlTextBox.Size = new System.Drawing.Size(154, 20);
+      this.urlTextBox.TabIndex = 7;
+      // 
+      // assignedRessourceTextBox
+      // 
+      this.assignedRessourceTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+      this.assignedRessourceTextBox.Location = new System.Drawing.Point(412, 457);
+      this.assignedRessourceTextBox.Name = "assignedRessourceTextBox";
+      this.assignedRessourceTextBox.Size = new System.Drawing.Size(100, 20);
+      this.assignedRessourceTextBox.TabIndex = 11;
+      // 
+      // label1
+      // 
+      this.label1.AutoSize = true;
+      this.label1.Location = new System.Drawing.Point(409, 444);
+      this.label1.Name = "label1";
+      this.label1.Size = new System.Drawing.Size(85, 13);
+      this.label1.TabIndex = 12;
+      this.label1.Text = "Ressource GIDs";
+      // 
       // HiveEngineEditor
       // 
@@ -132,6 +151,14 @@
       this.Controls.Add(this.urlTextBox);
       this.Controls.Add(this.urlLabel);
+      this.Controls.Add(this.assignedRessourceTextBox);
+      this.Controls.Add(this.label1);
       this.Name = "HiveEngineEditor";
       this.Size = new System.Drawing.Size(827, 480);
+      this.Controls.SetChildIndex(this.label1, 0);
+      this.Controls.SetChildIndex(this.assignedRessourceTextBox, 0);
+      this.Controls.SetChildIndex(this.urlLabel, 0);
+      this.Controls.SetChildIndex(this.urlTextBox, 0);
+      this.Controls.SetChildIndex(this.snapshotButton, 0);
+      this.Controls.SetChildIndex(this.multiSubmitTextbox, 0);
       this.Controls.SetChildIndex(this.executeButton, 0);
       this.Controls.SetChildIndex(this.abortButton, 0);
@@ -140,8 +167,4 @@
       this.Controls.SetChildIndex(this.executionTimeLabel, 0);
       this.Controls.SetChildIndex(this.executionTimeTextBox, 0);
-      this.Controls.SetChildIndex(this.urlLabel, 0);
-      this.Controls.SetChildIndex(this.urlTextBox, 0);
-      this.Controls.SetChildIndex(this.snapshotButton, 0);
-      this.Controls.SetChildIndex(this.multiSubmitTextbox, 0);
       this.splitContainer1.Panel1.ResumeLayout(false);
       this.splitContainer1.Panel2.ResumeLayout(false);
@@ -156,8 +179,10 @@
     #endregion
 
-    private System.Windows.Forms.TextBox urlTextBox;
     private System.Windows.Forms.Label urlLabel;
     private System.Windows.Forms.Button snapshotButton;
     private System.Windows.Forms.TextBox multiSubmitTextbox;
+    private System.Windows.Forms.TextBox urlTextBox;
+    private System.Windows.Forms.TextBox assignedRessourceTextBox;
+    private System.Windows.Forms.Label label1;
   }
 }
Index: /trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngineEditor.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngineEditor.cs	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngineEditor.cs	(revision 3018)
@@ -80,5 +80,5 @@
       urlTextBox.DataBindings.Add("Text", HiveEngine, "HiveServerUrl");
       multiSubmitTextbox.DataBindings.Add("Text", HiveEngine, "MultiSubmitCount");
-      
+      assignedRessourceTextBox.DataBindings.Add("Text", HiveEngine, "RessourceIds");         
     }
 
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs	(revision 3018)
@@ -103,5 +103,5 @@
                               " wasn't offline but hasn't sent heartbeats - setting offline");
               client.State = State.offline;
-              DaoLocator.ClientDao.Update(client);              
+              DaoLocator.ClientDao.Update(client);
               HiveLogger.Info(this.ToString() + ": Client " + client.Id +
                               " wasn't offline but hasn't sent heartbeats - Resetting all his jobs");
@@ -236,28 +236,17 @@
     /// <returns></returns>
     public ResponseHB ProcessHeartBeat(HeartBeatData hbData) {
-      
-     /* ISession session = factory.GetSessionForCurrentThread();
-      ITransaction tx = null;*/
-
-      HiveLogger.Info(this.ToString() + ": BEGIN Processing Heartbeat for Client " + hbData.ClientId);
-
-      //try {
-        HiveLogger.Info(this.ToString() + ": BEGIN Fetching Adapters");
-      /*  IClientAdapter clientAdapter =
-          session.GetDataAdapter<ClientDto, IClientAdapter>();
-
-        IJobAdapter jobAdapter =        
-          session.GetDataAdapter<JobDto, IJobAdapter>(); */
-        HiveLogger.Info(this.ToString() + ": END Fetched Adapters");
-        HiveLogger.Info(this.ToString() + ": BEGIN Starting Transaction");
-        //tx = session.BeginTransaction();
-        HiveLogger.Info(this.ToString() + ": END Started Transaction");
+      HiveLogger.Debug(this.ToString() + ": BEGIN Processing Heartbeat for Client " + hbData.ClientId);
+      HiveLogger.Debug(this.ToString() + ": BEGIN Fetching Adapters");
+      HiveLogger.Debug(this.ToString() + ": END Fetched Adapters");
+      HiveLogger.Debug(this.ToString() + ": BEGIN Starting Transaction");
+
+      HiveLogger.Debug(this.ToString() + ": END Started Transaction");
 
         ResponseHB response = new ResponseHB();
         response.ActionRequest = new List<MessageContainer>();
 
-        HiveLogger.Info(this.ToString() + ": BEGIN Started Client Fetching");
+        HiveLogger.Debug(this.ToString() + ": BEGIN Started Client Fetching");
         ClientDto client = DaoLocator.ClientDao.FindById(hbData.ClientId);
-        HiveLogger.Info(this.ToString() + ": END Finished Client Fetching");
+        HiveLogger.Debug(this.ToString() + ": END Finished Client Fetching");
         // check if the client is logged in
         if (client.State == State.offline || client.State == State.nullState) {
@@ -275,7 +264,7 @@
 
         // save timestamp of this heartbeat
-        HiveLogger.Info(this.ToString() + ": BEGIN Locking for Heartbeats");
+        HiveLogger.Debug(this.ToString() + ": BEGIN Locking for Heartbeats");
         heartbeatLock.EnterWriteLock();
-        HiveLogger.Info(this.ToString() + ": END Locked for Heartbeats");
+        HiveLogger.Debug(this.ToString() + ": END Locked for Heartbeats");
         if (lastHeartbeats.ContainsKey(hbData.ClientId)) {
           lastHeartbeats[hbData.ClientId] = DateTime.Now;
@@ -287,5 +276,5 @@
         // check if client has a free core for a new job
         // if true, ask scheduler for a new job for this client
-        HiveLogger.Info(this.ToString() + ": BEGIN Looking for Client Jobs");
+        HiveLogger.Debug(this.ToString() + ": BEGIN Looking for Client Jobs");
         if (hbData.FreeCores > 0 && scheduler.ExistsJobForClient(hbData)) {
           response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.FetchJob));
@@ -293,28 +282,18 @@
           response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.NoMessage));
         }
-        HiveLogger.Info(this.ToString() + ": END Looked for Client Jobs");
+        HiveLogger.Debug(this.ToString() + ": END Looked for Client Jobs");
         response.Success = true;
         response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_HEARTBEAT_RECEIVED;
 
-        HiveLogger.Info(this.ToString() + ": BEGIN Processing Heartbeat Jobs");
+        HiveLogger.Debug(this.ToString() + ": BEGIN Processing Heartbeat Jobs");
         processJobProcess(hbData, response);
-        HiveLogger.Info(this.ToString() + ": END Processed Heartbeat Jobs");
+        HiveLogger.Debug(this.ToString() + ": END Processed Heartbeat Jobs");
         
         DaoLocator.ClientDao.Update(client);
 
         //tx.Commit();
-        HiveLogger.Info(this.ToString() + ": END Processed Heartbeat for Client " + hbData.ClientId);
+        HiveLogger.Debug(this.ToString() + ": END Processed Heartbeat for Client " + hbData.ClientId);
         return response;
-      } /*
-      catch (Exception ex) {
-        if (tx != null)
-          tx.Rollback();
-        throw ex;
-      }
-      finally {
-        if (session != null)
-          session.EndSession();
-      }   
-    }     */
+      }
 
     /// <summary>
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/DefaultScheduler.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/DefaultScheduler.cs	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/DefaultScheduler.cs	(revision 3018)
@@ -10,6 +10,5 @@
 
 namespace HeuristicLab.Hive.Server.Core {
-  class DefaultScheduler: IScheduler {
-
+  internal class DefaultScheduler : IScheduler {
     //private ISessionFactory factory;
 
@@ -24,62 +23,35 @@
 
     public bool ExistsJobForClient(HeuristicLab.Hive.Contracts.BusinessObjects.HeartBeatData hbData) {
-      //ISession session = factory.GetSessionForCurrentThread();
-
-      //try {
-        /*IJobAdapter jobAdapter =
-          session.GetDataAdapter<JobDto, IJobAdapter>();*/
-
-        List<JobDto> allOfflineJobsForClient = new List<JobDto>(DaoLocator.JobDao.FindFittingJobsForClient(State.offline, hbData.FreeCores, hbData.FreeMemory));
-          /*jobAdapter.FindJobs(State.offline, 
-          hbData.FreeCores,
-          hbData.FreeMemory, 
-          hbData.ClientId));*/
-        return (allOfflineJobsForClient != null && allOfflineJobsForClient.Count > 0);
-      //}
-      /*finally {
-        if (session != null)
-          session.EndSession();
-      } */
-    }   
+      List<JobDto> allOfflineJobsForClient =
+        new List<JobDto>(DaoLocator.JobDao.FindFittingJobsForClient(State.offline, hbData.FreeCores, hbData.FreeMemory,
+                                                                    hbData.ClientId));
+      return (allOfflineJobsForClient != null && allOfflineJobsForClient.Count > 0);
+    }
 
     public HeuristicLab.Hive.Contracts.BusinessObjects.JobDto GetNextJobForClient(Guid clientId) {
-      /*ISession session = factory.GetSessionForCurrentThread();
+      /// Critical section ///
+      jobLock.WaitOne();
 
-      try {
-        IJobAdapter jobAdapter =
-          session.GetDataAdapter<JobDto, IJobAdapter>();
-
-        IClientAdapter clientAdapter =
-          session.GetDataAdapter<ClientDto, IClientAdapter>();*/
-
-        /// Critical section ///
-        jobLock.WaitOne();
-
-        ClientDto client = DaoLocator.ClientDao.FindById(clientId);
+      ClientDto client = DaoLocator.ClientDao.FindById(clientId);
       LinkedList<JobDto> allOfflineJobsForClient =
         new LinkedList<JobDto>(DaoLocator.JobDao.FindFittingJobsForClient(State.offline, client.NrOfFreeCores,
-                                                                          client.FreeMemory));
+                                                                          client.FreeMemory, client.Id));
 
-        JobDto jobToCalculate = null;
-        if (allOfflineJobsForClient != null && allOfflineJobsForClient.Count > 0) {
-          jobToCalculate = allOfflineJobsForClient.First.Value;
-          jobToCalculate.State = State.calculating;
-          jobToCalculate.Client = client;
-          jobToCalculate.Client.State = State.calculating;          
-          jobToCalculate.DateCalculated = DateTime.Now;
-          DaoLocator.JobDao.AssignClientToJob(client.Id, jobToCalculate.Id);
-          DaoLocator.JobDao.Update(jobToCalculate);
-          DaoLocator.ClientDao.Update(jobToCalculate.Client);
-        }
-        jobLock.ReleaseMutex();
-        /// End Critical section ///
+      JobDto jobToCalculate = null;
+      if (allOfflineJobsForClient != null && allOfflineJobsForClient.Count > 0) {
+        jobToCalculate = allOfflineJobsForClient.First.Value;
+        jobToCalculate.State = State.calculating;
+        jobToCalculate.Client = client;
+        jobToCalculate.Client.State = State.calculating;
+        jobToCalculate.DateCalculated = DateTime.Now;
+        DaoLocator.JobDao.AssignClientToJob(client.Id, jobToCalculate.Id);
+        DaoLocator.JobDao.Update(jobToCalculate);
+        DaoLocator.ClientDao.Update(jobToCalculate.Client);
+      }
+      jobLock.ReleaseMutex();
+      /// End Critical section ///
 
-        return jobToCalculate;
-      }
-      /*finally {
-        if (session != null)
-          session.EndSession();
-      } 
-    }   */
+      return jobToCalculate;
+    }
 
     #endregion
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/JobManager.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/JobManager.cs	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/JobManager.cs	(revision 3018)
@@ -184,5 +184,5 @@
           DaoLocator.JobDao.InsertWithAttachedJob(job);
           DaoLocator.PluginInfoDao.InsertPluginDependenciesForJob(job.JobInfo);
-          //jobAdapter.UpdateSerializedJob(job);
+          
           response.Success = true;
           response.Obj = job.JobInfo;
Index: /trunk/sources/HeuristicLab.Hive.Server.DataAccess/3.2/IClientGroupDao.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.DataAccess/3.2/IClientGroupDao.cs	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Server.DataAccess/3.2/IClientGroupDao.cs	(revision 3018)
@@ -12,4 +12,5 @@
 
     IEnumerable<ClientGroupDto> FindAllWithSubGroupsAndClients();
+    IEnumerable<Guid> FindAllGroupAndParentGroupIdsForClient(Guid clientId);
   }
 }
Index: /trunk/sources/HeuristicLab.Hive.Server.DataAccess/3.2/IJobDao.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.DataAccess/3.2/IJobDao.cs	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Server.DataAccess/3.2/IJobDao.cs	(revision 3018)
@@ -19,5 +19,5 @@
     byte[] GetBinaryJobFile(Guid jobId); 
 
-    IEnumerable<JobDto> FindFittingJobsForClient(State state, int freeCores, int freeMemory);
+    IEnumerable<JobDto> FindFittingJobsForClient(State state, int freeCores, int freeMemory, Guid clientGuid);
     Stream GetSerializedJobStream(Guid jobId);
   }
Index: /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ClientGroupDao.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ClientGroupDao.cs	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ClientGroupDao.cs	(revision 3018)
@@ -109,6 +109,19 @@
       foreach (Client client in qClients) {
         parentClientGroup.Resources.Add(cd.EntityToDto(client, null));                        
+      }     
+    }
+
+    public IEnumerable<Guid> FindAllGroupAndParentGroupIdsForClient(Guid clientId) {
+      List<Guid> guids = new List<Guid>();
+      Client c = Context.Clients.SingleOrDefault(client => client.ResourceId.Equals(clientId));
+      FindAllGroupAndParentGroupIdsForClientRecursive(c.Resource, guids);
+      return guids;
+    }
+
+    private void FindAllGroupAndParentGroupIdsForClientRecursive(Resource resource, List<Guid> guids) {
+      foreach (ClientGroup_Resource cgr in resource.ClientGroup_Resources) {
+        guids.Add(cgr.ClientGroupId);
+        FindAllGroupAndParentGroupIdsForClientRecursive(cgr.ClientGroup.Resource, guids);        
       }
-     
     }
 
Index: /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml	(revision 3018)
@@ -7,6 +7,6 @@
       <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
       <Column Name="AssignedRessourcesId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+      <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" />
       <Association Name="Job_AssignedResource" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" />
-      <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" />
     </Type>
   </Table>
@@ -44,28 +44,4 @@
     </Type>
   </Table>
-  <Table Name="dbo.Job" Member="Jobs">
-    <Type Name="Job">
-      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
-      <Column Name="ParentJobId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
-      <Column Name="JobState" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
-      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
-      <Column Name="Percentage" Type="System.Double" DbType="Float" CanBeNull="true" />
-      <Column Name="SerializedJob" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX)" CanBeNull="true" UpdateCheck="Never" IsDelayLoaded="true" />
-      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
-      <Column Name="DateCalculated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
-      <Column Name="DateFinished" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
-      <Column Name="Priority" Type="System.Int32" DbType="Int" CanBeNull="true" />
-      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
-      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
-      <Column Name="CoresNeeded" Type="System.Int32" DbType="Int" CanBeNull="false" />
-      <Column Name="MemoryNeeded" Type="System.Int32" DbType="Int" CanBeNull="false" />
-      <Association Name="Job_AssignedResource" Member="AssignedResources" ThisKey="JobId" OtherKey="JobId" Type="AssignedResource" />
-      <Association Name="Job_Job" Member="Jobs" ThisKey="JobId" OtherKey="ParentJobId" Type="Job" />
-      <Association Name="Job_RequiredPlugin" Member="RequiredPlugins" ThisKey="JobId" OtherKey="JobId" Type="RequiredPlugin" />
-      <Association Name="Job_Job" Member="Job1" ThisKey="ParentJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
-      <Association Name="Project_Job" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" DeleteRule="SET NULL" />
-      <Association Name="Client_Job" Member="Client" ThisKey="ResourceId" OtherKey="ResourceId" Type="Client" IsForeignKey="true" DeleteRule="SET NULL" />
-    </Type>
-  </Table>
   <Table Name="dbo.PluginInfo" Member="PluginInfos">
     <Type Name="PluginInfo">
@@ -89,6 +65,6 @@
       <Column Name="PluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
       <Column Name="RequiredPluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" UpdateCheck="Never" />
+      <Association Name="PluginInfo_RequiredPlugin" Member="PluginInfo" ThisKey="PluginId" OtherKey="PluginId" Type="PluginInfo" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" />
       <Association Name="Job_RequiredPlugin" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
-      <Association Name="PluginInfo_RequiredPlugin" Member="PluginInfo" ThisKey="PluginId" OtherKey="PluginId" Type="PluginInfo" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" />
     </Type>
   </Table>
@@ -120,3 +96,27 @@
     </Type>
   </Table>
+  <Table Name="dbo.Job" Member="Jobs">
+    <Type Name="Job">
+      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+      <Column Name="ParentJobId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
+      <Column Name="JobState" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
+      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
+      <Column Name="Percentage" Type="System.Double" DbType="Float" CanBeNull="true" />
+      <Column Name="SerializedJob" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX)" CanBeNull="true" UpdateCheck="Never" />
+      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
+      <Column Name="DateCalculated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
+      <Column Name="DateFinished" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
+      <Column Name="Priority" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
+      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
+      <Column Name="CoresNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Column Name="MemoryNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Association Name="Job_AssignedResource" Member="AssignedResources" ThisKey="JobId" OtherKey="JobId" Type="AssignedResource" />
+      <Association Name="Job_RequiredPlugin" Member="RequiredPlugins" ThisKey="JobId" OtherKey="JobId" Type="RequiredPlugin" />
+      <Association Name="Job_Job" Member="Jobs" ThisKey="JobId" OtherKey="ParentJobId" Type="Job" />
+      <Association Name="Client_Job" Member="Client" ThisKey="ResourceId" OtherKey="ResourceId" Type="Client" IsForeignKey="true" DeleteRule="SET NULL" />
+      <Association Name="Job_Job" Member="Job1" ThisKey="ParentJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
+      <Association Name="Project_Job" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" DeleteRule="SET NULL" />
+    </Type>
+  </Table>
 </Database>
Index: /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml.layout
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml.layout	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml.layout	(revision 3018)
@@ -33,10 +33,4 @@
       </nestedChildShapes>
     </classShape>
-    <classShape Id="63840838-dba2-4615-b10b-b812f68ec9a1" absoluteBounds="9, 6.25, 2, 3.5016097005208318">
-      <DataClassMoniker Name="/HiveDataContext/Job" />
-      <nestedChildShapes>
-        <elementListCompartment Id="3758a5b7-d1ea-4673-b0e6-db5da665526e" absoluteBounds="9.015, 6.7100000000000009, 1.9700000000000002, 2.941609700520833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
     <classShape Id="a054f27a-f931-4019-b8a0-500bbd926986" absoluteBounds="12, 6.375, 2, 1.5785953776041666">
       <DataClassMoniker Name="/HiveDataContext/PluginInfo" />
@@ -68,32 +62,4 @@
         <classShapeMoniker Id="fdda4acc-8a1b-47c8-95ae-5e366f019c84" />
         <classShapeMoniker Id="0535d2ec-d743-4b65-a1d6-70f7af1eead3" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(10 : 6.25); (10 : 4.34375); (5.5 : 4.34375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" />
-      <nodes>
-        <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />
-        <classShapeMoniker Id="3bbfffd4-3ad8-4ff9-b0ff-bdddca70b322" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(9.70923076923077 : 9.75160970052083); (9.70923076923077 : 10.0016097005208); (10.3046153846154 : 10.0016097005208); (10.3046153846154 : 9.75160970052083)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Job/Job_Job" />
-      <nodes>
-        <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />
-        <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(8.25 : 11.0969962565104); (9.32336288461538 : 11.0969962565104); (9.32336288461538 : 9.75160970052083)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" />
-      <nodes>
-        <classShapeMoniker Id="401c6a1e-69dc-43e4-a4c6-bfc7c2130170" />
-        <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(11 : 9.25080485026042); (12 : 9.25080485026042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" />
-      <nodes>
-        <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />
-        <classShapeMoniker Id="59a84aec-bc57-49b5-a709-71cdf7612b31" />
       </nodes>
     </associationConnector>
@@ -139,11 +105,4 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(5.625 : 8.78770182291667); (9 : 8.78770182291667)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Client/Client_Job" />
-      <nodes>
-        <classShapeMoniker Id="a2f0b500-6e5f-4de0-b608-64e4b55a73c4" />
-        <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />
-      </nodes>
-    </associationConnector>
     <associationConnector edgePoints="[(4.5 : 6.94399251302083); (4.5 : 7.625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_Client" />
@@ -160,4 +119,45 @@
       </nodes>
     </associationConnector>
+    <classShape Id="9af04358-a545-4e37-bb13-d249fecfa769" absoluteBounds="9, 6.5, 2, 3.5016097005208326">
+      <DataClassMoniker Name="/HiveDataContext/Job" />
+      <nestedChildShapes>
+        <elementListCompartment Id="b55e771e-4639-44c8-9d16-727b309f657d" absoluteBounds="9.015, 6.96, 1.9700000000000002, 2.941609700520833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <associationConnector edgePoints="[(10 : 6.5); (10 : 4.34375); (5.5 : 4.34375)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" />
+      <nodes>
+        <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" />
+        <classShapeMoniker Id="3bbfffd4-3ad8-4ff9-b0ff-bdddca70b322" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(11 : 9.37580485026042); (12 : 9.37580485026042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" />
+      <nodes>
+        <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" />
+        <classShapeMoniker Id="59a84aec-bc57-49b5-a709-71cdf7612b31" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(5.625 : 8.91270182291667); (9 : 8.91270182291667)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <AssociationMoniker Name="/HiveDataContext/Client/Client_Job" />
+      <nodes>
+        <classShapeMoniker Id="a2f0b500-6e5f-4de0-b608-64e4b55a73c4" />
+        <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(9.70923076923077 : 10.0016097005208); (9.70923076923077 : 10.2516097005208); (10.3046153846154 : 10.2516097005208); (10.3046153846154 : 10.0016097005208)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Job/Job_Job" />
+      <nodes>
+        <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" />
+        <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(8.25 : 11.0969962565104); (9.32336288461538 : 11.0969962565104); (9.32336288461538 : 10.0016097005208)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" />
+      <nodes>
+        <classShapeMoniker Id="401c6a1e-69dc-43e4-a4c6-bfc7c2130170" />
+        <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" />
+      </nodes>
+    </associationConnector>
   </nestedChildShapes>
 </ordesignerObjectsDiagram>
Index: /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.designer.cs	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.designer.cs	(revision 3018)
@@ -46,7 +46,4 @@
     partial void UpdateClientGroup_Resource(ClientGroup_Resource instance);
     partial void DeleteClientGroup_Resource(ClientGroup_Resource instance);
-    partial void InsertJob(Job instance);
-    partial void UpdateJob(Job instance);
-    partial void DeleteJob(Job instance);
     partial void InsertPluginInfo(PluginInfo instance);
     partial void UpdatePluginInfo(PluginInfo instance);
@@ -64,4 +61,7 @@
     partial void UpdateClient(Client instance);
     partial void DeleteClient(Client instance);
+    partial void InsertJob(Job instance);
+    partial void UpdateJob(Job instance);
+    partial void DeleteJob(Job instance);
     #endregion
 		
@@ -136,4 +136,44 @@
 		}
 		
+		public System.Data.Linq.Table<PluginInfo> PluginInfos
+		{
+			get
+			{
+				return this.GetTable<PluginInfo>();
+			}
+		}
+		
+		public System.Data.Linq.Table<Project> Projects
+		{
+			get
+			{
+				return this.GetTable<Project>();
+			}
+		}
+		
+		public System.Data.Linq.Table<RequiredPlugin> RequiredPlugins
+		{
+			get
+			{
+				return this.GetTable<RequiredPlugin>();
+			}
+		}
+		
+		public System.Data.Linq.Table<Resource> Resources
+		{
+			get
+			{
+				return this.GetTable<Resource>();
+			}
+		}
+		
+		public System.Data.Linq.Table<Client> Clients
+		{
+			get
+			{
+				return this.GetTable<Client>();
+			}
+		}
+		
 		public System.Data.Linq.Table<Job> Jobs
 		{
@@ -141,44 +181,4 @@
 			{
 				return this.GetTable<Job>();
-			}
-		}
-		
-		public System.Data.Linq.Table<PluginInfo> PluginInfos
-		{
-			get
-			{
-				return this.GetTable<PluginInfo>();
-			}
-		}
-		
-		public System.Data.Linq.Table<Project> Projects
-		{
-			get
-			{
-				return this.GetTable<Project>();
-			}
-		}
-		
-		public System.Data.Linq.Table<RequiredPlugin> RequiredPlugins
-		{
-			get
-			{
-				return this.GetTable<RequiredPlugin>();
-			}
-		}
-		
-		public System.Data.Linq.Table<Resource> Resources
-		{
-			get
-			{
-				return this.GetTable<Resource>();
-			}
-		}
-		
-		public System.Data.Linq.Table<Client> Clients
-		{
-			get
-			{
-				return this.GetTable<Client>();
 			}
 		}
@@ -197,7 +197,7 @@
 		private System.Guid _AssignedRessourcesId;
 		
+		private EntityRef<Resource> _Resource;
+		
 		private EntityRef<Job> _Job;
-		
-		private EntityRef<Resource> _Resource;
 		
     #region Extensibility Method Definitions
@@ -215,6 +215,6 @@
 		public AssignedResource()
 		{
+			this._Resource = default(EntityRef<Resource>);
 			this._Job = default(EntityRef<Job>);
-			this._Resource = default(EntityRef<Resource>);
 			OnCreated();
 		}
@@ -288,4 +288,38 @@
 		}
 		
+		[Association(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
+		public Resource Resource
+		{
+			get
+			{
+				return this._Resource.Entity;
+			}
+			set
+			{
+				Resource previousValue = this._Resource.Entity;
+				if (((previousValue != value) 
+							|| (this._Resource.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Resource.Entity = null;
+						previousValue.AssignedResources.Remove(this);
+					}
+					this._Resource.Entity = value;
+					if ((value != null))
+					{
+						value.AssignedResources.Add(this);
+						this._ResourceId = value.ResourceId;
+					}
+					else
+					{
+						this._ResourceId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Resource");
+				}
+			}
+		}
+		
 		[Association(Name="Job_AssignedResource", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
 		public Job Job
@@ -318,38 +352,4 @@
 					}
 					this.SendPropertyChanged("Job");
-				}
-			}
-		}
-		
-		[Association(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
-		public Resource Resource
-		{
-			get
-			{
-				return this._Resource.Entity;
-			}
-			set
-			{
-				Resource previousValue = this._Resource.Entity;
-				if (((previousValue != value) 
-							|| (this._Resource.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Resource.Entity = null;
-						previousValue.AssignedResources.Remove(this);
-					}
-					this._Resource.Entity = value;
-					if ((value != null))
-					{
-						value.AssignedResources.Add(this);
-						this._ResourceId = value.ResourceId;
-					}
-					else
-					{
-						this._ResourceId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Resource");
 				}
 			}
@@ -1013,585 +1013,4 @@
 	}
 	
-	[Table(Name="dbo.Job")]
-	public partial class Job : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _JobId;
-		
-		private System.Nullable<System.Guid> _ParentJobId;
-		
-		private string _JobState;
-		
-		private System.Nullable<System.Guid> _ResourceId;
-		
-		private System.Nullable<double> _Percentage;
-		
-		private System.Data.Linq.Link<System.Data.Linq.Binary> _SerializedJob;
-		
-		private System.Nullable<System.DateTime> _DateCreated;
-		
-		private System.Nullable<System.DateTime> _DateCalculated;
-		
-		private System.Nullable<System.DateTime> _DateFinished;
-		
-		private System.Nullable<int> _Priority;
-		
-		private System.Nullable<System.Guid> _ProjectId;
-		
-		private System.Nullable<System.Guid> _UserId;
-		
-		private int _CoresNeeded;
-		
-		private int _MemoryNeeded;
-		
-		private EntitySet<AssignedResource> _AssignedResources;
-		
-		private EntitySet<Job> _Jobs;
-		
-		private EntitySet<RequiredPlugin> _RequiredPlugins;
-		
-		private EntityRef<Job> _Job1;
-		
-		private EntityRef<Project> _Project;
-		
-		private EntityRef<Client> _Client;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnJobIdChanging(System.Guid value);
-    partial void OnJobIdChanged();
-    partial void OnParentJobIdChanging(System.Nullable<System.Guid> value);
-    partial void OnParentJobIdChanged();
-    partial void OnJobStateChanging(string value);
-    partial void OnJobStateChanged();
-    partial void OnResourceIdChanging(System.Nullable<System.Guid> value);
-    partial void OnResourceIdChanged();
-    partial void OnPercentageChanging(System.Nullable<double> value);
-    partial void OnPercentageChanged();
-    partial void OnSerializedJobChanging(System.Data.Linq.Binary value);
-    partial void OnSerializedJobChanged();
-    partial void OnDateCreatedChanging(System.Nullable<System.DateTime> value);
-    partial void OnDateCreatedChanged();
-    partial void OnDateCalculatedChanging(System.Nullable<System.DateTime> value);
-    partial void OnDateCalculatedChanged();
-    partial void OnDateFinishedChanging(System.Nullable<System.DateTime> value);
-    partial void OnDateFinishedChanged();
-    partial void OnPriorityChanging(System.Nullable<int> value);
-    partial void OnPriorityChanged();
-    partial void OnProjectIdChanging(System.Nullable<System.Guid> value);
-    partial void OnProjectIdChanged();
-    partial void OnUserIdChanging(System.Nullable<System.Guid> value);
-    partial void OnUserIdChanged();
-    partial void OnCoresNeededChanging(int value);
-    partial void OnCoresNeededChanged();
-    partial void OnMemoryNeededChanging(int value);
-    partial void OnMemoryNeededChanged();
-    #endregion
-		
-		public Job()
-		{
-			this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
-			this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
-			this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
-			this._Job1 = default(EntityRef<Job>);
-			this._Project = default(EntityRef<Project>);
-			this._Client = default(EntityRef<Client>);
-			OnCreated();
-		}
-		
-		[Column(Storage="_JobId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
-		public System.Guid JobId
-		{
-			get
-			{
-				return this._JobId;
-			}
-			set
-			{
-				if ((this._JobId != value))
-				{
-					this.OnJobIdChanging(value);
-					this.SendPropertyChanging();
-					this._JobId = value;
-					this.SendPropertyChanged("JobId");
-					this.OnJobIdChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_ParentJobId", DbType="UniqueIdentifier")]
-		public System.Nullable<System.Guid> ParentJobId
-		{
-			get
-			{
-				return this._ParentJobId;
-			}
-			set
-			{
-				if ((this._ParentJobId != value))
-				{
-					if (this._Job1.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnParentJobIdChanging(value);
-					this.SendPropertyChanging();
-					this._ParentJobId = value;
-					this.SendPropertyChanged("ParentJobId");
-					this.OnParentJobIdChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_JobState", DbType="VarChar(MAX)")]
-		public string JobState
-		{
-			get
-			{
-				return this._JobState;
-			}
-			set
-			{
-				if ((this._JobState != value))
-				{
-					this.OnJobStateChanging(value);
-					this.SendPropertyChanging();
-					this._JobState = value;
-					this.SendPropertyChanged("JobState");
-					this.OnJobStateChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_ResourceId", DbType="UniqueIdentifier")]
-		public System.Nullable<System.Guid> ResourceId
-		{
-			get
-			{
-				return this._ResourceId;
-			}
-			set
-			{
-				if ((this._ResourceId != value))
-				{
-					if (this._Client.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnResourceIdChanging(value);
-					this.SendPropertyChanging();
-					this._ResourceId = value;
-					this.SendPropertyChanged("ResourceId");
-					this.OnResourceIdChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_Percentage", DbType="Float")]
-		public System.Nullable<double> Percentage
-		{
-			get
-			{
-				return this._Percentage;
-			}
-			set
-			{
-				if ((this._Percentage != value))
-				{
-					this.OnPercentageChanging(value);
-					this.SendPropertyChanging();
-					this._Percentage = value;
-					this.SendPropertyChanged("Percentage");
-					this.OnPercentageChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_SerializedJob", DbType="VarBinary(MAX)", CanBeNull=true, UpdateCheck=UpdateCheck.Never)]
-		public System.Data.Linq.Binary SerializedJob
-		{
-			get
-			{
-				return this._SerializedJob.Value;
-			}
-			set
-			{
-				if ((this._SerializedJob.Value != value))
-				{
-					this.OnSerializedJobChanging(value);
-					this.SendPropertyChanging();
-					this._SerializedJob.Value = value;
-					this.SendPropertyChanged("SerializedJob");
-					this.OnSerializedJobChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_DateCreated", DbType="DateTime")]
-		public System.Nullable<System.DateTime> DateCreated
-		{
-			get
-			{
-				return this._DateCreated;
-			}
-			set
-			{
-				if ((this._DateCreated != value))
-				{
-					this.OnDateCreatedChanging(value);
-					this.SendPropertyChanging();
-					this._DateCreated = value;
-					this.SendPropertyChanged("DateCreated");
-					this.OnDateCreatedChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_DateCalculated", DbType="DateTime")]
-		public System.Nullable<System.DateTime> DateCalculated
-		{
-			get
-			{
-				return this._DateCalculated;
-			}
-			set
-			{
-				if ((this._DateCalculated != value))
-				{
-					this.OnDateCalculatedChanging(value);
-					this.SendPropertyChanging();
-					this._DateCalculated = value;
-					this.SendPropertyChanged("DateCalculated");
-					this.OnDateCalculatedChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_DateFinished", DbType="DateTime")]
-		public System.Nullable<System.DateTime> DateFinished
-		{
-			get
-			{
-				return this._DateFinished;
-			}
-			set
-			{
-				if ((this._DateFinished != value))
-				{
-					this.OnDateFinishedChanging(value);
-					this.SendPropertyChanging();
-					this._DateFinished = value;
-					this.SendPropertyChanged("DateFinished");
-					this.OnDateFinishedChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_Priority", DbType="Int")]
-		public System.Nullable<int> Priority
-		{
-			get
-			{
-				return this._Priority;
-			}
-			set
-			{
-				if ((this._Priority != value))
-				{
-					this.OnPriorityChanging(value);
-					this.SendPropertyChanging();
-					this._Priority = value;
-					this.SendPropertyChanged("Priority");
-					this.OnPriorityChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_ProjectId", DbType="UniqueIdentifier")]
-		public System.Nullable<System.Guid> ProjectId
-		{
-			get
-			{
-				return this._ProjectId;
-			}
-			set
-			{
-				if ((this._ProjectId != value))
-				{
-					if (this._Project.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnProjectIdChanging(value);
-					this.SendPropertyChanging();
-					this._ProjectId = value;
-					this.SendPropertyChanged("ProjectId");
-					this.OnProjectIdChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_UserId", DbType="UniqueIdentifier")]
-		public System.Nullable<System.Guid> UserId
-		{
-			get
-			{
-				return this._UserId;
-			}
-			set
-			{
-				if ((this._UserId != value))
-				{
-					this.OnUserIdChanging(value);
-					this.SendPropertyChanging();
-					this._UserId = value;
-					this.SendPropertyChanged("UserId");
-					this.OnUserIdChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_CoresNeeded", DbType="Int")]
-		public int CoresNeeded
-		{
-			get
-			{
-				return this._CoresNeeded;
-			}
-			set
-			{
-				if ((this._CoresNeeded != value))
-				{
-					this.OnCoresNeededChanging(value);
-					this.SendPropertyChanging();
-					this._CoresNeeded = value;
-					this.SendPropertyChanged("CoresNeeded");
-					this.OnCoresNeededChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_MemoryNeeded", DbType="Int")]
-		public int MemoryNeeded
-		{
-			get
-			{
-				return this._MemoryNeeded;
-			}
-			set
-			{
-				if ((this._MemoryNeeded != value))
-				{
-					this.OnMemoryNeededChanging(value);
-					this.SendPropertyChanging();
-					this._MemoryNeeded = value;
-					this.SendPropertyChanged("MemoryNeeded");
-					this.OnMemoryNeededChanged();
-				}
-			}
-		}
-		
-		[Association(Name="Job_AssignedResource", Storage="_AssignedResources", ThisKey="JobId", OtherKey="JobId")]
-		public EntitySet<AssignedResource> AssignedResources
-		{
-			get
-			{
-				return this._AssignedResources;
-			}
-			set
-			{
-				this._AssignedResources.Assign(value);
-			}
-		}
-		
-		[Association(Name="Job_Job", Storage="_Jobs", ThisKey="JobId", OtherKey="ParentJobId")]
-		public EntitySet<Job> Jobs
-		{
-			get
-			{
-				return this._Jobs;
-			}
-			set
-			{
-				this._Jobs.Assign(value);
-			}
-		}
-		
-		[Association(Name="Job_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="JobId", OtherKey="JobId")]
-		public EntitySet<RequiredPlugin> RequiredPlugins
-		{
-			get
-			{
-				return this._RequiredPlugins;
-			}
-			set
-			{
-				this._RequiredPlugins.Assign(value);
-			}
-		}
-		
-		[Association(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)]
-		public Job Job1
-		{
-			get
-			{
-				return this._Job1.Entity;
-			}
-			set
-			{
-				Job previousValue = this._Job1.Entity;
-				if (((previousValue != value) 
-							|| (this._Job1.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Job1.Entity = null;
-						previousValue.Jobs.Remove(this);
-					}
-					this._Job1.Entity = value;
-					if ((value != null))
-					{
-						value.Jobs.Add(this);
-						this._ParentJobId = value.JobId;
-					}
-					else
-					{
-						this._ParentJobId = default(Nullable<System.Guid>);
-					}
-					this.SendPropertyChanged("Job1");
-				}
-			}
-		}
-		
-		[Association(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="SET NULL")]
-		public Project Project
-		{
-			get
-			{
-				return this._Project.Entity;
-			}
-			set
-			{
-				Project previousValue = this._Project.Entity;
-				if (((previousValue != value) 
-							|| (this._Project.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Project.Entity = null;
-						previousValue.Jobs.Remove(this);
-					}
-					this._Project.Entity = value;
-					if ((value != null))
-					{
-						value.Jobs.Add(this);
-						this._ProjectId = value.ProjectId;
-					}
-					else
-					{
-						this._ProjectId = default(Nullable<System.Guid>);
-					}
-					this.SendPropertyChanged("Project");
-				}
-			}
-		}
-		
-		[Association(Name="Client_Job", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")]
-		public Client Client
-		{
-			get
-			{
-				return this._Client.Entity;
-			}
-			set
-			{
-				Client previousValue = this._Client.Entity;
-				if (((previousValue != value) 
-							|| (this._Client.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Client.Entity = null;
-						previousValue.Jobs.Remove(this);
-					}
-					this._Client.Entity = value;
-					if ((value != null))
-					{
-						value.Jobs.Add(this);
-						this._ResourceId = value.ResourceId;
-					}
-					else
-					{
-						this._ResourceId = default(Nullable<System.Guid>);
-					}
-					this.SendPropertyChanged("Client");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-		
-		private void attach_AssignedResources(AssignedResource entity)
-		{
-			this.SendPropertyChanging();
-			entity.Job = this;
-		}
-		
-		private void detach_AssignedResources(AssignedResource entity)
-		{
-			this.SendPropertyChanging();
-			entity.Job = null;
-		}
-		
-		private void attach_Jobs(Job entity)
-		{
-			this.SendPropertyChanging();
-			entity.Job1 = this;
-		}
-		
-		private void detach_Jobs(Job entity)
-		{
-			this.SendPropertyChanging();
-			entity.Job1 = null;
-		}
-		
-		private void attach_RequiredPlugins(RequiredPlugin entity)
-		{
-			this.SendPropertyChanging();
-			entity.Job = this;
-		}
-		
-		private void detach_RequiredPlugins(RequiredPlugin entity)
-		{
-			this.SendPropertyChanging();
-			entity.Job = null;
-		}
-	}
-	
 	[Table(Name="dbo.PluginInfo")]
 	public partial class PluginInfo : INotifyPropertyChanging, INotifyPropertyChanged
@@ -1882,7 +1301,7 @@
 		private System.Guid _RequiredPluginId;
 		
+		private EntityRef<PluginInfo> _PluginInfo;
+		
 		private EntityRef<Job> _Job;
-		
-		private EntityRef<PluginInfo> _PluginInfo;
 		
     #region Extensibility Method Definitions
@@ -1900,6 +1319,6 @@
 		public RequiredPlugin()
 		{
+			this._PluginInfo = default(EntityRef<PluginInfo>);
 			this._Job = default(EntityRef<Job>);
-			this._PluginInfo = default(EntityRef<PluginInfo>);
 			OnCreated();
 		}
@@ -1973,4 +1392,38 @@
 		}
 		
+		[Association(Name="PluginInfo_RequiredPlugin", Storage="_PluginInfo", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
+		public PluginInfo PluginInfo
+		{
+			get
+			{
+				return this._PluginInfo.Entity;
+			}
+			set
+			{
+				PluginInfo previousValue = this._PluginInfo.Entity;
+				if (((previousValue != value) 
+							|| (this._PluginInfo.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._PluginInfo.Entity = null;
+						previousValue.RequiredPlugins.Remove(this);
+					}
+					this._PluginInfo.Entity = value;
+					if ((value != null))
+					{
+						value.RequiredPlugins.Add(this);
+						this._PluginId = value.PluginId;
+					}
+					else
+					{
+						this._PluginId = default(System.Guid);
+					}
+					this.SendPropertyChanged("PluginInfo");
+				}
+			}
+		}
+		
 		[Association(Name="Job_RequiredPlugin", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
 		public Job Job
@@ -2003,38 +1456,4 @@
 					}
 					this.SendPropertyChanged("Job");
-				}
-			}
-		}
-		
-		[Association(Name="PluginInfo_RequiredPlugin", Storage="_PluginInfo", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
-		public PluginInfo PluginInfo
-		{
-			get
-			{
-				return this._PluginInfo.Entity;
-			}
-			set
-			{
-				PluginInfo previousValue = this._PluginInfo.Entity;
-				if (((previousValue != value) 
-							|| (this._PluginInfo.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._PluginInfo.Entity = null;
-						previousValue.RequiredPlugins.Remove(this);
-					}
-					this._PluginInfo.Entity = value;
-					if ((value != null))
-					{
-						value.RequiredPlugins.Add(this);
-						this._PluginId = value.PluginId;
-					}
-					else
-					{
-						this._PluginId = default(System.Guid);
-					}
-					this.SendPropertyChanged("PluginInfo");
 				}
 			}
@@ -2659,4 +2078,585 @@
 		}
 	}
+	
+	[Table(Name="dbo.Job")]
+	public partial class Job : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _JobId;
+		
+		private System.Nullable<System.Guid> _ParentJobId;
+		
+		private string _JobState;
+		
+		private System.Nullable<System.Guid> _ResourceId;
+		
+		private System.Nullable<double> _Percentage;
+		
+		private System.Data.Linq.Binary _SerializedJob;
+		
+		private System.Nullable<System.DateTime> _DateCreated;
+		
+		private System.Nullable<System.DateTime> _DateCalculated;
+		
+		private System.Nullable<System.DateTime> _DateFinished;
+		
+		private int _Priority;
+		
+		private System.Nullable<System.Guid> _ProjectId;
+		
+		private System.Nullable<System.Guid> _UserId;
+		
+		private int _CoresNeeded;
+		
+		private int _MemoryNeeded;
+		
+		private EntitySet<AssignedResource> _AssignedResources;
+		
+		private EntitySet<RequiredPlugin> _RequiredPlugins;
+		
+		private EntitySet<Job> _Jobs;
+		
+		private EntityRef<Client> _Client;
+		
+		private EntityRef<Job> _Job1;
+		
+		private EntityRef<Project> _Project;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnJobIdChanging(System.Guid value);
+    partial void OnJobIdChanged();
+    partial void OnParentJobIdChanging(System.Nullable<System.Guid> value);
+    partial void OnParentJobIdChanged();
+    partial void OnJobStateChanging(string value);
+    partial void OnJobStateChanged();
+    partial void OnResourceIdChanging(System.Nullable<System.Guid> value);
+    partial void OnResourceIdChanged();
+    partial void OnPercentageChanging(System.Nullable<double> value);
+    partial void OnPercentageChanged();
+    partial void OnSerializedJobChanging(System.Data.Linq.Binary value);
+    partial void OnSerializedJobChanged();
+    partial void OnDateCreatedChanging(System.Nullable<System.DateTime> value);
+    partial void OnDateCreatedChanged();
+    partial void OnDateCalculatedChanging(System.Nullable<System.DateTime> value);
+    partial void OnDateCalculatedChanged();
+    partial void OnDateFinishedChanging(System.Nullable<System.DateTime> value);
+    partial void OnDateFinishedChanged();
+    partial void OnPriorityChanging(int value);
+    partial void OnPriorityChanged();
+    partial void OnProjectIdChanging(System.Nullable<System.Guid> value);
+    partial void OnProjectIdChanged();
+    partial void OnUserIdChanging(System.Nullable<System.Guid> value);
+    partial void OnUserIdChanged();
+    partial void OnCoresNeededChanging(int value);
+    partial void OnCoresNeededChanged();
+    partial void OnMemoryNeededChanging(int value);
+    partial void OnMemoryNeededChanged();
+    #endregion
+		
+		public Job()
+		{
+			this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
+			this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
+			this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
+			this._Client = default(EntityRef<Client>);
+			this._Job1 = default(EntityRef<Job>);
+			this._Project = default(EntityRef<Project>);
+			OnCreated();
+		}
+		
+		[Column(Storage="_JobId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid JobId
+		{
+			get
+			{
+				return this._JobId;
+			}
+			set
+			{
+				if ((this._JobId != value))
+				{
+					this.OnJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._JobId = value;
+					this.SendPropertyChanged("JobId");
+					this.OnJobIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_ParentJobId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> ParentJobId
+		{
+			get
+			{
+				return this._ParentJobId;
+			}
+			set
+			{
+				if ((this._ParentJobId != value))
+				{
+					if (this._Job1.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnParentJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._ParentJobId = value;
+					this.SendPropertyChanged("ParentJobId");
+					this.OnParentJobIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_JobState", DbType="VarChar(MAX)")]
+		public string JobState
+		{
+			get
+			{
+				return this._JobState;
+			}
+			set
+			{
+				if ((this._JobState != value))
+				{
+					this.OnJobStateChanging(value);
+					this.SendPropertyChanging();
+					this._JobState = value;
+					this.SendPropertyChanged("JobState");
+					this.OnJobStateChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_ResourceId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> ResourceId
+		{
+			get
+			{
+				return this._ResourceId;
+			}
+			set
+			{
+				if ((this._ResourceId != value))
+				{
+					if (this._Client.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceId = value;
+					this.SendPropertyChanged("ResourceId");
+					this.OnResourceIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Percentage", DbType="Float")]
+		public System.Nullable<double> Percentage
+		{
+			get
+			{
+				return this._Percentage;
+			}
+			set
+			{
+				if ((this._Percentage != value))
+				{
+					this.OnPercentageChanging(value);
+					this.SendPropertyChanging();
+					this._Percentage = value;
+					this.SendPropertyChanged("Percentage");
+					this.OnPercentageChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_SerializedJob", DbType="VarBinary(MAX)", CanBeNull=true, UpdateCheck=UpdateCheck.Never)]
+		public System.Data.Linq.Binary SerializedJob
+		{
+			get
+			{
+				return this._SerializedJob;
+			}
+			set
+			{
+				if ((this._SerializedJob != value))
+				{
+					this.OnSerializedJobChanging(value);
+					this.SendPropertyChanging();
+					this._SerializedJob = value;
+					this.SendPropertyChanged("SerializedJob");
+					this.OnSerializedJobChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_DateCreated", DbType="DateTime")]
+		public System.Nullable<System.DateTime> DateCreated
+		{
+			get
+			{
+				return this._DateCreated;
+			}
+			set
+			{
+				if ((this._DateCreated != value))
+				{
+					this.OnDateCreatedChanging(value);
+					this.SendPropertyChanging();
+					this._DateCreated = value;
+					this.SendPropertyChanged("DateCreated");
+					this.OnDateCreatedChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_DateCalculated", DbType="DateTime")]
+		public System.Nullable<System.DateTime> DateCalculated
+		{
+			get
+			{
+				return this._DateCalculated;
+			}
+			set
+			{
+				if ((this._DateCalculated != value))
+				{
+					this.OnDateCalculatedChanging(value);
+					this.SendPropertyChanging();
+					this._DateCalculated = value;
+					this.SendPropertyChanged("DateCalculated");
+					this.OnDateCalculatedChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_DateFinished", DbType="DateTime")]
+		public System.Nullable<System.DateTime> DateFinished
+		{
+			get
+			{
+				return this._DateFinished;
+			}
+			set
+			{
+				if ((this._DateFinished != value))
+				{
+					this.OnDateFinishedChanging(value);
+					this.SendPropertyChanging();
+					this._DateFinished = value;
+					this.SendPropertyChanged("DateFinished");
+					this.OnDateFinishedChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Priority", DbType="Int NOT NULL")]
+		public int Priority
+		{
+			get
+			{
+				return this._Priority;
+			}
+			set
+			{
+				if ((this._Priority != value))
+				{
+					this.OnPriorityChanging(value);
+					this.SendPropertyChanging();
+					this._Priority = value;
+					this.SendPropertyChanged("Priority");
+					this.OnPriorityChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_ProjectId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> ProjectId
+		{
+			get
+			{
+				return this._ProjectId;
+			}
+			set
+			{
+				if ((this._ProjectId != value))
+				{
+					if (this._Project.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnProjectIdChanging(value);
+					this.SendPropertyChanging();
+					this._ProjectId = value;
+					this.SendPropertyChanged("ProjectId");
+					this.OnProjectIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_UserId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> UserId
+		{
+			get
+			{
+				return this._UserId;
+			}
+			set
+			{
+				if ((this._UserId != value))
+				{
+					this.OnUserIdChanging(value);
+					this.SendPropertyChanging();
+					this._UserId = value;
+					this.SendPropertyChanged("UserId");
+					this.OnUserIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_CoresNeeded", DbType="Int NOT NULL")]
+		public int CoresNeeded
+		{
+			get
+			{
+				return this._CoresNeeded;
+			}
+			set
+			{
+				if ((this._CoresNeeded != value))
+				{
+					this.OnCoresNeededChanging(value);
+					this.SendPropertyChanging();
+					this._CoresNeeded = value;
+					this.SendPropertyChanged("CoresNeeded");
+					this.OnCoresNeededChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_MemoryNeeded", DbType="Int NOT NULL")]
+		public int MemoryNeeded
+		{
+			get
+			{
+				return this._MemoryNeeded;
+			}
+			set
+			{
+				if ((this._MemoryNeeded != value))
+				{
+					this.OnMemoryNeededChanging(value);
+					this.SendPropertyChanging();
+					this._MemoryNeeded = value;
+					this.SendPropertyChanged("MemoryNeeded");
+					this.OnMemoryNeededChanged();
+				}
+			}
+		}
+		
+		[Association(Name="Job_AssignedResource", Storage="_AssignedResources", ThisKey="JobId", OtherKey="JobId")]
+		public EntitySet<AssignedResource> AssignedResources
+		{
+			get
+			{
+				return this._AssignedResources;
+			}
+			set
+			{
+				this._AssignedResources.Assign(value);
+			}
+		}
+		
+		[Association(Name="Job_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="JobId", OtherKey="JobId")]
+		public EntitySet<RequiredPlugin> RequiredPlugins
+		{
+			get
+			{
+				return this._RequiredPlugins;
+			}
+			set
+			{
+				this._RequiredPlugins.Assign(value);
+			}
+		}
+		
+		[Association(Name="Job_Job", Storage="_Jobs", ThisKey="JobId", OtherKey="ParentJobId")]
+		public EntitySet<Job> Jobs
+		{
+			get
+			{
+				return this._Jobs;
+			}
+			set
+			{
+				this._Jobs.Assign(value);
+			}
+		}
+		
+		[Association(Name="Client_Job", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")]
+		public Client Client
+		{
+			get
+			{
+				return this._Client.Entity;
+			}
+			set
+			{
+				Client previousValue = this._Client.Entity;
+				if (((previousValue != value) 
+							|| (this._Client.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Client.Entity = null;
+						previousValue.Jobs.Remove(this);
+					}
+					this._Client.Entity = value;
+					if ((value != null))
+					{
+						value.Jobs.Add(this);
+						this._ResourceId = value.ResourceId;
+					}
+					else
+					{
+						this._ResourceId = default(Nullable<System.Guid>);
+					}
+					this.SendPropertyChanged("Client");
+				}
+			}
+		}
+		
+		[Association(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)]
+		public Job Job1
+		{
+			get
+			{
+				return this._Job1.Entity;
+			}
+			set
+			{
+				Job previousValue = this._Job1.Entity;
+				if (((previousValue != value) 
+							|| (this._Job1.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Job1.Entity = null;
+						previousValue.Jobs.Remove(this);
+					}
+					this._Job1.Entity = value;
+					if ((value != null))
+					{
+						value.Jobs.Add(this);
+						this._ParentJobId = value.JobId;
+					}
+					else
+					{
+						this._ParentJobId = default(Nullable<System.Guid>);
+					}
+					this.SendPropertyChanged("Job1");
+				}
+			}
+		}
+		
+		[Association(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="SET NULL")]
+		public Project Project
+		{
+			get
+			{
+				return this._Project.Entity;
+			}
+			set
+			{
+				Project previousValue = this._Project.Entity;
+				if (((previousValue != value) 
+							|| (this._Project.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Project.Entity = null;
+						previousValue.Jobs.Remove(this);
+					}
+					this._Project.Entity = value;
+					if ((value != null))
+					{
+						value.Jobs.Add(this);
+						this._ProjectId = value.ProjectId;
+					}
+					else
+					{
+						this._ProjectId = default(Nullable<System.Guid>);
+					}
+					this.SendPropertyChanged("Project");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+		
+		private void attach_AssignedResources(AssignedResource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = this;
+		}
+		
+		private void detach_AssignedResources(AssignedResource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = null;
+		}
+		
+		private void attach_RequiredPlugins(RequiredPlugin entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = this;
+		}
+		
+		private void detach_RequiredPlugins(RequiredPlugin entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = null;
+		}
+		
+		private void attach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job1 = this;
+		}
+		
+		private void detach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job1 = null;
+		}
+	}
 }
 #pragma warning restore 1591
Index: /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/JobDao.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/JobDao.cs	(revision 3017)
+++ /trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/JobDao.cs	(revision 3018)
@@ -42,4 +42,6 @@
       Job j = DtoToEntity(job.JobInfo, null);
       j.SerializedJob = job.SerializedJobData;
+      foreach (Guid assignRessourceId in job.JobInfo.AssignedResourceIds)
+        j.AssignedResources.Add(new AssignedResource { ResourceId = assignRessourceId});
       Context.Jobs.InsertOnSubmit(j);
       Context.SubmitChanges();
@@ -70,10 +72,19 @@
               select EntityToDto(j, null)).ToList();
     }
-    public IEnumerable<JobDto> FindFittingJobsForClient(State state, int freeCores, int freeMemory) {
-      return (from j in Context.Jobs
-              where j.JobState == Enum.GetName(typeof (State), State.offline) &&
-                    j.CoresNeeded <= freeCores &&
-                    j.MemoryNeeded <= freeMemory
-              select EntityToDto(j, null)).ToList();
+    public IEnumerable<JobDto> FindFittingJobsForClient(State state, int freeCores, int freeMemory, Guid clientId) {
+      ClientGroupDao cgd = new ClientGroupDao();
+      
+      List<Guid> idList = new List<Guid>(cgd.FindAllGroupAndParentGroupIdsForClient(clientId));
+      //Add myself too - enables jobs for one specific host!
+      idList.Add(clientId);
+      
+      var q = (from ar in Context.AssignedResources               
+               where ar.Job.JobState == Enum.GetName(typeof (State), State.offline) &&
+                     ar.Job.CoresNeeded <= freeCores &&
+                     ar.Job.MemoryNeeded <= freeMemory &&
+                     idList.Contains(ar.ResourceId)
+               orderby ar.Job.Priority descending                 
+               select EntityToDto(ar.Job, null));
+      return q.ToList();
       
     }
