Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedJobResourceDao.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedJobResourceDao.cs	(revision 16117)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedJobResourceDao.cs	(revision 16117)
@@ -0,0 +1,248 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Data.Linq;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Services.Hive.DataAccess.Daos {
+  public class AssignedJobResourceDao : GenericDao<Guid, AssignedJobResource> {
+    public AssignedJobResourceDao(DataContext dataContext) : base(dataContext) { }
+
+    public override AssignedJobResource GetById(Guid id) {
+      throw new NotImplementedException();
+    }
+
+    public IQueryable<AssignedJobResource> GetByJobId(Guid jobId) {
+      return Table.Where(x => x.JobId == jobId);
+    }
+
+    public void DeleteByProjectId(Guid projectId) {
+      DataContext.ExecuteCommand(DeleteByProjectIdQueryString, projectId);
+    }
+
+    public void DeleteByProjectIdAndUserIds(Guid projectId, IEnumerable<Guid> userIds) {
+      string paramUserIds = string.Join(",", userIds.Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramUserIds)) {
+        string queryString = string.Format(DeleteByProjectIdAndUserIdsQueryString, projectId, paramUserIds);
+        DataContext.ExecuteCommand(queryString);
+      }
+    }
+
+    public void DeleteByProjectIds(IEnumerable<Guid> projectIds) {
+      string paramProjectIds = string.Join(",", projectIds.Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramProjectIds)) {
+        string queryString = string.Format(DeleteByProjectIdsQueryString, paramProjectIds);
+        DataContext.ExecuteCommand(queryString);
+      }
+    }
+
+    public void DeleteByProjectIdsAndUserIds(IEnumerable<Guid> projectIds, IEnumerable<Guid> userIds) {
+      string paramProjectIds = string.Join(",", projectIds.Select(x => string.Format("'{0}'", x)));
+      string paramUserIds = string.Join(",", userIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramProjectIds) && !string.IsNullOrWhiteSpace(paramUserIds)) {
+        string queryString = string.Format(DeleteByProjectIdsAndUserIdsQueryString, paramProjectIds, paramUserIds);
+        DataContext.ExecuteCommand(queryString);
+      }
+    }
+
+    public void DeleteByProjectIdAndResourceIds(Guid projectId, IEnumerable<Guid> resourceIds) {
+      string paramResourceIds = string.Join(",", resourceIds.Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramResourceIds)) {
+        string queryString = string.Format(DeleteByProjectIdAndResourceIdsQueryString, projectId, paramResourceIds);
+        DataContext.ExecuteCommand(queryString);
+      }
+    }
+
+    public void DeleteByProjectIdsAndResourceIds(IEnumerable<Guid> projectIds, IEnumerable<Guid> resourceIds) {
+      string paramProjectIds = string.Join(",", projectIds.Select(x => string.Format("'{0}'", x)));
+      string paramResourceIds = string.Join(",", resourceIds.Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramProjectIds) && !string.IsNullOrWhiteSpace(paramResourceIds)) {
+        string queryString = string.Format(DeleteByProjectIdsAndResourceIdsQueryString, paramProjectIds, paramResourceIds);
+        DataContext.ExecuteCommand(queryString);
+      }
+    }
+
+    public bool CheckJobGrantedForResource(Guid jobId, Guid resourceId) {
+      return DataContext.ExecuteQuery<int>(CheckJobGrantedForResourceQueryString, jobId, resourceId).First() > 0;
+    }
+
+    public bool CheckJobGrantedForResources(Guid jobId, IEnumerable<Guid> resourceIds) {
+      string paramResourceIds = string.Join(",", resourceIds.Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramResourceIds)) {
+        string queryString = string.Format(CheckJobGrantedForResourcesQueryString, jobId, paramResourceIds);
+        return DataContext.ExecuteQuery<int>(queryString).Count() == 0;
+      }
+      return false;
+    }
+
+    public bool CheckTaskGrantedForResource(Guid taskId, Guid resourceId) {
+      return DataContext.ExecuteQuery<int>(CheckTaskGrantedForResourceQueryString, taskId, resourceId).First() > 0;
+    }
+
+    public IEnumerable<Resource> GetAllGrantedResourcesByJobId(Guid jobId) {
+      return DataContext.ExecuteQuery<Resource>(GetAllGrantedResourcesByJobIdQueryString, jobId);
+    }
+
+    public IEnumerable<Guid> GetAllGrantedResourceIdsByJobId(Guid jobId) {
+      return DataContext.ExecuteQuery<Guid>(GetAllGrantedResourceIdsByJobIdQueryString, jobId);
+    }
+
+    #region String queries
+    private const string DeleteByProjectIdQueryString = @"
+      DELETE FROM [AssignedJobResource]
+      WHERE JobId IN
+	      (
+		      SELECT j.JobId
+		      FROM [Job] j
+		      WHERE j.ProjectId = {0}
+	      )
+    ";
+    private const string DeleteByProjectIdAndUserIdsQueryString = @"
+      DELETE FROM [AssignedJobResource]
+      WHERE JobId IN
+	      (
+		      SELECT j.JobId
+		      FROM [Job] j
+		      WHERE j.ProjectId = '{0}'
+          AND j.OwnerUserId IN ({1})
+	      )
+    ";
+    private const string DeleteByProjectIdsQueryString = @"
+      DELETE FROM [AssignedJobResource]
+      WHERE JobId IN
+	      (
+		      SELECT j.JobId
+		      FROM [Job] j
+		      WHERE j.ProjectId IN ({0})
+	      )
+    ";
+    private const string DeleteByProjectIdsAndUserIdsQueryString = @"
+      DELETE FROM [AssignedJobResource]
+      WHERE JobId IN
+	      (
+		      SELECT j.JobId
+		      FROM [Job] j
+		      WHERE j.ProjectId IN ({0})
+          AND j.OwnerUserId IN ({1})
+	      )
+    ";
+    private const string DeleteByProjectIdAndResourceIdsQueryString = @"
+      DELETE FROM [AssignedJobResource]
+      WHERE JobId IN
+	      (
+		      SELECT j.JobId
+		      FROM [Job] j
+		      WHERE j.ProjectId = '{0}'
+	      )
+      AND ResourceId IN ({1})
+    ";
+    private const string DeleteByProjectIdsAndResourceIdsQueryString = @"
+      DELETE FROM [AssignedJobResource]
+      WHERE JobId IN
+	      (
+		      SELECT j.JobId
+		      FROM [Job] j
+		      WHERE j.ProjectId IN ({0})
+	      )
+      AND ResourceId IN ({1})
+    ";
+    private const string CheckJobGrantedForResourceQueryString = @"
+      WITH rbranch AS (
+        SELECT ResourceId, ParentResourceId
+        FROM [Resource]
+        WHERE ResourceId = {1}
+        UNION ALL
+        SELECT r.ResourceId, r.ParentResourceId
+        FROM [Resource] r
+        JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId
+      )
+      SELECT COUNT(ajr.JobId)
+      FROM rbranch, [AssignedJobResource] ajr
+      WHERE rbranch.ResourceId = ajr.ResourceId
+      AND ajr.JobId = {0}
+    ";
+    private const string CheckTaskGrantedForResourceQueryString = @"
+      WITH rbranch AS (
+        SELECT ResourceId, ParentResourceId
+        FROM [Resource]
+        WHERE ResourceId = {1}
+        UNION ALL
+        SELECT r.ResourceId, r.ParentResourceId
+        FROM [Resource] r
+        JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId
+      )
+      SELECT COUNT(ajr.JobId)
+      FROM rbranch, [AssignedJobResource] ajr, [Task] t
+      WHERE rbranch.ResourceId = ajr.ResourceId
+      AND ajr.JobId = t.JobId
+      AND t.JobId = {0}
+    ";
+    private const string CheckJobGrantedForResourcesQueryString = @"
+      WITH rtree AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      UNION ALL
+	      SELECT rt.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId
+      )
+      SELECT r.ResourceId
+      FROM [Resource] r
+      WHERE r.ResourceId IN ({1})
+      EXCEPT
+      (
+	      SELECT rtree.ResourceId
+	      FROM rtree, [AssignedJobResource] ajr
+	      WHERE rtree.ParentResourceId = ajr.ResourceId
+	      AND ajr.JobId = {0}
+	      UNION
+	      SELECT ajr.ResourceId
+	      FROM [AssignedJobResource] ajr
+	      WHERE ajr.JobId = {0}
+      )
+    ";
+    private const string GetAllGrantedResourcesByJobIdQueryString = @"
+      WITH rtree AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      UNION ALL
+	      SELECT rt.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId
+      )
+      SELECT res.*
+      FROM rtree, [AssignedJobResource] ajr, [Resource] res
+      WHERE rtree.ParentResourceId = ajr.ResourceId
+      AND rtree.ResourceId = res.ResourceId
+      AND ajr.JobId = {0}
+      UNION
+      SELECT res.*
+      FROM [AssignedJobResource] ajr, [Resource] res
+      WHERE ajr.ResourceId = res.ResourceId
+      AND ajr.JobId = {0}
+    ";
+    private const string GetAllGrantedResourceIdsByJobIdQueryString = @"
+    WITH rtree AS
+    (
+	    SELECT ResourceId, ParentResourceId
+	    FROM [Resource]
+	    UNION ALL
+	    SELECT rt.ResourceId, r.ParentResourceId
+	    FROM [Resource] r
+	    JOIN rtree rt ON rt.ParentResourceId = r.ResourceId
+    )
+    SELECT rtree.ResourceId
+    FROM rtree, [AssignedJobResource] ajr
+    WHERE rtree.ParentResourceId = ajr.ResourceId
+    AND ajr.JobId = {0}
+    UNION
+    SELECT ajr.ResourceId
+    FROM [AssignedJobResource] ajr
+    WHERE ajr.JobId = {0}
+    ";
+    #endregion
+  }
+}
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedProjectResourceDao.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedProjectResourceDao.cs	(revision 16117)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedProjectResourceDao.cs	(revision 16117)
@@ -0,0 +1,233 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2017 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.Data.Linq;
+using System.Linq;
+
+namespace HeuristicLab.Services.Hive.DataAccess.Daos {
+  public class AssignedProjectResourceDao : GenericDao<Guid, AssignedProjectResource> {
+    public AssignedProjectResourceDao(DataContext dataContext) : base(dataContext) { }
+
+    public override AssignedProjectResource GetById(Guid id) {
+      throw new NotImplementedException();
+    }
+
+    public IQueryable<AssignedProjectResource> GetByProjectId(Guid projectId) {
+      return Table.Where(x => x.ProjectId == projectId);
+    }
+
+    public void DeleteByProjectIdAndResourceIds(Guid projectId, IEnumerable<Guid> resourceIds) {
+      string paramIds = string.Join(",", resourceIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramIds)) {
+        string query = string.Format(DeleteByProjectIdAndResourceIdsQueryString, projectId, paramIds);
+        DataContext.ExecuteCommand(query);
+      }
+    }
+
+    public void DeleteByProjectIdsAndResourceIds(IEnumerable<Guid> projectIds, IEnumerable<Guid> resourceIds) {
+      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
+      string paramResourceIds = string.Join(",", resourceIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramProjectIds) && !string.IsNullOrWhiteSpace(paramResourceIds)) {
+        string query = string.Format(DeleteByProjectIdsAndResourceIdsQueryString, paramProjectIds, paramResourceIds);
+        DataContext.ExecuteCommand(query);
+      }
+    }
+
+    public void DeleteByProjectIds(IEnumerable<Guid> projectIds) {
+      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramProjectIds)) {
+        string query = string.Format(DeleteByProjectIdsQueryString, paramProjectIds);
+        DataContext.ExecuteCommand(query);
+      }
+    }
+
+    public bool CheckProjectGrantedForResources(Guid projectId, IEnumerable<Guid> resourceIds) {
+      string paramResourceIds = string.Join(",", resourceIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramResourceIds)) {
+        string queryString = string.Format(CheckProjectGrantedForResourcesQueryString, projectId, paramResourceIds);
+        return DataContext.ExecuteQuery<int>(queryString).Count() == 0;
+      }
+      return false;
+    }
+
+    public IEnumerable<Resource> GetAllGrantedResourcesByProjectId(Guid projectId) {
+      return DataContext.ExecuteQuery<Resource>(GetAllGrantedResourcesByProjectIdQueryString, projectId);
+    }
+
+    public IEnumerable<Guid> GetAllGrantedResourceIdsByProjectId(Guid projectId) {
+      return DataContext.ExecuteQuery<Guid>(GetAllGrantedResourceIdsByProjectIdQueryString, projectId);
+    }
+
+    public IEnumerable<Resource> GetAllGrantedResourcesByProjectIds(IEnumerable<Guid> projectIds) {
+      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramProjectIds)) {
+        string queryString = string.Format(GetAllGrantedResourcesByProjectIdsQueryString, paramProjectIds);
+        return DataContext.ExecuteQuery<Resource>(queryString);
+      }
+      return Enumerable.Empty<Resource>();
+    }
+
+    public IEnumerable<Guid> GetAllGrantedResourceIdsOfOwnedParentProjects(Guid projectId, Guid userId) {
+      return DataContext.ExecuteQuery<Guid>(GetAllGrantedResourceIdsOfOwnedParentProjectsQueryString, projectId, userId);
+    }
+
+
+    #region Compiled queries
+    private static readonly Func<DataContext, Guid, IEnumerable<AssignedProjectResource>> GetByProjectIdGetByIdQuery =
+      CompiledQuery.Compile((DataContext db, Guid projectId) =>
+        from projectPermission in db.GetTable<AssignedProjectResource>()
+        where projectPermission.ProjectId == projectId
+        select projectPermission);
+    #endregion
+
+    #region String queries
+    private const string DeleteByProjectIdAndResourceIdsQueryString = @"
+      DELETE FROM [AssignedProjectResource]
+        WHERE ProjectId = '{0}'
+        AND ResourceId IN ({1});
+    ";
+    private const string DeleteByProjectIdsAndResourceIdsQueryString = @"
+      DELETE FROM [AssignedProjectResource]
+        WHERE ProjectId IN ({0})
+        AND ResourceId IN ({1});
+    ";
+    private const string DeleteByProjectIdsQueryString = @"
+      DELETE FROM [AssignedProjectResource]
+        WHERE ProjectId IN ({0})
+    ";
+    private const string CheckProjectGrantedForResourcesQueryString = @"
+    WITH rtree AS
+    (
+	    SELECT ResourceId, ParentResourceId
+	    FROM [Resource]
+	    UNION ALL
+	    SELECT rt.ResourceId, r.ParentResourceId
+	    FROM [Resource] r
+	    JOIN rtree rt ON rt.ParentResourceId = r.ResourceId
+    )
+    SELECT r.ResourceId
+    FROM [Resource] r
+    WHERE r.ResourceId IN ({1})
+    EXCEPT
+    (
+	    SELECT rtree.ResourceId
+	    FROM rtree, [AssignedProjectResource] apr
+	    WHERE rtree.ParentResourceId = apr.ResourceId
+	    AND apr.ProjectId = '{0}'
+	    UNION
+	    SELECT apr.ResourceId
+	    FROM [AssignedProjectResource] apr
+	    WHERE apr.ProjectId = '{0}'
+    )
+    ";
+    private const string GetAllGrantedResourcesByProjectIdQueryString = @"
+      WITH rtree AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      UNION ALL
+	      SELECT rt.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId
+      )
+      SELECT res.*
+      FROM rtree, [AssignedProjectResource] apr, [Resource] res
+      WHERE rtree.ParentResourceId = apr.ResourceId
+      AND rtree.ResourceId = res.ResourceId
+      AND apr.ProjectId = '{0}'
+      UNION
+      SELECT res.*
+      FROM [AssignedProjectResource] apr, [Resource] res
+      WHERE apr.ResourceId = res.ResourceId
+      AND apr.ProjectId = '{0}'
+    ";
+    private const string GetAllGrantedResourceIdsByProjectIdQueryString = @"
+    WITH rtree AS
+    (
+	    SELECT ResourceId, ParentResourceId
+	    FROM [Resource]
+	    UNION ALL
+	    SELECT rt.ResourceId, r.ParentResourceId
+	    FROM [Resource] r
+	    JOIN rtree rt ON rt.ParentResourceId = r.ResourceId
+    )
+    SELECT rtree.ResourceId
+    FROM rtree, [AssignedProjectResource] apr
+    WHERE rtree.ParentResourceId = apr.ResourceId
+    AND apr.ProjectId = '{0}'
+    UNION
+    SELECT apr.ResourceId
+    FROM [AssignedProjectResource] apr
+    WHERE apr.ProjectId = '{0}'
+    ";
+    private const string GetAllGrantedResourcesByProjectIdsQueryString = @"
+      WITH rtree AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      UNION ALL
+	      SELECT rt.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId
+      )
+      SELECT res.*
+      FROM rtree, [AssignedProjectResource] apr, [Resource] res
+      WHERE rtree.ParentResourceId = apr.ResourceId
+      AND rtree.ResourceId = res.ResourceId
+      AND apr.ProjectId IN ({0})
+      UNION
+      SELECT res.*
+      FROM [AssignedProjectResource] apr, [Resource] res
+      WHERE apr.ResourceId = res.ResourceId
+      AND apr.ProjectId IN ({0})
+    ";
+    private const string GetAllGrantedResourceIdsOfOwnedParentProjectsQueryString = @"
+      WITH pbranch AS
+      (
+	      SELECT ProjectId, ParentProjectId
+	      FROM [Project]
+	      UNION ALL
+	      SELECT pb.ProjectId, p.ParentProjectId
+	      FROM [Project] p
+	      JOIN pbranch pb ON pb.ParentProjectId = p.ProjectId AND p.ParentProjectId <> p.ProjectId AND pb.ParentProjectId <> pb.ProjectId
+      ),
+      rtree AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      UNION ALL
+	      SELECT rt.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rt.ParentResourceId <> rt.ResourceId
+      )
+      SELECT DISTINCT rtree.ResourceId
+      FROM pbranch, rtree, [Project] pro, [AssignedProjectResource] apr
+      WHERE pbranch.ProjectId = {0}
+      AND pbranch.ParentProjectId = pro.ProjectId
+      AND pro.OwnerUserId = {1}
+      AND pbranch.ParentProjectId = apr.ProjectId
+      AND apr.ResourceId = rtree.ParentResourceId
+    ";
+    #endregion
+  }
+}
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/DimClientDao.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/DimClientDao.cs	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/DimClientDao.cs	(revision 16117)
@@ -33,10 +33,26 @@
     }
 
-    public IQueryable<DimClient> GetActiveClients() {
-      return Table.Where(x => x.ExpirationTime == null);
+    public IQueryable<DimClient> GetAllOnlineClients() {
+      return Table.Where(x => x.DateExpired == null);
     }
 
-    public IQueryable<DimClient> GetExpiredClients() {
-      return Table.Where(x => x.ExpirationTime != null);
+    public IQueryable<DimClient> GetAllExpiredClients() {
+      return Table.Where(x => x.DateExpired != null);
+    }
+
+    public IQueryable<DimClient> GetAllOnlineSlaves() {
+      return Table.Where(x => x.DateExpired == null && x.ResourceType == "Slave");
+    }
+
+    public IQueryable<DimClient> GetAllOnlineSlaveGroups() {
+      return Table.Where(x => x.DateExpired == null && x.ResourceType == "GROUP");
+    }
+
+    public IQueryable<DimClient> GetAllExpiredSlaves() {
+      return Table.Where(x => x.DateExpired != null && x.ResourceType == "Slave");
+    }
+
+    public IQueryable<DimClient> GetAllExpiredSlaveGroups() {
+      return Table.Where(x => x.DateExpired != null && x.ResourceType == "GROUP");
     }
 
@@ -44,5 +60,5 @@
       string paramIds = string.Join(",", ids.Select(x => string.Format("'{0}'", x)));
       if (!string.IsNullOrWhiteSpace(paramIds)) {
-        string query = string.Format(UpdateExpirationTimeQuery, "{0}", paramIds);
+        string query = string.Format(UpdateDateExpiredQuery, "{0}", paramIds);
         return DataContext.ExecuteCommand(query, time);
       }
@@ -59,7 +75,7 @@
 
     #region String queries
-    private const string UpdateExpirationTimeQuery =
+    private const string UpdateDateExpiredQuery =
       @"UPDATE [statistics].[DimClient] 
-           SET ExpirationTime = {0} 
+           SET DateExpired = {0} 
          WHERE Id IN ({1});";
     #endregion
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/DimProjectDao.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/DimProjectDao.cs	(revision 16117)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/DimProjectDao.cs	(revision 16117)
@@ -0,0 +1,72 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Data.Linq;
+using System.Linq;
+
+namespace HeuristicLab.Services.Hive.DataAccess.Daos.HiveStatistics {
+  public class DimProjectDao : GenericDao<Guid, DimProject> {
+    public DimProjectDao(DataContext dataContext) : base(dataContext) { }
+
+    public override DimProject GetById(Guid id) {
+      return GetByIdQuery(DataContext, id);
+    }
+
+    public IEnumerable<DimProject> GetByProjectId(Guid projectId) {
+      return GetByProjectIdQuery(DataContext, projectId);
+    }
+
+    public Guid GetLastValidIdByProjectId(Guid projectId) {
+      return GetLastValidIdByProjectIdQuery(DataContext, projectId);
+    }
+
+    public IEnumerable<DimProject> GetAllOnlineProjects() {
+      return GetAllOnlineProjectsQuery(DataContext);
+    }
+
+    #region Compiled queries
+    private static readonly Func<DataContext, Guid, DimProject> GetByIdQuery =
+      CompiledQuery.Compile((DataContext db, Guid id) =>
+        (from dimProject in db.GetTable<DimProject>()
+         where dimProject.Id == id
+         select dimProject).SingleOrDefault());
+    private static readonly Func<DataContext, Guid, IEnumerable<DimProject>> GetByProjectIdQuery =
+      CompiledQuery.Compile((DataContext db, Guid projectId) =>
+        (from dimProject in db.GetTable<DimProject>()
+         where dimProject.ProjectId == projectId
+         select dimProject));
+    private static readonly Func<DataContext, Guid, Guid> GetLastValidIdByProjectIdQuery =
+      CompiledQuery.Compile((DataContext db, Guid projectId) =>
+        (from dimProject in db.GetTable<DimProject>()
+         where dimProject.ProjectId == projectId
+         && dimProject.DateExpired == null
+         orderby dimProject.DateCreated descending
+         select dimProject.Id).SingleOrDefault());
+    private static readonly Func<DataContext, IEnumerable<DimProject>> GetAllOnlineProjectsQuery =
+      CompiledQuery.Compile((DataContext db) =>
+        (from dimProject in db.GetTable<DimProject>()
+         where dimProject.DateExpired == null
+         select dimProject));
+    #endregion
+  }
+}
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/FactProjectInfoDao.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/FactProjectInfoDao.cs	(revision 16117)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/FactProjectInfoDao.cs	(revision 16117)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Data.Linq;
+using System.Linq;
+
+namespace HeuristicLab.Services.Hive.DataAccess.Daos.HiveStatistics {
+  public class FactProjectInfoDao : GenericDao<Guid, FactProjectInfo> {
+    public FactProjectInfoDao(DataContext dataContext) : base(dataContext) { }
+
+    public override FactProjectInfo GetById(Guid id) {
+      return GetByIdQuery(DataContext, id);
+    }
+
+    private Table<DimTime> DimTimeTable {
+      get { return DataContext.GetTable<DimTime>(); }
+    }
+
+    #region Compiled queries
+    private static readonly Func<DataContext, Guid, FactProjectInfo> GetByIdQuery =
+      CompiledQuery.Compile((DataContext db, Guid id) =>
+        (from factProjectInfo in db.GetTable<FactProjectInfo>()
+         where factProjectInfo.ProjectId== id
+         select factProjectInfo).SingleOrDefault());
+    #endregion
+  }
+}
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/FactTaskDao.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/FactTaskDao.cs	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/FactTaskDao.cs	(revision 16117)
@@ -66,5 +66,5 @@
       return from factTask in Table
              join client in DimClientTable on factTask.LastClientId equals client.Id
-             where client.ResourceGroupId == id
+             where client.ParentResourceId == id
              select factTask;
     }
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/JobDao.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/JobDao.cs	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/JobDao.cs	(revision 16117)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Collections.Generic;
 using System.Data.Linq;
 using System.Linq;
@@ -32,4 +33,34 @@
     }
 
+    public void DeleteByState(JobState state) {
+      DataContext.ExecuteCommand(DeleteByStateQueryString, Enum.GetName(typeof(JobState), state));
+    }
+
+    public IEnumerable<Job> GetByProjectId(Guid id) {
+      return GetByProjectIdQuery(DataContext, id);
+    }
+
+    public IEnumerable<Job> GetByProjectIds(IEnumerable<Guid> projectIds) {
+      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if(!string.IsNullOrWhiteSpace(paramProjectIds)) {
+        string queryString = string.Format(GetByProjectIdsQueryString, paramProjectIds);
+        return DataContext.ExecuteQuery<Job>(queryString);
+      }
+      return Enumerable.Empty<Job>();
+    }
+
+    public IEnumerable<Job> GetByState(JobState state) {
+      return GetByStateQuery(DataContext, state);
+    }
+
+    public IEnumerable<Guid> GetJobIdsByState(JobState state) {
+      return GetJobIdsByStateQuery(DataContext, state);
+    }
+
+    public IEnumerable<Job> GetJobsReadyForDeletion() {
+      return GetJobsReadyForDeletionQuery(DataContext);
+    }
+
+
     #region Compiled queries
     private static readonly Func<DataContext, Guid, Job> GetByIdQuery =
@@ -38,4 +69,50 @@
          where job.JobId == jobId
          select job).SingleOrDefault());
+    private static readonly Func<DataContext, Guid, IEnumerable<Job>> GetByProjectIdQuery =
+      CompiledQuery.Compile((DataContext db, Guid projectId) =>
+        (from job in db.GetTable<Job>()
+         where job.ProjectId == projectId
+         select job));
+    private static readonly Func<DataContext, JobState, IEnumerable<Job>> GetByStateQuery =
+      CompiledQuery.Compile((DataContext db, JobState jobState) =>
+        (from job in db.GetTable<Job>()
+         where job.State == jobState
+         select job));
+    private static readonly Func<DataContext, JobState, IEnumerable<Guid>> GetJobIdsByStateQuery =
+      CompiledQuery.Compile((DataContext db, JobState jobState) =>
+        (from job in db.GetTable<Job>()
+         where job.State == jobState
+         select job.JobId));
+    private static readonly Func<DataContext, IEnumerable<Job>> GetJobsReadyForDeletionQuery =
+      CompiledQuery.Compile((DataContext db) =>
+        (from job in db.GetTable<Job>()
+         where job.State == JobState.StatisticsPending
+         && (from task in db.GetTable<Task>()
+             where task.JobId == job.JobId
+             select task.State == TaskState.Finished
+              || task.State == TaskState.Aborted
+              || task.State == TaskState.Failed).All(x => x)
+         select job));
+    #endregion
+
+    #region String queries
+    private const string DeleteByStateQueryString = @"
+      DELETE FROM [Job]
+      WHERE JobState = {0}
+    ";
+    private const string GetStatisticsPendingJobs = @"
+      SELECT DISTINCT j.*
+      FROM [Job] j
+      WHERE j.JobState = 'StatisticsPending'
+      AND 'Calculating' NOT IN (
+        SELECT t.TaskState 
+        FROM [Task] t 
+        WHERE t.JobId = j.JobId)
+    ";
+    private const string GetByProjectIdsQueryString = @"
+      SELECT DISTINCT j.*
+      FROM [Job] j
+      WHERE j.ProjectId IN ({0})
+    ";
     #endregion
   }
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs	(revision 16117)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs	(revision 16117)
@@ -0,0 +1,293 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2017 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.Data.Linq;
+using System.Linq;
+
+namespace HeuristicLab.Services.Hive.DataAccess.Daos {
+  public class ProjectDao : GenericDao<Guid, Project> {
+    public ProjectDao(DataContext dataContext) : base(dataContext) { }
+
+    public class ProjectStats {
+      public Guid ProjectId { get; set; }
+      public int Cores { get; set; }
+      public int Memory { get; set; }
+    }
+
+    public override Project GetById(Guid id) {
+      return GetByIdQuery(DataContext, id);
+    }
+
+    public void DeleteByIds(IEnumerable<Guid> ids) {
+      string paramProjectIds = string.Join(",", ids.ToList().Select(x => string.Format("'{0}'", x)));
+      if(!string.IsNullOrWhiteSpace(paramProjectIds)) {
+        string queryString = string.Format(DeleteByIdsQueryString, paramProjectIds);
+        DataContext.ExecuteCommand(queryString);
+      }
+    }
+
+    public IEnumerable<Project> GetUsageGrantedProjectsForUser(IEnumerable<Guid> userAndGroupIds) {
+      string paramUserAndGroupIds = string.Join(",", userAndGroupIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramUserAndGroupIds)) {
+        string queryString = string.Format(GetUsageGrantedProjectsForUserQueryString, paramUserAndGroupIds);
+        return DataContext.ExecuteQuery<Project>(queryString);
+      }
+      return Enumerable.Empty<Project>();
+    }
+
+    public IEnumerable<Project> GetAdministrationGrantedProjectsForUser(Guid userId) {
+      return DataContext.ExecuteQuery<Project>(GetAdministrationGrantedProjectsForUserQueryString, userId);
+    }
+
+    public IEnumerable<Project> GetChildProjectsById(Guid id) {
+      return DataContext.ExecuteQuery<Project>(GetChildProjectsByIdQuery, id);
+    }
+
+    public IEnumerable<Guid> GetChildProjectIdsById(Guid id) {
+      return DataContext.ExecuteQuery<Guid>(GetChildProjectIdsByIdQuery, id);
+    }
+
+    public IEnumerable<Project> GetParentProjectsById(Guid id) {
+      return DataContext.ExecuteQuery<Project>(GetParentProjectsByIdQuery, id);
+    }
+
+    public IEnumerable<Guid> GetParentProjectIdsById(Guid id) {
+      return DataContext.ExecuteQuery<Guid>(GetParentProjectIdsByIdQuery, id);
+    }
+
+    public IEnumerable<Project> GetCurrentAndParentProjectsById(Guid id) {
+      return DataContext.ExecuteQuery<Project>(GetCurrentAndParentProjectsByIdQuery, id);
+    }
+
+    public IEnumerable<Guid> GetCurrentAndParentProjectIdsById(Guid id) {
+      return DataContext.ExecuteQuery<Guid>(GetCurrentAndParentProjectIdsByIdQuery, id);
+    }
+
+    public IEnumerable<ProjectStats> GetUsageStatsPerProject() {
+      return DataContext.ExecuteQuery<ProjectStats>(GetUsageStatsPerProjectQueryString).ToList();
+    }
+
+    public IEnumerable<ProjectStats> GetAvailabilityStatsPerProject() {
+      return DataContext.ExecuteQuery<ProjectStats>(GetAvailabilityStatsPerProjectQueryString).ToList();
+    }
+
+    #region Compiled queries
+    private static readonly Func<DataContext, Guid, Project> GetByIdQuery =
+      CompiledQuery.Compile((DataContext db, Guid projectId) =>
+        (from project in db.GetTable<Project>()
+         where project.ProjectId == projectId
+         select project).SingleOrDefault());
+    #endregion
+
+    #region String queries
+    private const string DeleteByIdsQueryString = @"
+      DELETE FROM [Project]
+      WHERE ProjectId IN ({0})
+    ";
+
+    private const string GetUsageStatsPerProjectQueryString = @"
+      SELECT j.ProjectId, SUM(t.CoresNeeded) AS Cores, SUM(t.MemoryNeeded) AS Memory
+      FROM [Task] t, [Job] j
+      WHERE t.TaskState = 'Calculating'
+      AND t.JobId = j.JobId
+      GROUP BY j.ProjectId
+    ";
+
+    private const string GetAvailabilityStatsPerProjectQueryString = @"
+      WITH rtree AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      UNION ALL
+	      SELECT rt.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId
+      )
+      SELECT apr.ProjectId, SUM(res.Cores) AS Cores, SUM(res.Memory) AS Memory
+      FROM rtree, [AssignedProjectResource] apr, [Resource] res
+      WHERE rtree.ResourceId = res.ResourceId
+      AND res.ResourceType = 'Slave'
+      AND (res.SlaveState = 'Idle' OR SlaveState = 'Calculating')
+      AND rtree.ParentResourceId = apr.ResourceId
+      GROUP BY apr.ProjectId
+      UNION
+      SELECT apr.ProjectId, SUM(res.Cores) AS Cores, SUM(res.Memory) AS Memory
+      FROM [AssignedProjectResource] apr, [Resource] res
+      WHERE apr.ResourceId = res.ResourceId
+      AND res.ResourceType = 'Slave'
+      AND (res.SlaveState = 'Idle' OR SlaveState = 'Calculating')
+      GROUP BY apr.ProjectId
+    ";
+
+    private const string GetUsageGrantedProjectsForUserQueryString = @"
+      SELECT DISTINCT p.*
+      FROM [Project] p, [ProjectPermission] pp
+      WHERE p.ProjectId = pp.ProjectId
+      AND pp.GrantedUserId IN ({0})
+    ";
+
+    private const string GetAdministrationGrantedProjectsForUserQueryString = @"
+      WITH ptree AS
+      (
+	      SELECT ProjectId, ParentProjectId
+	      FROM [Project]
+	      UNION ALL
+	      SELECT pt.ProjectId, p.ParentProjectId
+	      FROM [Project] p
+	      JOIN ptree pt ON pt.ParentProjectId = p.ProjectId AND p.ParentProjectId <> p.ProjectId AND pt.ParentProjectId <> pt.ProjectId
+      )
+      SELECT DISTINCT parent.*
+      FROM [Project] parent
+      WHERE parent.OwnerUserId = {0}
+      UNION
+      SELECT DISTINCT child.* 
+      FROM ptree, [Project] parent, [Project] child
+      WHERE ptree.ParentProjectId = parent.ProjectId
+      AND ptree.ProjectId = child.ProjectId
+      AND parent.OwnerUserId = {0}
+    ";
+
+    private const string GetChildProjectsByIdQuery = @"
+    	WITH ptree AS
+      (
+	      SELECT ProjectId, ParentProjectId
+	      FROM [Project]
+	      UNION ALL
+	      SELECT pt.ProjectId, p.ParentProjectId
+	      FROM [Project] p
+	      JOIN ptree pt ON pt.ParentProjectId = p.ProjectId AND p.ParentProjectId <> p.ProjectId AND pt.ParentProjectId <> pt.ProjectId
+      )
+      SELECT DISTINCT pro.*
+      FROM ptree, [Project] pro
+      WHERE ptree.ParentProjectId = {0}
+	    AND ptree.ProjectId = pro.ProjectId
+    ";
+    private const string GetChildProjectIdsByIdQuery = @"
+      WITH ptree AS
+      (
+	      SELECT ProjectId, ParentProjectId
+	      FROM [Project]
+	      UNION ALL
+	      SELECT pt.ProjectId, r.ParentProjectId
+	      FROM [Project] r
+	      JOIN ptree pt ON pt.ParentProjectId = r.ProjectId AND r.ParentProjectId <> r.ProjectId AND pt.ParentProjectId <> pt.ProjectId
+      )
+      SELECT DISTINCT ptree.ProjectId
+      FROM ptree
+      WHERE ptree.ParentProjectId = {0}
+    ";
+    private const string GetParentProjectsByIdQuery = @"
+      WITH pbranch AS
+      (
+	      SELECT ProjectId, ParentProjectId
+        FROM [Project]
+	      UNION ALL
+	      SELECT pb.ProjectId, p.ParentProjectId
+	      FROM [Project] p
+	      JOIN pbranch pb ON pb.ParentProjectId = p.ProjectId AND p.ParentProjectId <> p.ProjectId AND pb.ParentProjectId <> pb.ProjectId
+      )
+      SELECT DISTINCT pro.*
+      FROM pbranch, [Project] pro
+      WHERE pbranch.ProjectId = {0}
+      AND pbranch.ParentProjectId = pro.ProjectId
+    ";
+    private const string GetParentProjectIdsByIdQuery = @"
+      WITH pbranch AS
+      (
+	      SELECT ProjectId, ParentProjectId
+        FROM [Project]
+	      UNION ALL
+	      SELECT pb.ProjectId, p.ParentProjectId
+	      FROM [Project] p
+	      JOIN pbranch pb ON pb.ParentProjectId = p.ProjectId AND p.ParentProjectId <> p.ProjectId AND pb.ParentProjectId <> pb.ProjectId
+      )
+      SELECT DISTINCT pbranch.ParentProjectId
+      FROM pbranch
+      WHERE pbranch.ProjectId = {0}
+    ";
+    private const string GetCurrentAndParentProjectsByIdQuery = @"
+      WITH pbranch AS
+      (
+	      SELECT ProjectId, ParentProjectId
+	      FROM Project
+	      WHERE ProjectId = {0}
+	      UNION ALL
+	      SELECT p.ProjectId, p.ParentProjectId
+	      FROM Project p
+	      JOIN pbranch pb ON pb.ParentProjectId = p.ProjectId
+      )
+      SELECT DISTINCT pro.*
+      FROM pbranch, Project pro
+      WHERE pbranch.ProjectId = pro.ProjectId
+    ";
+    private const string GetCurrentAndParentProjectIdsByIdQuery = @"
+      WITH pbranch AS
+      (
+	      SELECT ProjectId, ParentProjectId
+	      FROM Project
+	      WHERE ProjectId = {0}
+	      UNION ALL
+	      SELECT p.ProjectId, p.ParentProjectId
+	      FROM Project p
+	      JOIN pbranch pb ON pb.ParentProjectId = p.ProjectId
+      )
+      SELECT DISTINCT pbranch.ProjectId
+      FROM pbranch
+    ";
+    private const string GetNearestOwnedParentProjectByIdQuery = @"
+      WITH pbranch AS
+      (
+	      SELECT ProjectId, ParentProjectId, CAST(ProjectId AS NVARCHAR(MAX)) Path, 1 Distance
+	      FROM [Project]
+	      WHERE ProjectId = {0}
+	      UNION ALL
+	      SELECT pb.ProjectId, p.ParentProjectId, pb.Path + N', ' + CAST(pb.ProjectId AS NVARCHAR(MAX)), pb.Distance + 1
+	      FROM [Project] p
+	      JOIN pbranch pb ON pb.ParentProjectId = p.ProjectId AND p.ParentProjectId <> p.ProjectId AND pb.ParentProjectId <> pb.ProjectId
+      )
+      SELECT TOP(1) pro.*
+      FROM pbranch, [Project] pro
+      WHERE pbranch.ParentProjectId = pro.ProjectId
+      AND pro.OwnerUserId = {1}
+      ORDER BY pbranch.Distance
+    ";
+    private const string GetFarestOwnedParentProjectIdByIdQuery = @"
+      WITH pbranch AS
+      (
+	      SELECT ProjectId, ParentProjectId, CAST(ProjectId AS NVARCHAR(MAX)) Path, 1 Distance
+	      FROM [Project]
+	      WHERE ProjectId = {0}
+	      UNION ALL
+	      SELECT pb.ProjectId, p.ParentProjectId, pb.Path + N', ' + CAST(pb.ProjectId AS NVARCHAR(MAX)), pb.Distance + 1
+	      FROM [Project] p
+	      JOIN pbranch pb ON pb.ParentProjectId = p.ProjectId AND p.ParentProjectId <> p.ProjectId AND pb.ParentProjectId <> pb.ProjectId
+      )
+      SELECT TOP(1) pro.*
+      FROM pbranch, [Project] pro
+      WHERE pbranch.ParentProjectId = pro.ProjectId
+      AND pro.OwnerUserId = {1}
+      ORDER BY pbranch.Distance DESC
+    ";
+    #endregion
+  }
+}
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectPermissionDao.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectPermissionDao.cs	(revision 16117)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectPermissionDao.cs	(revision 16117)
@@ -0,0 +1,98 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Data.Linq;
+using System.Linq;
+
+namespace HeuristicLab.Services.Hive.DataAccess.Daos {
+  public class ProjectPermissionDao : GenericDao<Guid, ProjectPermission> {
+    public ProjectPermissionDao(DataContext dataContext) : base(dataContext) { }
+
+    public override ProjectPermission GetById(Guid id) {
+      throw new NotImplementedException();
+    }
+
+    public IEnumerable<ProjectPermission> GetByProjectId(Guid id) {
+      return GetByProjectIdGetByIdQuery(DataContext, id);
+    }
+
+    public bool CheckUserGrantedForProject(Guid projectId, IEnumerable<Guid> userAndGroupIds) {
+      string paramUserAndGroupIds = string.Join(",", userAndGroupIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if(!string.IsNullOrWhiteSpace(paramUserAndGroupIds)) {
+        string queryString = string.Format(CheckUserGrantedForProjectQueryString, projectId, paramUserAndGroupIds);
+        return DataContext.ExecuteQuery<int>(queryString).First() > 0;
+      }
+      return false;
+    }
+
+    public void DeleteByProjectIdAndGrantedUserIds(Guid projectId, IEnumerable<Guid> grantedUserIds) {
+      string paramIds = string.Join(",", grantedUserIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramIds)) {
+        string query = string.Format(DeleteByProjectIdAndGrantedUserIdsQueryString, projectId, paramIds);
+        DataContext.ExecuteCommand(query);
+      }
+    }
+
+    public void DeleteByProjectIdsAndGrantedUserIds(IEnumerable<Guid> projectIds, IEnumerable<Guid> grantedUserIds) {
+      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
+      string paramUserIds = string.Join(",", grantedUserIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramProjectIds) && !string.IsNullOrWhiteSpace(paramUserIds)) {
+        string query = string.Format(DeleteByProjectIdsAndGrantedUserIdsQueryString, paramProjectIds, paramUserIds);
+        DataContext.ExecuteCommand(query);
+      }
+    }
+
+    #region Compiled queries
+    private static readonly Func<DataContext, Guid, IEnumerable<ProjectPermission>> GetByProjectIdGetByIdQuery =
+      CompiledQuery.Compile((DataContext db, Guid projectId) =>
+        from projectPermission in db.GetTable<ProjectPermission>()
+        where projectPermission.ProjectId == projectId
+        select projectPermission);
+    #endregion
+
+    #region String queries
+    private const string DeleteByProjectIdAndGrantedUserIdsQueryString = @"
+      DELETE FROM [ProjectPermission]
+      WHERE ProjectId = '{0}'
+      AND GrantedUserId IN ({1});
+    ";
+    private const string DeleteByProjectIdsAndGrantedUserIdsQueryString = @"
+      DELETE FROM [ProjectPermission]
+      WHERE ProjectId IN ({0})
+      AND GrantedUserId IN ({1});
+    ";
+    private const string CheckUserGrantedForProjectQueryString = @"
+      SELECT COUNT(pp.ProjectId)
+      FROM [ProjectPermission] pp
+      WHERE pp.ProjectId = '{0}'
+      AND pp.GrantedUserId IN ({1})
+    ";
+    private const string GetGrantedProjectsForUserQueryString = @"
+      SELECT DISTINCT p.*
+      FROM [ProjectPermission] pp, [Project] p
+      WHERE pp.GrantedUserId IN ({0})
+      AND  pp.ProjectId = p.ProjectId
+    ";
+    #endregion
+  }
+}
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs	(revision 16117)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Collections.Generic;
 using System.Data.Linq;
 using System.Linq;
@@ -36,6 +37,47 @@
     }
 
+    public void DeleteByIds(IEnumerable<Guid> ids) {
+      string paramResourceIds = string.Join(",", ids.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramResourceIds)) {
+        string queryString = string.Format(DeleteByIdsQueryString, paramResourceIds);
+        DataContext.ExecuteCommand(queryString);
+      }
+    }
+
+    public bool CheckExistence(IEnumerable<Guid> ids) {
+      string paramResourceIds = string.Join(",", ids.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramResourceIds)) {
+        string queryString = string.Format(CountExistenceQuery, paramResourceIds);
+        return DataContext.ExecuteQuery<int>(queryString).SingleOrDefault() == ids.Count();
+      }
+      return false;
+    }
+
     public IQueryable<Resource> GetResourcesWithValidOwner() {
       return Table.Where(x => x.OwnerUserId != null);
+    }
+
+    public IEnumerable<Resource> GetChildResourcesById(Guid id) {
+      return DataContext.ExecuteQuery<Resource>(GetChildResourcesByIdQuery, id);
+    }
+
+    public IEnumerable<Guid> GetChildResourceIdsById(Guid id) {
+      return DataContext.ExecuteQuery<Guid>(GetChildResourceIdsByIdQuery, id);
+    }
+
+    public IEnumerable<Resource> GetParentResourcesById(Guid id) {
+      return DataContext.ExecuteQuery<Resource>(GetParentResourcesByIdQuery, id);
+    }
+
+    public IEnumerable<Guid> GetParentResourceIdsById(Guid id) {
+      return DataContext.ExecuteQuery<Guid>(GetParentResourceIdsByIdQuery, id);
+    }
+
+    public IEnumerable<Resource> GetCurrentAndParentResourcesById(Guid id) {
+      return DataContext.ExecuteQuery<Resource>(GetCurrentAndParentResourcesByIdQuery, id);
+    }
+
+    public IEnumerable<Guid> GetCurrentAndParentResourceIdsById(Guid id) {
+      return DataContext.ExecuteQuery<Guid>(GetCurrentAndParentResourceIdsByIdQuery, id);
     }
 
@@ -53,4 +95,103 @@
         select resource).FirstOrDefault());
     #endregion
+
+    #region String queries
+    private const string DeleteByIdsQueryString = @"
+      DELETE FROM [Resource]
+      WHERE ResourceId IN ({0})
+    ";
+    private const string CountExistenceQuery = @"
+      SELECT COUNT(DISTINCT r.ResourceId)
+      FROM [Resource] r
+      WHERE r.ResourceId IN ({0})
+    ";
+    private const string GetChildResourcesByIdQuery = @"
+    	WITH rtree AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      UNION ALL
+	      SELECT rt.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rt.ParentResourceId <> rt.ResourceId
+      )
+      SELECT DISTINCT res.*
+      FROM rtree, [Resource] res
+      WHERE rtree.ParentResourceId = {0}
+	    AND rtree.ResourceId = res.ResourceId
+    ";
+    private const string GetChildResourceIdsByIdQuery = @"
+      WITH rtree AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      UNION ALL
+	      SELECT rt.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rt.ParentResourceId <> rt.ResourceId
+      )
+      SELECT DISTINCT rtree.ResourceId
+      FROM rtree
+      WHERE rtree.ParentResourceId = {0}
+    ";
+    private const string GetParentResourcesByIdQuery = @"
+      WITH rbranch AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      UNION ALL
+	      SELECT rb.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rb.ParentResourceId <> rb.ResourceId
+      )
+      SELECT DISTINCT res.*
+      FROM rbranch, [Resource] res
+      WHERE rbranch.ResourceId = {0}
+      AND rbranch.ParentResourceId = res.ResourceId
+    ";
+    private const string GetParentResourceIdsByIdQuery = @"
+      WITH rbranch AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      UNION ALL
+	      SELECT rb.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rb.ParentResourceId <> rb.ResourceId
+      )
+      SELECT DISTINCT rbranch.ParentResourceId
+      FROM rbranch
+      WHERE rbranch.ResourceId = {0}
+    ";
+    private const string GetCurrentAndParentResourcesByIdQuery = @"
+      WITH rbranch AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      WHERE ResourceId = {0}
+	      UNION ALL
+	      SELECT r.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId
+      )
+      SELECT DISTINCT res.*
+      FROM rbranch, [Resource] res
+      WHERE rbranch.ResourceId = res.ResourceId
+    ";
+    private const string GetCurrentAndParentResourceIdsByIdQuery = @"
+      WITH rbranch AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      WHERE ResourceId = {0}
+	      UNION ALL
+	      SELECT r.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId
+      )
+      SELECT DISTINCT rbranch.ResourceId
+      FROM rbranch
+    ";
+    #endregion
   }
 }
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourcePermissionDao.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourcePermissionDao.cs	(revision 15682)
+++ 	(revision )
@@ -1,62 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2018 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.Data.Linq;
-using System.Linq;
-
-namespace HeuristicLab.Services.Hive.DataAccess.Daos {
-  public class ResourcePermissionDao : GenericDao<Guid, ResourcePermission> {
-    public ResourcePermissionDao(DataContext dataContext) : base(dataContext) { }
-
-    public override ResourcePermission GetById(Guid id) {
-      throw new NotImplementedException();
-    }
-
-    public IEnumerable<ResourcePermission> GetByResourceId(Guid id) {
-      return GetByResourceIdGetByIdQuery(DataContext, id);
-    }
-
-    public void DeleteByResourceAndGrantedUserId(Guid resourceId, IEnumerable<Guid> grantedUserId) {
-      string paramIds = string.Join(",", grantedUserId.Select(x => string.Format("'{0}'", x)));
-      if (!string.IsNullOrWhiteSpace(paramIds)) {
-        string query = string.Format(DeleteByGrantedUserQuery, resourceId, paramIds);
-        DataContext.ExecuteCommand(query);
-      }
-    }
-
-    #region Compiled queries
-    private static readonly Func<DataContext, Guid, IEnumerable<ResourcePermission>> GetByResourceIdGetByIdQuery =
-      CompiledQuery.Compile((DataContext db, Guid resourceId) =>
-        from resourcePermission in db.GetTable<ResourcePermission>()
-        where resourcePermission.ResourceId == resourceId
-        select resourcePermission);
-    #endregion
-
-    #region String queries
-    private const string DeleteByGrantedUserQuery =
-      @"DELETE FROM [ResourcePermission]
-         WHERE ResourceId = '{0}'
-           AND GrantedUserId IN ({1});";
-    #endregion
-  }
-}
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/TaskDao.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/TaskDao.cs	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/TaskDao.cs	(revision 16117)
@@ -27,8 +27,4 @@
 namespace HeuristicLab.Services.Hive.DataAccess.Daos {
   public class TaskDao : GenericDao<Guid, Task> {
-    private Table<AssignedResource> AssignedResourceTable {
-      get { return DataContext.GetTable<AssignedResource>(); }
-    }
-
     public TaskDao(DataContext dataContext) : base(dataContext) { }
 
@@ -54,5 +50,9 @@
       //Because there is at the moment no case where this makes sense (there don't exist parent tasks which need to be calculated), 
       //we skip this step because it's wasted runtime
-      return DataContext.ExecuteQuery<TaskPriorityInfo>(GetWaitingTasksQueryString, slave.ResourceId, Enum.GetName(typeof(TaskState), TaskState.Waiting), slave.FreeCores, slave.FreeMemory).ToList();
+      return DataContext.ExecuteQuery<TaskPriorityInfo>(GetWaitingTasksQueryString, 
+        slave.ResourceId, 
+        Enum.GetName(typeof(TaskState), TaskState.Waiting), 
+        slave.FreeCores, 
+        slave.FreeMemory).ToList();
     }
 
@@ -62,22 +62,19 @@
     /// <param name="resourceIds">list of resourceids which for which the task should be valid</param>
     /// <param name="count">maximum number of task to return</param>
-    /// <param name="finished">if true, all parent task which have FinishWhenChildJobsFinished=true are returned, otherwise only FinishWhenChildJobsFinished=false are returned</param>
+    /// <param name="finished">if true, all parent tasks which have FinishWhenChildJobsFinished=true are returned, otherwise only FinishWhenChildJobsFinished=false are returned</param>
     /// <returns></returns>
     public IEnumerable<Task> GetParentTasks(IEnumerable<Guid> resourceIds, int count, bool finished) {
-      var query = from ar in AssignedResourceTable
-                  where resourceIds.Contains(ar.ResourceId)
-                     && ar.Task.State == TaskState.Waiting
-                     && ar.Task.IsParentTask
-                     && (finished ? ar.Task.FinishWhenChildJobsFinished : !ar.Task.FinishWhenChildJobsFinished)
-                     && (from child in Table
-                         where child.ParentTaskId == ar.Task.TaskId
-                         select child.State == TaskState.Finished
-                             || child.State == TaskState.Aborted
-                             || child.State == TaskState.Failed).All(x => x)
-                     && (from child in Table // avoid returning WaitForChildTasks task where no child-task exist (yet)
-                         where child.ParentTaskId == ar.Task.TaskId
-                         select child).Any()
-                  orderby ar.Task.Priority descending
-                  select ar.Task;
+    var query = from t in Table
+                where t.State == TaskState.Waiting
+                    && t.IsParentTask
+                    && t.Job.AssignedJobResources.All(x => resourceIds.ToList().Contains(x.ResourceId))
+                    && t.FinishWhenChildJobsFinished == finished
+                    && t.ChildJobs.Any()
+                    && t.ChildJobs.All(x =>
+                      x.State == TaskState.Finished
+                      || x.State == TaskState.Aborted
+                      || x.State == TaskState.Failed)
+                  orderby t.Priority descending
+                  select t;
       return count == 0 ? query.ToArray() : query.Take(count).ToArray();
     }
@@ -96,6 +93,14 @@
 
     #region String queries
+    private const string GetCalculatingChildTasksByProjectId = @"
+      SELECT t.* FROM [Task] t, [Job] j
+        WHERE t.IsParentTask = 0
+        AND t.TaskState = 'Calculating'
+        AND t.JobId = j.JobId
+        AND j.ProjectId = {0}
+        ORDER BY j.ProjectId
+    ";
     private const string GetWaitingTasksQueryString = @"
-      WITH pr AS (
+      WITH rbranch AS (
         SELECT ResourceId, ParentResourceId
         FROM [Resource]
@@ -103,13 +108,17 @@
         UNION ALL
         SELECT r.ResourceId, r.ParentResourceId
-        FROM [Resource] r JOIN pr ON r.ResourceId = pr.ParentResourceId
+        FROM [Resource] r
+        JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId
       )
       SELECT DISTINCT t.TaskId, t.JobId, t.Priority
-      FROM pr JOIN AssignedResources ar ON ar.ResourceId = pr.ResourceId
-          JOIN Task t ON t.TaskId = ar.TaskId
+      FROM [Task] t, [Job] j, [AssignedJobResource] ajr, rbranch
       WHERE NOT (t.IsParentTask = 1 AND t.FinishWhenChildJobsFinished = 1)
-          AND t.TaskState = {1}
-          AND t.CoresNeeded <= {2}
-          AND t.MemoryNeeded <= {3}
+      AND t.TaskState = {1}
+      AND t.CoresNeeded <= {2}
+      AND t.MemoryNeeded <= {3}
+      AND t.JobId = j.JobId
+      AND j.JobState = 'Online'
+      AND j.JobId = ajr.JobId
+      AND ajr.ResourceId = rbranch.ResourceId
     ";
 
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Enums/JobState.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Enums/JobState.cs	(revision 16117)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Enums/JobState.cs	(revision 16117)
@@ -0,0 +1,45 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Services.Hive.DataAccess {
+  [Serializable]
+  public enum JobState {
+    /// <summary>
+    /// A job is online as long as he is no other state.
+    /// </summary>
+    Online,
+
+    /// <summary>
+    /// A job is in StatisticsPending if its deletion has been requested,
+    /// but the final generation of statistics hasn't been performed yet.
+    /// </summary>
+    StatisticsPending,
+
+    /// <summary>
+    /// A job is in DeletionPending if its deletion has been requested,
+    /// the final generation of statistics has already been performed,
+    /// but the eventual deletion of the job is still pending. 
+    /// </summary>
+    DeletionPending
+  };
+}
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 16117)
@@ -104,12 +104,15 @@
   <ItemGroup>
     <None Include="Plugin.cs.frame" />
-    <Compile Include="Daos\AssignedResourceDao.cs" />
+    <Compile Include="Daos\AssignedJobResourceDao.cs" />
+    <Compile Include="Daos\AssignedProjectResourceDao.cs" />
     <Compile Include="Daos\DowntimeDao.cs" />
     <Compile Include="Daos\GenericDao.cs" />
     <Compile Include="Daos\HiveStatistics\DimClientDao.cs" />
     <Compile Include="Daos\HiveStatistics\DimJobDao.cs" />
+    <Compile Include="Daos\HiveStatistics\DimProjectDao.cs" />
     <Compile Include="Daos\HiveStatistics\DimTimeDao.cs" />
     <Compile Include="Daos\HiveStatistics\DimUserDao.cs" />
     <Compile Include="Daos\HiveStatistics\FactClientInfoDao.cs" />
+    <Compile Include="Daos\HiveStatistics\FactProjectInfoDao.cs" />
     <Compile Include="Daos\HiveStatistics\FactTaskDao.cs" />
     <Compile Include="Daos\JobDao.cs" />
@@ -118,7 +121,8 @@
     <Compile Include="Daos\PluginDao.cs" />
     <Compile Include="Daos\PluginDataDao.cs" />
+    <Compile Include="Daos\ProjectDao.cs" />
+    <Compile Include="Daos\ProjectPermissionDao.cs" />
     <Compile Include="Daos\RequiredPluginDao.cs" />
     <Compile Include="Daos\ResourceDao.cs" />
-    <Compile Include="Daos\ResourcePermissionDao.cs" />
     <Compile Include="Daos\SlaveDao.cs" />
     <Compile Include="Daos\SlaveGroupDao.cs" />
@@ -128,4 +132,5 @@
     <Compile Include="Daos\UserPriorityDao.cs" />
     <Compile Include="Data\TableInformation.cs" />
+    <Compile Include="Enums\JobState.cs" />
     <Compile Include="Interfaces\IGenericDao.cs" />
     <Compile Include="Enums\Command.cs" />
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml	(revision 16117)
@@ -1,10 +1,9 @@
 ﻿<?xml version="1.0" encoding="utf-8"?><Database Name="HeuristicLab.Hive" Class="HiveDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
-  <Connection Mode="AppSettings" ConnectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.3" SettingsObjectName="HeuristicLab.Services.Hive.DataAccess.Settings" SettingsPropertyName="HeuristicLab_Hive_LinqConnectionString" Provider="System.Data.SqlClient" />
-  <Table Name="dbo.AssignedResources" Member="AssignedResources">
-    <Type Name="AssignedResource">
+  <Table Name="dbo.AssignedProjectResource" Member="AssignedProjectResources">
+    <Type Name="AssignedProjectResource">
       <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="TaskId" Storage="_JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
-      <Association Name="Task_AssignedResource" Member="Task" Storage="_Job" ThisKey="TaskId" OtherKey="TaskId" Type="Task" IsForeignKey="true" DeleteRule="CASCADE" />
+      <Column Name="ProjectId" Storage="_JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Association Name="Resource_AssignedProjectResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
+      <Association Name="Project_AssignedProjectResource" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" DeleteRule="CASCADE" />
     </Type>
   </Table>
@@ -38,9 +37,9 @@
       <Column Name="HbInterval" Type="System.Int32" DbType="Int" CanBeNull="false" />
       <Column Name="OwnerUserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
-      <Association Name="Resource_AssignedResource" Member="AssignedResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedResource" />
+      <Association Name="Resource_AssignedProjectResource" Member="AssignedProjectResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedProjectResource" />
       <Association Name="Resource_Resource" Member="ChildResources" ThisKey="ResourceId" OtherKey="ParentResourceId" Type="Resource" />
       <Association Name="Resource_Downtime" Member="Downtimes" Storage="_UptimeCalendars" ThisKey="ResourceId" OtherKey="ResourceId" Type="Downtime" />
       <Association Name="Resource_StateLog" Member="StateLogs" ThisKey="ResourceId" OtherKey="SlaveId" Type="StateLog" />
-      <Association Name="Resource_ResourcePermission" Member="ResourcePermissions" ThisKey="ResourceId" OtherKey="ResourceId" Type="ResourcePermission" />
+      <Association Name="Resource_AssignedJobResource" Member="AssignedJobResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedJobResource" />
       <Association Name="Resource_Resource" Member="ParentResource" ThisKey="ParentResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
       <Type Name="Slave" InheritanceCode="Slave" IsInheritanceDefault="true">
@@ -76,5 +75,4 @@
       <Column Name="Command" Type="global::HeuristicLab.Services.Hive.DataAccess.Command?" DbType="VarChar(30)" CanBeNull="true" />
       <Column Name="JobId" Storage="_HiveExperimentId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
-      <Association Name="Task_AssignedResource" Member="AssignedResources" ThisKey="TaskId" OtherKey="TaskId" Type="AssignedResource" />
       <Association Name="Task_RequiredPlugin" Member="RequiredPlugins" ThisKey="TaskId" OtherKey="TaskId" Type="RequiredPlugin" />
       <Association Name="Task_Task" Member="ChildJobs" Storage="_Jobs" ThisKey="TaskId" OtherKey="ParentTaskId" Type="Task" />
@@ -103,9 +101,12 @@
       <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
       <Column Name="Description" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
-      <Column Name="ResourceIds" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
       <Column Name="OwnerUserId" Storage="_UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
       <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
+      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
+      <Column Name="JobState" Member="State" Type="global::HeuristicLab.Services.Hive.DataAccess.JobState" DbType="VarChar(30)" CanBeNull="false" />
       <Association Name="Job_Task" Member="Tasks" Storage="_Jobs" ThisKey="JobId" OtherKey="JobId" Type="Task" />
       <Association Name="Job_JobPermission" Member="JobPermissions" Storage="_HiveExperimentPermissions" ThisKey="JobId" OtherKey="JobId" Type="JobPermission" />
+      <Association Name="Job_AssignedJobResource" Member="AssignedJobResources" ThisKey="JobId" OtherKey="JobId" Type="AssignedJobResource" />
+      <Association Name="Project_Job" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" />
     </Type>
   </Table>
@@ -155,12 +156,4 @@
     </Type>
   </Table>
-  <Table Name="dbo.ResourcePermission" Member="ResourcePermissions">
-    <Type Name="ResourcePermission">
-      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="GrantedUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="GrantedByUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
-      <Association Name="Resource_ResourcePermission" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
-    </Type>
-  </Table>
   <Table Name="" Member="UserPriorities">
     <Type Name="UserPriority">
@@ -174,9 +167,8 @@
       <Column Name="Name" Type="System.String" DbType="VarChar(MAX) NOT NULL" CanBeNull="false" />
       <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
-      <Column Name="ExpirationTime" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
-      <Column Name="ResourceGroupId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
-      <Column Name="ResourceGroup2Id" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
-      <Column Name="GroupName" Type="System.String" CanBeNull="true" />
-      <Column Name="GroupName2" Type="System.String" CanBeNull="true" />
+      <Column Name="ParentResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
+      <Column Name="ResourceType" Type="System.String" CanBeNull="false" />
+      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
+      <Column Name="DateExpired" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
       <Association Name="DimClient_FactTask" Member="FactTasks" ThisKey="Id" OtherKey="LastClientId" Type="FactTask" />
       <Association Name="DimClient_FactClientInfo" Member="FactClientInfos" ThisKey="Id" OtherKey="ClientId" Type="FactClientInfo" />
@@ -215,5 +207,7 @@
       <Column Name="CompletedTasks" Type="System.Int32" DbType="INT NOT NULL" CanBeNull="false" />
       <Column Name="DateCompleted" Type="System.DateTime" DbType="DateTime NULL" CanBeNull="true" />
+      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
       <Association Name="DimJob_FactTask" Member="FactTasks" ThisKey="JobId" OtherKey="JobId" Type="FactTask" />
+      <Association Name="DimProject_DimJob" Member="DimProject" ThisKey="ProjectId" OtherKey="Id" Type="DimProject" IsForeignKey="true" />
     </Type>
   </Table>
@@ -227,4 +221,5 @@
       <Column Name="Minute" Type="System.DateTime" CanBeNull="false" />
       <Association Name="DimTime_FactClientInfo" Member="FactClientInfos" ThisKey="Time" OtherKey="Time" Type="FactClientInfo" />
+      <Association Name="DimTime_FactProjectInfo" Member="FactProjectInfos" ThisKey="Time" OtherKey="Time" Type="FactProjectInfo" />
     </Type>
   </Table>
@@ -240,5 +235,5 @@
       <Column Name="ClientId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
       <Column Name="Time" Type="System.DateTime" DbType="DateTime NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
       <Column Name="NumUsedCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
       <Column Name="NumTotalCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
@@ -256,3 +251,64 @@
     </Type>
   </Table>
+  <Table Name="dbo.Project" Member="Projects">
+    <Type Name="Project">
+      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+      <Column Name="ParentProjectId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
+      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
+      <Column Name="Name" Type="System.String" DbType="VarChar(MAX) NOT NULL" CanBeNull="false" />
+      <Column Name="Description" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
+      <Column Name="OwnerUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
+      <Column Name="StartDate" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
+      <Column Name="EndDate" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
+      <Association Name="Project_AssignedProjectResource" Member="AssignedProjectResources" ThisKey="ProjectId" OtherKey="ProjectId" Type="AssignedProjectResource" />
+      <Association Name="Project_Job" Member="Jobs" ThisKey="ProjectId" OtherKey="ProjectId" Type="Job" />
+      <Association Name="Project_Project" Member="ChildProjects" Storage="_Projects" ThisKey="ProjectId" OtherKey="ParentProjectId" Type="Project" />
+      <Association Name="Project_ProjectPermission" Member="ProjectPermissions" ThisKey="ProjectId" OtherKey="ProjectId" Type="ProjectPermission" />
+      <Association Name="Project_Project" Member="ParentProject" Storage="_Project1" ThisKey="ParentProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" />
+    </Type>
+  </Table>
+  <Table Name="dbo.ProjectPermission" Member="ProjectPermissions">
+    <Type Name="ProjectPermission">
+      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="GrantedUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="GrantedByUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
+      <Association Name="Project_ProjectPermission" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" />
+    </Type>
+  </Table>
+  <Table Name="dbo.AssignedJobResource" Member="AssignedJobResources">
+    <Type Name="AssignedJobResource">
+      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Association Name="Resource_AssignedJobResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
+      <Association Name="Job_AssignedJobResource" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
+    </Type>
+  </Table>
+  <Table Name="[statistics].FactProjectInfo" Member="FactProjectInfos">
+    <Type Name="FactProjectInfo">
+      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="Time" Type="System.DateTime" DbType="DateTime NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="NumTotalCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Column Name="NumUsedCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Column Name="TotalMemory" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Column Name="UsedMemory" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Association Name="DimProject_FactProjectInfo" Member="DimProject" ThisKey="ProjectId" OtherKey="Id" Type="DimProject" IsForeignKey="true" />
+      <Association Name="DimTime_FactProjectInfo" Member="DimTime" ThisKey="Time" OtherKey="Time" Type="DimTime" IsForeignKey="true" />
+    </Type>
+  </Table>
+  <Table Name="[statistics].DimProject" Member="DimProjects">
+    <Type Name="DimProject">
+      <Column Name="Id" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
+      <Column Name="ParentProjectId" Storage="_ParentId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
+      <Column Name="Name" Type="System.String" CanBeNull="false" />
+      <Column Name="Description" Type="System.String" CanBeNull="true" />
+      <Column Name="OwnerUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
+      <Column Name="StartDate" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
+      <Column Name="EndDate" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
+      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
+      <Column Name="DateExpired" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
+      <Association Name="DimProject_DimJob" Member="DimJobs" ThisKey="Id" OtherKey="ProjectId" Type="DimJob" />
+      <Association Name="DimProject_FactProjectInfo" Member="FactProjectInfos" ThisKey="Id" OtherKey="ProjectId" Type="FactProjectInfo" />
+    </Type>
+  </Table>
 </Database>
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout	(revision 16117)
@@ -1,10 +1,10 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
-<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 15.75, 17.875" name="HiveDataContext">
+<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 16.25, 23.875" name="HiveDataContext">
   <DataContextMoniker Name="/HiveDataContext" />
   <nestedChildShapes>
-    <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="8.875, 4.5, 2, 1.1939925130208327">
-      <DataClassMoniker Name="/HiveDataContext/AssignedResource" />
-      <nestedChildShapes>
-        <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="8.89, 4.9600000000000009, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+    <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="13.875, 8.25, 2, 1.1939925130208327">
+      <DataClassMoniker Name="/HiveDataContext/AssignedProjectResource" />
+      <nestedChildShapes>
+        <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="13.89, 8.71, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
@@ -39,8 +39,8 @@
       </nestedChildShapes>
     </classShape>
-    <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 1.9631982421874996">
+    <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 2.1554996744791666">
       <DataClassMoniker Name="/HiveDataContext/Job" />
       <nestedChildShapes>
-        <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
@@ -69,11 +69,4 @@
       </nodes>
     </inheritanceConnector>
-    <associationConnector edgePoints="[(11.8134963640734 : 2.9631982421875); (11.8134963640734 : 3.56770833333333); (11.1119791666667 : 3.56770833333333); (11.1119791666667 : 5.09699625651042); (10.875 : 5.09699625651042)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedResource" />
-      <nodes>
-        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
-        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
-      </nodes>
-    </associationConnector>
     <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds="4.125, 1, 2, 1.3862939453125">
       <DataClassMoniker Name="/HiveDataContext/TaskData" />
@@ -141,12 +134,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(8.5 : 4.1170068359375); (8.875 : 4.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Task/Task_AssignedResource" />
-      <nodes>
-        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
-        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(7.4687475 : 4.1170068359375); (7.4687475 : 5.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(7.5 : 4.1170068359375); (7.5 : 5.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Task/Task_RequiredPlugin" />
       <nodes>
@@ -183,5 +169,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(4.125 : 4.10659912109375); (3.75 : 4.10659912109375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(4.125 : 4.20274983723958); (3.75 : 4.20274983723958)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_JobPermission" />
       <nodes>
@@ -190,17 +176,4 @@
       </nodes>
     </associationConnector>
-    <classShape Id="a3f352be-9f15-4e73-8d44-3e8ac02fb4cf" absoluteBounds="11.25, 3.875, 2, 1.3862939453124996">
-      <DataClassMoniker Name="/HiveDataContext/ResourcePermission" />
-      <nestedChildShapes>
-        <elementListCompartment Id="45e2f1a8-8a1e-4647-b649-10ec55976ab4" absoluteBounds="11.265, 4.335, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <associationConnector edgePoints="[(12.5942481820367 : 2.9631982421875); (12.5942481820367 : 3.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_ResourcePermission" />
-      <nodes>
-        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
-        <classShapeMoniker Id="a3f352be-9f15-4e73-8d44-3e8ac02fb4cf" />
-      </nodes>
-    </associationConnector>
     <classShape Id="f9e8867f-fd15-4a72-8ca4-4f02cd3f141f" absoluteBounds="4.125, 5.5, 2, 1.1939925130208327">
       <DataClassMoniker Name="/HiveDataContext/UserPriority" />
@@ -209,41 +182,41 @@
       </nestedChildShapes>
     </classShape>
-    <classShape Id="b5b919c2-4efc-4f09-8f52-9d541a11e961" absoluteBounds="4.625, 15.25, 2, 2.3478011067708344">
+    <classShape Id="b5b919c2-4efc-4f09-8f52-9d541a11e961" absoluteBounds="5.5, 12.25, 2, 2.1554996744791666">
       <DataClassMoniker Name="/HiveDataContext/DimClient" />
       <nestedChildShapes>
-        <elementListCompartment Id="30f62a7b-0b16-404e-b972-fb12bfe978dd" absoluteBounds="4.6400000000000006, 15.71, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="04f52807-ce17-4d65-bd23-cc38c6dfbd7a" absoluteBounds="6.875, 11.25, 2, 3.8862125651041666">
+        <elementListCompartment Id="30f62a7b-0b16-404e-b972-fb12bfe978dd" absoluteBounds="5.5150000000000006, 12.71, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="04f52807-ce17-4d65-bd23-cc38c6dfbd7a" absoluteBounds="8.25, 12.25, 2, 3.8862125651041666">
       <DataClassMoniker Name="/HiveDataContext/FactTask" />
       <nestedChildShapes>
-        <elementListCompartment Id="63e3ddcb-a6fe-48e0-a674-e650a55a9f2c" absoluteBounds="6.8900000000000006, 11.71, 1.9700000000000002, 3.3262125651041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="e0cb8641-a75e-4b9f-beda-3218c56938b1" absoluteBounds="8.125, 8.25, 2, 2.3478011067708344">
+        <elementListCompartment Id="63e3ddcb-a6fe-48e0-a674-e650a55a9f2c" absoluteBounds="8.265, 12.71, 1.9700000000000002, 3.3262125651041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="e0cb8641-a75e-4b9f-beda-3218c56938b1" absoluteBounds="11.125, 12.25, 2, 2.5401025390625005">
       <DataClassMoniker Name="/HiveDataContext/DimJob" />
       <nestedChildShapes>
-        <elementListCompartment Id="6b9e8260-7e4b-4357-9c26-eebebfd69504" absoluteBounds="8.14, 8.71, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="a769f2ac-c8e3-4860-baa5-c46f46c38ed8" absoluteBounds="3.625, 8.5, 2, 1.9631982421875005">
+        <elementListCompartment Id="6b9e8260-7e4b-4357-9c26-eebebfd69504" absoluteBounds="11.14, 12.71, 1.9700000000000002, 1.9801025390625" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="a769f2ac-c8e3-4860-baa5-c46f46c38ed8" absoluteBounds="10, 21.625, 2, 1.9631982421875005">
       <DataClassMoniker Name="/HiveDataContext/DimTime" />
       <nestedChildShapes>
-        <elementListCompartment Id="694c4a5a-20fb-43a9-bc9a-7b59d794a7fb" absoluteBounds="3.6399999999999997, 8.96, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="66c34ced-4fdb-4a1d-b8dd-fe094679b7fb" absoluteBounds="0.625, 8.875, 2, 1.1939925130208344">
+        <elementListCompartment Id="694c4a5a-20fb-43a9-bc9a-7b59d794a7fb" absoluteBounds="10.015, 22.085, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="66c34ced-4fdb-4a1d-b8dd-fe094679b7fb" absoluteBounds="4.125, 21.625, 2, 1.1939925130208344">
       <DataClassMoniker Name="/HiveDataContext/DimUser" />
       <nestedChildShapes>
-        <elementListCompartment Id="6181c560-fc74-4d43-b064-a90032bf17a5" absoluteBounds="0.64000000000000012, 9.335, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="053a5cff-b18a-4ee5-8d43-48ed5c5dcfad" absoluteBounds="2.625, 11, 2, 3.3093082682291666">
+        <elementListCompartment Id="6181c560-fc74-4d43-b064-a90032bf17a5" absoluteBounds="4.1400000000000006, 22.085, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="053a5cff-b18a-4ee5-8d43-48ed5c5dcfad" absoluteBounds="5.5, 17, 2, 3.3093082682291666">
       <DataClassMoniker Name="/HiveDataContext/FactClientInfo" />
       <nestedChildShapes>
-        <elementListCompartment Id="0a1cc913-6636-455c-95b3-302f533527db" absoluteBounds="2.6399999999999997, 11.46, 1.9700000000000002, 2.7493082682291665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <associationConnector edgePoints="[(6.625 : 15.25); (6.875 : 15.1362125651042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+        <elementListCompartment Id="0a1cc913-6636-455c-95b3-302f533527db" absoluteBounds="5.515, 17.46, 1.9700000000000002, 2.7493082682291665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <associationConnector edgePoints="[(7.5 : 13.3277498372396); (8.25 : 13.3277498372396)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/DimClient/DimClient_FactTask" />
       <nodes>
@@ -252,5 +225,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(8.5 : 10.5978011067708); (8.5 : 11.25)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(11.125 : 13.5200512695313); (10.25 : 13.5200512695313)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/DimJob/DimJob_FactTask" />
       <nodes>
@@ -259,5 +232,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(5.6249975 : 15.25); (5.6249975 : 12.6546541341146); (4.625 : 12.6546541341146)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(6.5 : 14.4054996744792); (6.5 : 17)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/DimClient/DimClient_FactClientInfo" />
       <nodes>
@@ -266,5 +239,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(4.125 : 10.4631982421875); (4.125 : 11)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(11 : 21.625); (11 : 18.6546541341146); (7.5 : 18.6546541341146)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactClientInfo" />
       <nodes>
@@ -273,5 +246,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(1.59375 : 10.0689925130208); (1.59375 : 12.6546541341146); (2.625 : 12.6546541341146)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(5.8125 : 21.625); (5.8125 : 20.3093082682292)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/DimUser/DimUser_FactClientInfo" />
       <nodes>
@@ -280,4 +253,104 @@
       </nodes>
     </associationConnector>
+    <classShape Id="30778876-b5f6-4a97-9ec7-792011973d75" absoluteBounds="11.25, 8.25, 2, 2.3478011067708344">
+      <DataClassMoniker Name="/HiveDataContext/Project" />
+      <nestedChildShapes>
+        <elementListCompartment Id="2c8b0555-6cea-4cc9-b028-2d066c02401c" absoluteBounds="11.265, 8.71, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <associationConnector edgePoints="[(11.9592307692308 : 10.5978011067708); (11.9592307692308 : 10.8478011067708); (12.5546153846154 : 10.8478011067708); (12.5546153846154 : 10.5978011067708)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Project/Project_Project" />
+      <nodes>
+        <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" />
+        <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" />
+      </nodes>
+    </associationConnector>
+    <classShape Id="1c20ff2a-adeb-4830-9456-9a2a3e11cee3" absoluteBounds="13.875, 9.875, 2, 1.3862939453125005">
+      <DataClassMoniker Name="/HiveDataContext/ProjectPermission" />
+      <nestedChildShapes>
+        <elementListCompartment Id="d115744c-dfef-4a5d-9b9a-30efc6ef4423" absoluteBounds="13.89, 10.335, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <associationConnector edgePoints="[(13.25 : 10.2364005533854); (13.875 : 10.2364005533854)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Project/Project_ProjectPermission" />
+      <nodes>
+        <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" />
+        <classShapeMoniker Id="1c20ff2a-adeb-4830-9456-9a2a3e11cee3" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(11.25 : 9.42390055338542); (4 : 9.42390055338542); (4 : 5.28049967447917); (5.125 : 5.28049967447917); (5.125 : 4.78049967447917)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" />
+      <nodes>
+        <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" />
+        <classShapeMoniker Id="e6f840cc-2968-4be1-b234-eef624ccacbb" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(13.25 : 2.15469482421875); (15.71875 : 2.15469482421875); (15.71875 : 8.25)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedProjectResource" />
+      <nodes>
+        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
+        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(13.25 : 8.84699625651042); (13.875 : 8.84699625651042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Project/Project_AssignedProjectResource" />
+      <nodes>
+        <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" />
+        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
+      </nodes>
+    </associationConnector>
+    <classShape Id="0a400ab3-5f14-4eea-88f0-94420c71a7fb" absoluteBounds="8.875, 4.5, 2, 1.1939925130208327">
+      <DataClassMoniker Name="/HiveDataContext/AssignedJobResource" />
+      <nestedChildShapes>
+        <elementListCompartment Id="8ef99b6f-aa50-465a-bb2b-3b9b9698d417" absoluteBounds="8.89, 4.96, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <associationConnector edgePoints="[(12.25 : 2.9631982421875); (12.25 : 5.09699625651042); (10.875 : 5.09699625651042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedJobResource" />
+      <nodes>
+        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
+        <classShapeMoniker Id="0a400ab3-5f14-4eea-88f0-94420c71a7fb" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(5.125 : 4.78049967447917); (5.125 : 5.14024983723958); (7.41666666666667 : 5.14024983723958 : JumpStart); (7.58333333333333 : 5.14024983723958 : JumpEnd); (8.875 : 5.14024983723958)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedJobResource" />
+      <nodes>
+        <classShapeMoniker Id="e6f840cc-2968-4be1-b234-eef624ccacbb" />
+        <classShapeMoniker Id="0a400ab3-5f14-4eea-88f0-94420c71a7fb" />
+      </nodes>
+    </associationConnector>
+    <classShape Id="e261c9ea-27ec-47d1-8e68-aba5f835f0dd" absoluteBounds="13.75, 17, 2, 1.9631982421875023">
+      <DataClassMoniker Name="/HiveDataContext/FactProjectInfo" />
+      <nestedChildShapes>
+        <elementListCompartment Id="4ba36f1f-053c-478d-b9b4-d0a2b63c3129" absoluteBounds="13.765, 17.46, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="55ff3cee-22ff-48f2-a8ff-ccb8e2e84af9" absoluteBounds="13.75, 12.25, 2, 2.73240397135417">
+      <DataClassMoniker Name="/HiveDataContext/DimProject" />
+      <nestedChildShapes>
+        <elementListCompartment Id="cf69e9f9-115a-42d8-8d53-761a1edfc941" absoluteBounds="13.765, 12.71, 1.9700000000000002, 2.1724039713541665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <associationConnector edgePoints="[(14.75 : 14.9824039713542); (14.75 : 17)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/DimProject/DimProject_FactProjectInfo" />
+      <nodes>
+        <classShapeMoniker Id="55ff3cee-22ff-48f2-a8ff-ccb8e2e84af9" />
+        <classShapeMoniker Id="e261c9ea-27ec-47d1-8e68-aba5f835f0dd" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(11.5312525 : 21.625); (11.5312525 : 17.8273270670573); (13.75 : 17.8273270670573)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactProjectInfo" />
+      <nodes>
+        <classShapeMoniker Id="a769f2ac-c8e3-4860-baa5-c46f46c38ed8" />
+        <classShapeMoniker Id="e261c9ea-27ec-47d1-8e68-aba5f835f0dd" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(13.75 : 13.5200512695313); (13.125 : 13.5200512695313)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/DimProject/DimProject_DimJob" />
+      <nodes>
+        <classShapeMoniker Id="55ff3cee-22ff-48f2-a8ff-ccb8e2e84af9" />
+        <classShapeMoniker Id="e0cb8641-a75e-4b9f-beda-3218c56938b1" />
+      </nodes>
+    </associationConnector>
   </nestedChildShapes>
 </ordesignerObjectsDiagram>
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs	(revision 16117)
@@ -3,5 +3,5 @@
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:4.0.30319.34209
+//     Runtime Version:4.0.30319.42000
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
@@ -31,7 +31,7 @@
     #region Extensibility Method Definitions
     partial void OnCreated();
-    partial void InsertAssignedResource(AssignedResource instance);
-    partial void UpdateAssignedResource(AssignedResource instance);
-    partial void DeleteAssignedResource(AssignedResource instance);
+    partial void InsertAssignedProjectResource(AssignedProjectResource instance);
+    partial void UpdateAssignedProjectResource(AssignedProjectResource instance);
+    partial void DeleteAssignedProjectResource(AssignedProjectResource instance);
     partial void InsertPlugin(Plugin instance);
     partial void UpdatePlugin(Plugin instance);
@@ -67,7 +67,4 @@
     partial void UpdateLifecycle(Lifecycle instance);
     partial void DeleteLifecycle(Lifecycle instance);
-    partial void InsertResourcePermission(ResourcePermission instance);
-    partial void UpdateResourcePermission(ResourcePermission instance);
-    partial void DeleteResourcePermission(ResourcePermission instance);
     partial void InsertUserPriority(UserPriority instance);
     partial void UpdateUserPriority(UserPriority instance);
@@ -91,11 +88,20 @@
     partial void UpdateFactClientInfo(FactClientInfo instance);
     partial void DeleteFactClientInfo(FactClientInfo instance);
+    partial void InsertProject(Project instance);
+    partial void UpdateProject(Project instance);
+    partial void DeleteProject(Project instance);
+    partial void InsertProjectPermission(ProjectPermission instance);
+    partial void UpdateProjectPermission(ProjectPermission instance);
+    partial void DeleteProjectPermission(ProjectPermission instance);
+    partial void InsertAssignedJobResource(AssignedJobResource instance);
+    partial void UpdateAssignedJobResource(AssignedJobResource instance);
+    partial void DeleteAssignedJobResource(AssignedJobResource instance);
+    partial void InsertFactProjectInfo(FactProjectInfo instance);
+    partial void UpdateFactProjectInfo(FactProjectInfo instance);
+    partial void DeleteFactProjectInfo(FactProjectInfo instance);
+    partial void InsertDimProject(DimProject instance);
+    partial void UpdateDimProject(DimProject instance);
+    partial void DeleteDimProject(DimProject instance);
     #endregion
-		
-		public HiveDataContext() : 
-				base(global::HeuristicLab.Services.Hive.DataAccess.Settings.Default.HeuristicLab_Hive_LinqConnectionString, mappingSource)
-		{
-			OnCreated();
-		}
 		
 		public HiveDataContext(string connection) : 
@@ -123,9 +129,9 @@
 		}
 		
-		public System.Data.Linq.Table<AssignedResource> AssignedResources
-		{
-			get
-			{
-				return this.GetTable<AssignedResource>();
+		public System.Data.Linq.Table<AssignedProjectResource> AssignedProjectResources
+		{
+			get
+			{
+				return this.GetTable<AssignedProjectResource>();
 			}
 		}
@@ -219,12 +225,4 @@
 		}
 		
-		public System.Data.Linq.Table<ResourcePermission> ResourcePermissions
-		{
-			get
-			{
-				return this.GetTable<ResourcePermission>();
-			}
-		}
-		
 		public System.Data.Linq.Table<UserPriority> UserPriorities
 		{
@@ -280,10 +278,50 @@
 			{
 				return this.GetTable<FactClientInfo>();
+			}
+		}
+		
+		public System.Data.Linq.Table<Project> Projects
+		{
+			get
+			{
+				return this.GetTable<Project>();
+			}
+		}
+		
+		public System.Data.Linq.Table<ProjectPermission> ProjectPermissions
+		{
+			get
+			{
+				return this.GetTable<ProjectPermission>();
+			}
+		}
+		
+		public System.Data.Linq.Table<AssignedJobResource> AssignedJobResources
+		{
+			get
+			{
+				return this.GetTable<AssignedJobResource>();
+			}
+		}
+		
+		public System.Data.Linq.Table<FactProjectInfo> FactProjectInfos
+		{
+			get
+			{
+				return this.GetTable<FactProjectInfo>();
+			}
+		}
+		
+		public System.Data.Linq.Table<DimProject> DimProjects
+		{
+			get
+			{
+				return this.GetTable<DimProject>();
 			}
 		}
 	}
 	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.AssignedResources")]
-	public partial class AssignedResource : INotifyPropertyChanging, INotifyPropertyChanged
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.AssignedProjectResource")]
+	public partial class AssignedProjectResource : INotifyPropertyChanging, INotifyPropertyChanged
 	{
 		
@@ -296,5 +334,5 @@
 		private EntityRef<Resource> _Resource;
 		
-		private EntityRef<Task> _Job;
+		private EntityRef<Project> _Project;
 		
     #region Extensibility Method Definitions
@@ -304,12 +342,12 @@
     partial void OnResourceIdChanging(System.Guid value);
     partial void OnResourceIdChanged();
-    partial void OnTaskIdChanging(System.Guid value);
-    partial void OnTaskIdChanged();
+    partial void OnProjectIdChanging(System.Guid value);
+    partial void OnProjectIdChanged();
     #endregion
 		
-		public AssignedResource()
+		public AssignedProjectResource()
 		{
 			this._Resource = default(EntityRef<Resource>);
-			this._Job = default(EntityRef<Task>);
+			this._Project = default(EntityRef<Project>);
 			OnCreated();
 		}
@@ -340,5 +378,5 @@
 		
 		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid TaskId
+		public System.Guid ProjectId
 		{
 			get
@@ -350,18 +388,18 @@
 				if ((this._JobId != value))
 				{
-					if (this._Job.HasLoadedOrAssignedValue)
+					if (this._Project.HasLoadedOrAssignedValue)
 					{
 						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
 					}
-					this.OnTaskIdChanging(value);
+					this.OnProjectIdChanging(value);
 					this.SendPropertyChanging();
 					this._JobId = value;
-					this.SendPropertyChanged("TaskId");
-					this.OnTaskIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
+					this.SendPropertyChanged("ProjectId");
+					this.OnProjectIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedProjectResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteOnNull=true)]
 		public Resource Resource
 		{
@@ -380,10 +418,10 @@
 					{
 						this._Resource.Entity = null;
-						previousValue.AssignedResources.Remove(this);
+						previousValue.AssignedProjectResources.Remove(this);
 					}
 					this._Resource.Entity = value;
 					if ((value != null))
 					{
-						value.AssignedResources.Add(this);
+						value.AssignedProjectResources.Add(this);
 						this._ResourceId = value.ResourceId;
 					}
@@ -397,28 +435,28 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Task_AssignedResource", Storage="_Job", ThisKey="TaskId", OtherKey="TaskId", IsForeignKey=true, DeleteRule="CASCADE")]
-		public Task Task
-		{
-			get
-			{
-				return this._Job.Entity;
-			}
-			set
-			{
-				Task previousValue = this._Job.Entity;
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedProjectResource", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteOnNull=true)]
+		public Project Project
+		{
+			get
+			{
+				return this._Project.Entity;
+			}
+			set
+			{
+				Project previousValue = this._Project.Entity;
 				if (((previousValue != value) 
-							|| (this._Job.HasLoadedOrAssignedValue == false)))
+							|| (this._Project.HasLoadedOrAssignedValue == false)))
 				{
 					this.SendPropertyChanging();
 					if ((previousValue != null))
 					{
-						this._Job.Entity = null;
-						previousValue.AssignedResources.Remove(this);
-					}
-					this._Job.Entity = value;
+						this._Project.Entity = null;
+						previousValue.AssignedProjectResources.Remove(this);
+					}
+					this._Project.Entity = value;
 					if ((value != null))
 					{
-						value.AssignedResources.Add(this);
-						this._JobId = value.TaskId;
+						value.AssignedProjectResources.Add(this);
+						this._JobId = value.ProjectId;
 					}
 					else
@@ -426,5 +464,5 @@
 						this._JobId = default(System.Guid);
 					}
-					this.SendPropertyChanged("Task");
+					this.SendPropertyChanged("Project");
 				}
 			}
@@ -903,5 +941,5 @@
 		private System.Nullable<System.Guid> _OwnerUserId;
 		
-		private EntitySet<AssignedResource> _AssignedResources;
+		private EntitySet<AssignedProjectResource> _AssignedProjectResources;
 		
 		private EntitySet<Resource> _ChildResources;
@@ -911,5 +949,5 @@
 		private EntitySet<StateLog> _StateLogs;
 		
-		private EntitySet<ResourcePermission> _ResourcePermissions;
+		private EntitySet<AssignedJobResource> _AssignedJobResources;
 		
 		private EntityRef<Resource> _ParentResource;
@@ -935,9 +973,9 @@
 		public Resource()
 		{
-			this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
+			this._AssignedProjectResources = new EntitySet<AssignedProjectResource>(new Action<AssignedProjectResource>(this.attach_AssignedProjectResources), new Action<AssignedProjectResource>(this.detach_AssignedProjectResources));
 			this._ChildResources = new EntitySet<Resource>(new Action<Resource>(this.attach_ChildResources), new Action<Resource>(this.detach_ChildResources));
 			this._UptimeCalendars = new EntitySet<Downtime>(new Action<Downtime>(this.attach_UptimeCalendars), new Action<Downtime>(this.detach_UptimeCalendars));
 			this._StateLogs = new EntitySet<StateLog>(new Action<StateLog>(this.attach_StateLogs), new Action<StateLog>(this.detach_StateLogs));
-			this._ResourcePermissions = new EntitySet<ResourcePermission>(new Action<ResourcePermission>(this.attach_ResourcePermissions), new Action<ResourcePermission>(this.detach_ResourcePermissions));
+			this._AssignedJobResources = new EntitySet<AssignedJobResource>(new Action<AssignedJobResource>(this.attach_AssignedJobResources), new Action<AssignedJobResource>(this.detach_AssignedJobResources));
 			this._ParentResource = default(EntityRef<Resource>);
 			OnCreated();
@@ -1068,14 +1106,14 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedResource", Storage="_AssignedResources", ThisKey="ResourceId", OtherKey="ResourceId")]
-		public EntitySet<AssignedResource> AssignedResources
-		{
-			get
-			{
-				return this._AssignedResources;
-			}
-			set
-			{
-				this._AssignedResources.Assign(value);
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedProjectResource", Storage="_AssignedProjectResources", ThisKey="ResourceId", OtherKey="ResourceId")]
+		public EntitySet<AssignedProjectResource> AssignedProjectResources
+		{
+			get
+			{
+				return this._AssignedProjectResources;
+			}
+			set
+			{
+				this._AssignedProjectResources.Assign(value);
 			}
 		}
@@ -1120,14 +1158,14 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_ResourcePermission", Storage="_ResourcePermissions", ThisKey="ResourceId", OtherKey="ResourceId")]
-		public EntitySet<ResourcePermission> ResourcePermissions
-		{
-			get
-			{
-				return this._ResourcePermissions;
-			}
-			set
-			{
-				this._ResourcePermissions.Assign(value);
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedJobResource", Storage="_AssignedJobResources", ThisKey="ResourceId", OtherKey="ResourceId")]
+		public EntitySet<AssignedJobResource> AssignedJobResources
+		{
+			get
+			{
+				return this._AssignedJobResources;
+			}
+			set
+			{
+				this._AssignedJobResources.Assign(value);
 			}
 		}
@@ -1187,5 +1225,5 @@
 		}
 		
-		private void attach_AssignedResources(AssignedResource entity)
+		private void attach_AssignedProjectResources(AssignedProjectResource entity)
 		{
 			this.SendPropertyChanging();
@@ -1193,5 +1231,5 @@
 		}
 		
-		private void detach_AssignedResources(AssignedResource entity)
+		private void detach_AssignedProjectResources(AssignedProjectResource entity)
 		{
 			this.SendPropertyChanging();
@@ -1235,5 +1273,5 @@
 		}
 		
-		private void attach_ResourcePermissions(ResourcePermission entity)
+		private void attach_AssignedJobResources(AssignedJobResource entity)
 		{
 			this.SendPropertyChanging();
@@ -1241,5 +1279,5 @@
 		}
 		
-		private void detach_ResourcePermissions(ResourcePermission entity)
+		private void detach_AssignedJobResources(AssignedJobResource entity)
 		{
 			this.SendPropertyChanging();
@@ -1620,6 +1658,4 @@
 		private System.Guid _HiveExperimentId;
 		
-		private EntitySet<AssignedResource> _AssignedResources;
-		
 		private EntitySet<RequiredPlugin> _RequiredPlugins;
 		
@@ -1666,5 +1702,4 @@
 		public Task()
 		{
-			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<Task>(new Action<Task>(this.attach_Jobs), new Action<Task>(this.detach_Jobs));
@@ -1924,17 +1959,4 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Task_AssignedResource", Storage="_AssignedResources", ThisKey="TaskId", OtherKey="TaskId")]
-		public EntitySet<AssignedResource> AssignedResources
-		{
-			get
-			{
-				return this._AssignedResources;
-			}
-			set
-			{
-				this._AssignedResources.Assign(value);
-			}
-		}
-		
 		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Task_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="TaskId", OtherKey="TaskId")]
 		public EntitySet<RequiredPlugin> RequiredPlugins
@@ -2091,16 +2113,4 @@
 				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
 			}
-		}
-		
-		private void attach_AssignedResources(AssignedResource entity)
-		{
-			this.SendPropertyChanging();
-			entity.Task = this;
-		}
-		
-		private void detach_AssignedResources(AssignedResource entity)
-		{
-			this.SendPropertyChanging();
-			entity.Task = null;
 		}
 		
@@ -2425,13 +2435,19 @@
 		private string _Description;
 		
-		private string _ResourceIds;
-		
 		private System.Guid _UserId;
 		
 		private System.DateTime _DateCreated;
 		
+		private System.Guid _ProjectId;
+		
+		private global::HeuristicLab.Services.Hive.DataAccess.JobState _State;
+		
 		private EntitySet<Task> _Jobs;
 		
 		private EntitySet<JobPermission> _HiveExperimentPermissions;
+		
+		private EntitySet<AssignedJobResource> _AssignedJobResources;
+		
+		private EntityRef<Project> _Project;
 		
     #region Extensibility Method Definitions
@@ -2445,10 +2461,12 @@
     partial void OnDescriptionChanging(string value);
     partial void OnDescriptionChanged();
-    partial void OnResourceIdsChanging(string value);
-    partial void OnResourceIdsChanged();
     partial void OnOwnerUserIdChanging(System.Guid value);
     partial void OnOwnerUserIdChanged();
     partial void OnDateCreatedChanging(System.DateTime value);
     partial void OnDateCreatedChanged();
+    partial void OnProjectIdChanging(System.Guid value);
+    partial void OnProjectIdChanged();
+    partial void OnStateChanging(global::HeuristicLab.Services.Hive.DataAccess.JobState value);
+    partial void OnStateChanged();
     #endregion
 		
@@ -2457,4 +2475,6 @@
 			this._Jobs = new EntitySet<Task>(new Action<Task>(this.attach_Jobs), new Action<Task>(this.detach_Jobs));
 			this._HiveExperimentPermissions = new EntitySet<JobPermission>(new Action<JobPermission>(this.attach_HiveExperimentPermissions), new Action<JobPermission>(this.detach_HiveExperimentPermissions));
+			this._AssignedJobResources = new EntitySet<AssignedJobResource>(new Action<AssignedJobResource>(this.attach_AssignedJobResources), new Action<AssignedJobResource>(this.detach_AssignedJobResources));
+			this._Project = default(EntityRef<Project>);
 			OnCreated();
 		}
@@ -2520,24 +2540,4 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceIds", DbType="VarChar(MAX)")]
-		public string ResourceIds
-		{
-			get
-			{
-				return this._ResourceIds;
-			}
-			set
-			{
-				if ((this._ResourceIds != value))
-				{
-					this.OnResourceIdsChanging(value);
-					this.SendPropertyChanging();
-					this._ResourceIds = value;
-					this.SendPropertyChanged("ResourceIds");
-					this.OnResourceIdsChanged();
-				}
-			}
-		}
-		
 		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier")]
 		public System.Guid OwnerUserId
@@ -2580,4 +2580,48 @@
 		}
 		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL")]
+		public 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();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="JobState", Storage="_State", DbType="VarChar(30)", CanBeNull=false)]
+		public global::HeuristicLab.Services.Hive.DataAccess.JobState State
+		{
+			get
+			{
+				return this._State;
+			}
+			set
+			{
+				if ((this._State != value))
+				{
+					this.OnStateChanging(value);
+					this.SendPropertyChanging();
+					this._State = value;
+					this.SendPropertyChanged("State");
+					this.OnStateChanged();
+				}
+			}
+		}
+		
 		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_Task", Storage="_Jobs", ThisKey="JobId", OtherKey="JobId")]
 		public EntitySet<Task> Tasks
@@ -2606,4 +2650,51 @@
 		}
 		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_AssignedJobResource", Storage="_AssignedJobResources", ThisKey="JobId", OtherKey="JobId")]
+		public EntitySet<AssignedJobResource> AssignedJobResources
+		{
+			get
+			{
+				return this._AssignedJobResources;
+			}
+			set
+			{
+				this._AssignedJobResources.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
+		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(System.Guid);
+					}
+					this.SendPropertyChanged("Project");
+				}
+			}
+		}
+		
 		public event PropertyChangingEventHandler PropertyChanging;
 		
@@ -2645,4 +2736,16 @@
 		
 		private void detach_HiveExperimentPermissions(JobPermission entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = null;
+		}
+		
+		private void attach_AssignedJobResources(AssignedJobResource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = this;
+		}
+		
+		private void detach_AssignedJobResources(AssignedJobResource entity)
 		{
 			this.SendPropertyChanging();
@@ -2747,5 +2850,5 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Task_TaskData", Storage="_Job", ThisKey="TaskId", OtherKey="TaskId", IsForeignKey=true)]
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Task_TaskData", Storage="_Job", ThisKey="TaskId", OtherKey="TaskId", IsForeignKey=true, DeleteOnNull=true)]
 		public Task Task
 		{
@@ -3385,5 +3488,5 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_JobPermission", Storage="_HiveExperiment", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_JobPermission", Storage="_HiveExperiment", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true, DeleteOnNull=true)]
 		public Job Job
 		{
@@ -3526,155 +3629,4 @@
 	}
 	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ResourcePermission")]
-	public partial class ResourcePermission : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _ResourceId;
-		
-		private System.Guid _GrantedUserId;
-		
-		private System.Guid _GrantedByUserId;
-		
-		private EntityRef<Resource> _Resource;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnResourceIdChanging(System.Guid value);
-    partial void OnResourceIdChanged();
-    partial void OnGrantedUserIdChanging(System.Guid value);
-    partial void OnGrantedUserIdChanged();
-    partial void OnGrantedByUserIdChanging(System.Guid value);
-    partial void OnGrantedByUserIdChanged();
-    #endregion
-		
-		public ResourcePermission()
-		{
-			this._Resource = default(EntityRef<Resource>);
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid ResourceId
-		{
-			get
-			{
-				return this._ResourceId;
-			}
-			set
-			{
-				if ((this._ResourceId != value))
-				{
-					if (this._Resource.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnResourceIdChanging(value);
-					this.SendPropertyChanging();
-					this._ResourceId = value;
-					this.SendPropertyChanged("ResourceId");
-					this.OnResourceIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedUserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid GrantedUserId
-		{
-			get
-			{
-				return this._GrantedUserId;
-			}
-			set
-			{
-				if ((this._GrantedUserId != value))
-				{
-					this.OnGrantedUserIdChanging(value);
-					this.SendPropertyChanging();
-					this._GrantedUserId = value;
-					this.SendPropertyChanged("GrantedUserId");
-					this.OnGrantedUserIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedByUserId", DbType="UniqueIdentifier NOT NULL")]
-		public System.Guid GrantedByUserId
-		{
-			get
-			{
-				return this._GrantedByUserId;
-			}
-			set
-			{
-				if ((this._GrantedByUserId != value))
-				{
-					this.OnGrantedByUserIdChanging(value);
-					this.SendPropertyChanging();
-					this._GrantedByUserId = value;
-					this.SendPropertyChanged("GrantedByUserId");
-					this.OnGrantedByUserIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_ResourcePermission", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true)]
-		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.ResourcePermissions.Remove(this);
-					}
-					this._Resource.Entity = value;
-					if ((value != null))
-					{
-						value.ResourcePermissions.Add(this);
-						this._ResourceId = value.ResourceId;
-					}
-					else
-					{
-						this._ResourceId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Resource");
-				}
-			}
-		}
-		
-		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));
-			}
-		}
-	}
-	
 	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
 	public partial class UserPriority : INotifyPropertyChanging, INotifyPropertyChanged
@@ -3775,13 +3727,11 @@
 		private System.Guid _ResourceId;
 		
-		private System.Nullable<System.DateTime> _ExpirationTime;
-		
-		private System.Nullable<System.Guid> _ResourceGroupId;
-		
-		private System.Nullable<System.Guid> _ResourceGroup2Id;
-		
-		private string _GroupName;
-		
-		private string _GroupName2;
+		private System.Nullable<System.Guid> _ParentResourceId;
+		
+		private string _ResourceType;
+		
+		private System.DateTime _DateCreated;
+		
+		private System.Nullable<System.DateTime> _DateExpired;
 		
 		private EntitySet<FactTask> _FactTasks;
@@ -3799,14 +3749,12 @@
     partial void OnResourceIdChanging(System.Guid value);
     partial void OnResourceIdChanged();
-    partial void OnExpirationTimeChanging(System.Nullable<System.DateTime> value);
-    partial void OnExpirationTimeChanged();
-    partial void OnResourceGroupIdChanging(System.Nullable<System.Guid> value);
-    partial void OnResourceGroupIdChanged();
-    partial void OnResourceGroup2IdChanging(System.Nullable<System.Guid> value);
-    partial void OnResourceGroup2IdChanged();
-    partial void OnGroupNameChanging(string value);
-    partial void OnGroupNameChanged();
-    partial void OnGroupName2Changing(string value);
-    partial void OnGroupName2Changed();
+    partial void OnParentResourceIdChanging(System.Nullable<System.Guid> value);
+    partial void OnParentResourceIdChanged();
+    partial void OnResourceTypeChanging(string value);
+    partial void OnResourceTypeChanged();
+    partial void OnDateCreatedChanging(System.DateTime value);
+    partial void OnDateCreatedChanged();
+    partial void OnDateExpiredChanging(System.Nullable<System.DateTime> value);
+    partial void OnDateExpiredChanged();
     #endregion
 		
@@ -3878,100 +3826,80 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExpirationTime", DbType="DateTime")]
-		public System.Nullable<System.DateTime> ExpirationTime
-		{
-			get
-			{
-				return this._ExpirationTime;
-			}
-			set
-			{
-				if ((this._ExpirationTime != value))
-				{
-					this.OnExpirationTimeChanging(value);
-					this.SendPropertyChanging();
-					this._ExpirationTime = value;
-					this.SendPropertyChanged("ExpirationTime");
-					this.OnExpirationTimeChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceGroupId", DbType="UniqueIdentifier")]
-		public System.Nullable<System.Guid> ResourceGroupId
-		{
-			get
-			{
-				return this._ResourceGroupId;
-			}
-			set
-			{
-				if ((this._ResourceGroupId != value))
-				{
-					this.OnResourceGroupIdChanging(value);
-					this.SendPropertyChanging();
-					this._ResourceGroupId = value;
-					this.SendPropertyChanged("ResourceGroupId");
-					this.OnResourceGroupIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceGroup2Id", DbType="UniqueIdentifier")]
-		public System.Nullable<System.Guid> ResourceGroup2Id
-		{
-			get
-			{
-				return this._ResourceGroup2Id;
-			}
-			set
-			{
-				if ((this._ResourceGroup2Id != value))
-				{
-					this.OnResourceGroup2IdChanging(value);
-					this.SendPropertyChanging();
-					this._ResourceGroup2Id = value;
-					this.SendPropertyChanged("ResourceGroup2Id");
-					this.OnResourceGroup2IdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GroupName")]
-		public string GroupName
-		{
-			get
-			{
-				return this._GroupName;
-			}
-			set
-			{
-				if ((this._GroupName != value))
-				{
-					this.OnGroupNameChanging(value);
-					this.SendPropertyChanging();
-					this._GroupName = value;
-					this.SendPropertyChanged("GroupName");
-					this.OnGroupNameChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GroupName2")]
-		public string GroupName2
-		{
-			get
-			{
-				return this._GroupName2;
-			}
-			set
-			{
-				if ((this._GroupName2 != value))
-				{
-					this.OnGroupName2Changing(value);
-					this.SendPropertyChanging();
-					this._GroupName2 = value;
-					this.SendPropertyChanged("GroupName2");
-					this.OnGroupName2Changed();
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentResourceId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> ParentResourceId
+		{
+			get
+			{
+				return this._ParentResourceId;
+			}
+			set
+			{
+				if ((this._ParentResourceId != value))
+				{
+					this.OnParentResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ParentResourceId = value;
+					this.SendPropertyChanged("ParentResourceId");
+					this.OnParentResourceIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceType", CanBeNull=false)]
+		public string ResourceType
+		{
+			get
+			{
+				return this._ResourceType;
+			}
+			set
+			{
+				if ((this._ResourceType != value))
+				{
+					this.OnResourceTypeChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceType = value;
+					this.SendPropertyChanged("ResourceType");
+					this.OnResourceTypeChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime NOT NULL")]
+		public 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();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateExpired", DbType="DateTime")]
+		public System.Nullable<System.DateTime> DateExpired
+		{
+			get
+			{
+				return this._DateExpired;
+			}
+			set
+			{
+				if ((this._DateExpired != value))
+				{
+					this.OnDateExpiredChanging(value);
+					this.SendPropertyChanging();
+					this._DateExpired = value;
+					this.SendPropertyChanged("DateExpired");
+					this.OnDateExpiredChanged();
 				}
 			}
@@ -4575,5 +4503,9 @@
 		private System.Nullable<System.DateTime> _DateCompleted;
 		
+		private System.Guid _ProjectId;
+		
 		private EntitySet<FactTask> _FactTasks;
+		
+		private EntityRef<DimProject> _DimProject;
 		
     #region Extensibility Method Definitions
@@ -4597,4 +4529,6 @@
     partial void OnDateCompletedChanging(System.Nullable<System.DateTime> value);
     partial void OnDateCompletedChanged();
+    partial void OnProjectIdChanging(System.Guid value);
+    partial void OnProjectIdChanged();
     #endregion
 		
@@ -4602,4 +4536,5 @@
 		{
 			this._FactTasks = new EntitySet<FactTask>(new Action<FactTask>(this.attach_FactTasks), new Action<FactTask>(this.detach_FactTasks));
+			this._DimProject = default(EntityRef<DimProject>);
 			OnCreated();
 		}
@@ -4765,4 +4700,28 @@
 		}
 		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid ProjectId
+		{
+			get
+			{
+				return this._ProjectId;
+			}
+			set
+			{
+				if ((this._ProjectId != value))
+				{
+					if (this._DimProject.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnProjectIdChanging(value);
+					this.SendPropertyChanging();
+					this._ProjectId = value;
+					this.SendPropertyChanged("ProjectId");
+					this.OnProjectIdChanged();
+				}
+			}
+		}
+		
 		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimJob_FactTask", Storage="_FactTasks", ThisKey="JobId", OtherKey="JobId")]
 		public EntitySet<FactTask> FactTasks
@@ -4775,4 +4734,38 @@
 			{
 				this._FactTasks.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimProject_DimJob", Storage="_DimProject", ThisKey="ProjectId", OtherKey="Id", IsForeignKey=true)]
+		public DimProject DimProject
+		{
+			get
+			{
+				return this._DimProject.Entity;
+			}
+			set
+			{
+				DimProject previousValue = this._DimProject.Entity;
+				if (((previousValue != value) 
+							|| (this._DimProject.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._DimProject.Entity = null;
+						previousValue.DimJobs.Remove(this);
+					}
+					this._DimProject.Entity = value;
+					if ((value != null))
+					{
+						value.DimJobs.Add(this);
+						this._ProjectId = value.Id;
+					}
+					else
+					{
+						this._ProjectId = default(System.Guid);
+					}
+					this.SendPropertyChanged("DimProject");
+				}
 			}
 		}
@@ -4830,4 +4823,6 @@
 		
 		private EntitySet<FactClientInfo> _FactClientInfos;
+		
+		private EntitySet<FactProjectInfo> _FactProjectInfos;
 		
     #region Extensibility Method Definitions
@@ -4852,4 +4847,5 @@
 		{
 			this._FactClientInfos = new EntitySet<FactClientInfo>(new Action<FactClientInfo>(this.attach_FactClientInfos), new Action<FactClientInfo>(this.detach_FactClientInfos));
+			this._FactProjectInfos = new EntitySet<FactProjectInfo>(new Action<FactProjectInfo>(this.attach_FactProjectInfos), new Action<FactProjectInfo>(this.detach_FactProjectInfos));
 			OnCreated();
 		}
@@ -4988,4 +4984,17 @@
 		}
 		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimTime_FactProjectInfo", Storage="_FactProjectInfos", ThisKey="Time", OtherKey="Time")]
+		public EntitySet<FactProjectInfo> FactProjectInfos
+		{
+			get
+			{
+				return this._FactProjectInfos;
+			}
+			set
+			{
+				this._FactProjectInfos.Assign(value);
+			}
+		}
+		
 		public event PropertyChangingEventHandler PropertyChanging;
 		
@@ -5015,4 +5024,16 @@
 		
 		private void detach_FactClientInfos(FactClientInfo entity)
+		{
+			this.SendPropertyChanging();
+			entity.DimTime = null;
+		}
+		
+		private void attach_FactProjectInfos(FactProjectInfo entity)
+		{
+			this.SendPropertyChanging();
+			entity.DimTime = this;
+		}
+		
+		private void detach_FactProjectInfos(FactProjectInfo entity)
 		{
 			this.SendPropertyChanging();
@@ -5261,5 +5282,5 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier NULL", IsPrimaryKey=true)]
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
 		public System.Guid UserId
 		{
@@ -5607,4 +5628,1304 @@
 		}
 	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Project")]
+	public partial class Project : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _ProjectId;
+		
+		private System.Nullable<System.Guid> _ParentProjectId;
+		
+		private System.DateTime _DateCreated;
+		
+		private string _Name;
+		
+		private string _Description;
+		
+		private System.Guid _OwnerUserId;
+		
+		private System.DateTime _StartDate;
+		
+		private System.Nullable<System.DateTime> _EndDate;
+		
+		private EntitySet<AssignedProjectResource> _AssignedProjectResources;
+		
+		private EntitySet<Job> _Jobs;
+		
+		private EntitySet<Project> _Projects;
+		
+		private EntitySet<ProjectPermission> _ProjectPermissions;
+		
+		private EntityRef<Project> _Project1;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnProjectIdChanging(System.Guid value);
+    partial void OnProjectIdChanged();
+    partial void OnParentProjectIdChanging(System.Nullable<System.Guid> value);
+    partial void OnParentProjectIdChanged();
+    partial void OnDateCreatedChanging(System.DateTime value);
+    partial void OnDateCreatedChanged();
+    partial void OnNameChanging(string value);
+    partial void OnNameChanged();
+    partial void OnDescriptionChanging(string value);
+    partial void OnDescriptionChanged();
+    partial void OnOwnerUserIdChanging(System.Guid value);
+    partial void OnOwnerUserIdChanged();
+    partial void OnStartDateChanging(System.DateTime value);
+    partial void OnStartDateChanged();
+    partial void OnEndDateChanging(System.Nullable<System.DateTime> value);
+    partial void OnEndDateChanged();
+    #endregion
+		
+		public Project()
+		{
+			this._AssignedProjectResources = new EntitySet<AssignedProjectResource>(new Action<AssignedProjectResource>(this.attach_AssignedProjectResources), new Action<AssignedProjectResource>(this.detach_AssignedProjectResources));
+			this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
+			this._Projects = new EntitySet<Project>(new Action<Project>(this.attach_Projects), new Action<Project>(this.detach_Projects));
+			this._ProjectPermissions = new EntitySet<ProjectPermission>(new Action<ProjectPermission>(this.attach_ProjectPermissions), new Action<ProjectPermission>(this.detach_ProjectPermissions));
+			this._Project1 = default(EntityRef<Project>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid ProjectId
+		{
+			get
+			{
+				return this._ProjectId;
+			}
+			set
+			{
+				if ((this._ProjectId != value))
+				{
+					this.OnProjectIdChanging(value);
+					this.SendPropertyChanging();
+					this._ProjectId = value;
+					this.SendPropertyChanged("ProjectId");
+					this.OnProjectIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentProjectId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> ParentProjectId
+		{
+			get
+			{
+				return this._ParentProjectId;
+			}
+			set
+			{
+				if ((this._ParentProjectId != value))
+				{
+					if (this._Project1.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnParentProjectIdChanging(value);
+					this.SendPropertyChanging();
+					this._ParentProjectId = value;
+					this.SendPropertyChanged("ParentProjectId");
+					this.OnParentProjectIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime NOT NULL")]
+		public 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();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(MAX) NOT NULL", CanBeNull=false)]
+		public string Name
+		{
+			get
+			{
+				return this._Name;
+			}
+			set
+			{
+				if ((this._Name != value))
+				{
+					this.OnNameChanging(value);
+					this.SendPropertyChanging();
+					this._Name = value;
+					this.SendPropertyChanged("Name");
+					this.OnNameChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="VarChar(MAX)")]
+		public string Description
+		{
+			get
+			{
+				return this._Description;
+			}
+			set
+			{
+				if ((this._Description != value))
+				{
+					this.OnDescriptionChanging(value);
+					this.SendPropertyChanging();
+					this._Description = value;
+					this.SendPropertyChanged("Description");
+					this.OnDescriptionChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OwnerUserId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid OwnerUserId
+		{
+			get
+			{
+				return this._OwnerUserId;
+			}
+			set
+			{
+				if ((this._OwnerUserId != value))
+				{
+					this.OnOwnerUserIdChanging(value);
+					this.SendPropertyChanging();
+					this._OwnerUserId = value;
+					this.SendPropertyChanged("OwnerUserId");
+					this.OnOwnerUserIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime NOT NULL")]
+		public System.DateTime StartDate
+		{
+			get
+			{
+				return this._StartDate;
+			}
+			set
+			{
+				if ((this._StartDate != value))
+				{
+					this.OnStartDateChanging(value);
+					this.SendPropertyChanging();
+					this._StartDate = value;
+					this.SendPropertyChanged("StartDate");
+					this.OnStartDateChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime")]
+		public System.Nullable<System.DateTime> EndDate
+		{
+			get
+			{
+				return this._EndDate;
+			}
+			set
+			{
+				if ((this._EndDate != value))
+				{
+					this.OnEndDateChanging(value);
+					this.SendPropertyChanging();
+					this._EndDate = value;
+					this.SendPropertyChanged("EndDate");
+					this.OnEndDateChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedProjectResource", Storage="_AssignedProjectResources", ThisKey="ProjectId", OtherKey="ProjectId")]
+		public EntitySet<AssignedProjectResource> AssignedProjectResources
+		{
+			get
+			{
+				return this._AssignedProjectResources;
+			}
+			set
+			{
+				this._AssignedProjectResources.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Job", Storage="_Jobs", ThisKey="ProjectId", OtherKey="ProjectId")]
+		public EntitySet<Job> Jobs
+		{
+			get
+			{
+				return this._Jobs;
+			}
+			set
+			{
+				this._Jobs.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Project", Storage="_Projects", ThisKey="ProjectId", OtherKey="ParentProjectId")]
+		public EntitySet<Project> ChildProjects
+		{
+			get
+			{
+				return this._Projects;
+			}
+			set
+			{
+				this._Projects.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_ProjectPermissions", ThisKey="ProjectId", OtherKey="ProjectId")]
+		public EntitySet<ProjectPermission> ProjectPermissions
+		{
+			get
+			{
+				return this._ProjectPermissions;
+			}
+			set
+			{
+				this._ProjectPermissions.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Project", Storage="_Project1", ThisKey="ParentProjectId", OtherKey="ProjectId", IsForeignKey=true)]
+		public Project ParentProject
+		{
+			get
+			{
+				return this._Project1.Entity;
+			}
+			set
+			{
+				Project previousValue = this._Project1.Entity;
+				if (((previousValue != value) 
+							|| (this._Project1.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Project1.Entity = null;
+						previousValue.ChildProjects.Remove(this);
+					}
+					this._Project1.Entity = value;
+					if ((value != null))
+					{
+						value.ChildProjects.Add(this);
+						this._ParentProjectId = value.ProjectId;
+					}
+					else
+					{
+						this._ParentProjectId = default(Nullable<System.Guid>);
+					}
+					this.SendPropertyChanged("ParentProject");
+				}
+			}
+		}
+		
+		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_AssignedProjectResources(AssignedProjectResource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Project = this;
+		}
+		
+		private void detach_AssignedProjectResources(AssignedProjectResource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Project = null;
+		}
+		
+		private void attach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.Project = this;
+		}
+		
+		private void detach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.Project = null;
+		}
+		
+		private void attach_Projects(Project entity)
+		{
+			this.SendPropertyChanging();
+			entity.ParentProject = this;
+		}
+		
+		private void detach_Projects(Project entity)
+		{
+			this.SendPropertyChanging();
+			entity.ParentProject = null;
+		}
+		
+		private void attach_ProjectPermissions(ProjectPermission entity)
+		{
+			this.SendPropertyChanging();
+			entity.Project = this;
+		}
+		
+		private void detach_ProjectPermissions(ProjectPermission entity)
+		{
+			this.SendPropertyChanging();
+			entity.Project = null;
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ProjectPermission")]
+	public partial class ProjectPermission : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _ProjectId;
+		
+		private System.Guid _GrantedUserId;
+		
+		private System.Guid _GrantedByUserId;
+		
+		private EntityRef<Project> _Project;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnProjectIdChanging(System.Guid value);
+    partial void OnProjectIdChanged();
+    partial void OnGrantedUserIdChanging(System.Guid value);
+    partial void OnGrantedUserIdChanged();
+    partial void OnGrantedByUserIdChanging(System.Guid value);
+    partial void OnGrantedByUserIdChanged();
+    #endregion
+		
+		public ProjectPermission()
+		{
+			this._Project = default(EntityRef<Project>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public 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();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedUserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid GrantedUserId
+		{
+			get
+			{
+				return this._GrantedUserId;
+			}
+			set
+			{
+				if ((this._GrantedUserId != value))
+				{
+					this.OnGrantedUserIdChanging(value);
+					this.SendPropertyChanging();
+					this._GrantedUserId = value;
+					this.SendPropertyChanged("GrantedUserId");
+					this.OnGrantedUserIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedByUserId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid GrantedByUserId
+		{
+			get
+			{
+				return this._GrantedByUserId;
+			}
+			set
+			{
+				if ((this._GrantedByUserId != value))
+				{
+					this.OnGrantedByUserIdChanging(value);
+					this.SendPropertyChanging();
+					this._GrantedByUserId = value;
+					this.SendPropertyChanged("GrantedByUserId");
+					this.OnGrantedByUserIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteOnNull=true)]
+		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.ProjectPermissions.Remove(this);
+					}
+					this._Project.Entity = value;
+					if ((value != null))
+					{
+						value.ProjectPermissions.Add(this);
+						this._ProjectId = value.ProjectId;
+					}
+					else
+					{
+						this._ProjectId = default(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));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.AssignedJobResource")]
+	public partial class AssignedJobResource : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _ResourceId;
+		
+		private System.Guid _JobId;
+		
+		private EntityRef<Resource> _Resource;
+		
+		private EntityRef<Job> _Job;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnResourceIdChanging(System.Guid value);
+    partial void OnResourceIdChanged();
+    partial void OnJobIdChanging(System.Guid value);
+    partial void OnJobIdChanged();
+    #endregion
+		
+		public AssignedJobResource()
+		{
+			this._Resource = default(EntityRef<Resource>);
+			this._Job = default(EntityRef<Job>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid ResourceId
+		{
+			get
+			{
+				return this._ResourceId;
+			}
+			set
+			{
+				if ((this._ResourceId != value))
+				{
+					if (this._Resource.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceId = value;
+					this.SendPropertyChanged("ResourceId");
+					this.OnResourceIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid JobId
+		{
+			get
+			{
+				return this._JobId;
+			}
+			set
+			{
+				if ((this._JobId != value))
+				{
+					if (this._Job.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._JobId = value;
+					this.SendPropertyChanged("JobId");
+					this.OnJobIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedJobResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteOnNull=true)]
+		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.AssignedJobResources.Remove(this);
+					}
+					this._Resource.Entity = value;
+					if ((value != null))
+					{
+						value.AssignedJobResources.Add(this);
+						this._ResourceId = value.ResourceId;
+					}
+					else
+					{
+						this._ResourceId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Resource");
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_AssignedJobResource", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true, DeleteOnNull=true)]
+		public Job Job
+		{
+			get
+			{
+				return this._Job.Entity;
+			}
+			set
+			{
+				Job previousValue = this._Job.Entity;
+				if (((previousValue != value) 
+							|| (this._Job.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Job.Entity = null;
+						previousValue.AssignedJobResources.Remove(this);
+					}
+					this._Job.Entity = value;
+					if ((value != null))
+					{
+						value.AssignedJobResources.Add(this);
+						this._JobId = value.JobId;
+					}
+					else
+					{
+						this._JobId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Job");
+				}
+			}
+		}
+		
+		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));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="[statistics].FactProjectInfo")]
+	public partial class FactProjectInfo : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _ProjectId;
+		
+		private System.DateTime _Time;
+		
+		private int _NumTotalCores;
+		
+		private int _NumUsedCores;
+		
+		private int _TotalMemory;
+		
+		private int _UsedMemory;
+		
+		private EntityRef<DimProject> _DimProject;
+		
+		private EntityRef<DimTime> _DimTime;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnProjectIdChanging(System.Guid value);
+    partial void OnProjectIdChanged();
+    partial void OnTimeChanging(System.DateTime value);
+    partial void OnTimeChanged();
+    partial void OnNumTotalCoresChanging(int value);
+    partial void OnNumTotalCoresChanged();
+    partial void OnNumUsedCoresChanging(int value);
+    partial void OnNumUsedCoresChanged();
+    partial void OnTotalMemoryChanging(int value);
+    partial void OnTotalMemoryChanged();
+    partial void OnUsedMemoryChanging(int value);
+    partial void OnUsedMemoryChanged();
+    #endregion
+		
+		public FactProjectInfo()
+		{
+			this._DimProject = default(EntityRef<DimProject>);
+			this._DimTime = default(EntityRef<DimTime>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid ProjectId
+		{
+			get
+			{
+				return this._ProjectId;
+			}
+			set
+			{
+				if ((this._ProjectId != value))
+				{
+					if (this._DimProject.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnProjectIdChanging(value);
+					this.SendPropertyChanging();
+					this._ProjectId = value;
+					this.SendPropertyChanged("ProjectId");
+					this.OnProjectIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Time", DbType="DateTime NOT NULL", IsPrimaryKey=true)]
+		public System.DateTime Time
+		{
+			get
+			{
+				return this._Time;
+			}
+			set
+			{
+				if ((this._Time != value))
+				{
+					if (this._DimTime.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnTimeChanging(value);
+					this.SendPropertyChanging();
+					this._Time = value;
+					this.SendPropertyChanged("Time");
+					this.OnTimeChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumTotalCores", DbType="Int NOT NULL")]
+		public int NumTotalCores
+		{
+			get
+			{
+				return this._NumTotalCores;
+			}
+			set
+			{
+				if ((this._NumTotalCores != value))
+				{
+					this.OnNumTotalCoresChanging(value);
+					this.SendPropertyChanging();
+					this._NumTotalCores = value;
+					this.SendPropertyChanged("NumTotalCores");
+					this.OnNumTotalCoresChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumUsedCores", DbType="Int NOT NULL")]
+		public int NumUsedCores
+		{
+			get
+			{
+				return this._NumUsedCores;
+			}
+			set
+			{
+				if ((this._NumUsedCores != value))
+				{
+					this.OnNumUsedCoresChanging(value);
+					this.SendPropertyChanging();
+					this._NumUsedCores = value;
+					this.SendPropertyChanged("NumUsedCores");
+					this.OnNumUsedCoresChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalMemory", DbType="Int NOT NULL")]
+		public int TotalMemory
+		{
+			get
+			{
+				return this._TotalMemory;
+			}
+			set
+			{
+				if ((this._TotalMemory != value))
+				{
+					this.OnTotalMemoryChanging(value);
+					this.SendPropertyChanging();
+					this._TotalMemory = value;
+					this.SendPropertyChanged("TotalMemory");
+					this.OnTotalMemoryChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UsedMemory", DbType="Int NOT NULL")]
+		public int UsedMemory
+		{
+			get
+			{
+				return this._UsedMemory;
+			}
+			set
+			{
+				if ((this._UsedMemory != value))
+				{
+					this.OnUsedMemoryChanging(value);
+					this.SendPropertyChanging();
+					this._UsedMemory = value;
+					this.SendPropertyChanged("UsedMemory");
+					this.OnUsedMemoryChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimProject_FactProjectInfo", Storage="_DimProject", ThisKey="ProjectId", OtherKey="Id", IsForeignKey=true)]
+		public DimProject DimProject
+		{
+			get
+			{
+				return this._DimProject.Entity;
+			}
+			set
+			{
+				DimProject previousValue = this._DimProject.Entity;
+				if (((previousValue != value) 
+							|| (this._DimProject.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._DimProject.Entity = null;
+						previousValue.FactProjectInfos.Remove(this);
+					}
+					this._DimProject.Entity = value;
+					if ((value != null))
+					{
+						value.FactProjectInfos.Add(this);
+						this._ProjectId = value.Id;
+					}
+					else
+					{
+						this._ProjectId = default(System.Guid);
+					}
+					this.SendPropertyChanged("DimProject");
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimTime_FactProjectInfo", Storage="_DimTime", ThisKey="Time", OtherKey="Time", IsForeignKey=true)]
+		public DimTime DimTime
+		{
+			get
+			{
+				return this._DimTime.Entity;
+			}
+			set
+			{
+				DimTime previousValue = this._DimTime.Entity;
+				if (((previousValue != value) 
+							|| (this._DimTime.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._DimTime.Entity = null;
+						previousValue.FactProjectInfos.Remove(this);
+					}
+					this._DimTime.Entity = value;
+					if ((value != null))
+					{
+						value.FactProjectInfos.Add(this);
+						this._Time = value.Time;
+					}
+					else
+					{
+						this._Time = default(System.DateTime);
+					}
+					this.SendPropertyChanged("DimTime");
+				}
+			}
+		}
+		
+		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));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="[statistics].DimProject")]
+	public partial class DimProject : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _Id;
+		
+		private System.Guid _ProjectId;
+		
+		private System.Nullable<System.Guid> _ParentId;
+		
+		private string _Name;
+		
+		private string _Description;
+		
+		private System.Guid _OwnerUserId;
+		
+		private System.DateTime _StartDate;
+		
+		private System.Nullable<System.DateTime> _EndDate;
+		
+		private System.DateTime _DateCreated;
+		
+		private System.Nullable<System.DateTime> _DateExpired;
+		
+		private EntitySet<DimJob> _DimJobs;
+		
+		private EntitySet<FactProjectInfo> _FactProjectInfos;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnIdChanging(System.Guid value);
+    partial void OnIdChanged();
+    partial void OnProjectIdChanging(System.Guid value);
+    partial void OnProjectIdChanged();
+    partial void OnParentProjectIdChanging(System.Nullable<System.Guid> value);
+    partial void OnParentProjectIdChanged();
+    partial void OnNameChanging(string value);
+    partial void OnNameChanged();
+    partial void OnDescriptionChanging(string value);
+    partial void OnDescriptionChanged();
+    partial void OnOwnerUserIdChanging(System.Guid value);
+    partial void OnOwnerUserIdChanged();
+    partial void OnStartDateChanging(System.DateTime value);
+    partial void OnStartDateChanged();
+    partial void OnEndDateChanging(System.Nullable<System.DateTime> value);
+    partial void OnEndDateChanged();
+    partial void OnDateCreatedChanging(System.DateTime value);
+    partial void OnDateCreatedChanged();
+    partial void OnDateExpiredChanging(System.Nullable<System.DateTime> value);
+    partial void OnDateExpiredChanged();
+    #endregion
+		
+		public DimProject()
+		{
+			this._DimJobs = new EntitySet<DimJob>(new Action<DimJob>(this.attach_DimJobs), new Action<DimJob>(this.detach_DimJobs));
+			this._FactProjectInfos = new EntitySet<FactProjectInfo>(new Action<FactProjectInfo>(this.attach_FactProjectInfos), new Action<FactProjectInfo>(this.detach_FactProjectInfos));
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid Id
+		{
+			get
+			{
+				return this._Id;
+			}
+			set
+			{
+				if ((this._Id != value))
+				{
+					this.OnIdChanging(value);
+					this.SendPropertyChanging();
+					this._Id = value;
+					this.SendPropertyChanged("Id");
+					this.OnIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid ProjectId
+		{
+			get
+			{
+				return this._ProjectId;
+			}
+			set
+			{
+				if ((this._ProjectId != value))
+				{
+					this.OnProjectIdChanging(value);
+					this.SendPropertyChanging();
+					this._ProjectId = value;
+					this.SendPropertyChanged("ProjectId");
+					this.OnProjectIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> ParentProjectId
+		{
+			get
+			{
+				return this._ParentId;
+			}
+			set
+			{
+				if ((this._ParentId != value))
+				{
+					this.OnParentProjectIdChanging(value);
+					this.SendPropertyChanging();
+					this._ParentId = value;
+					this.SendPropertyChanged("ParentProjectId");
+					this.OnParentProjectIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", CanBeNull=false)]
+		public string Name
+		{
+			get
+			{
+				return this._Name;
+			}
+			set
+			{
+				if ((this._Name != value))
+				{
+					this.OnNameChanging(value);
+					this.SendPropertyChanging();
+					this._Name = value;
+					this.SendPropertyChanged("Name");
+					this.OnNameChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description")]
+		public string Description
+		{
+			get
+			{
+				return this._Description;
+			}
+			set
+			{
+				if ((this._Description != value))
+				{
+					this.OnDescriptionChanging(value);
+					this.SendPropertyChanging();
+					this._Description = value;
+					this.SendPropertyChanged("Description");
+					this.OnDescriptionChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OwnerUserId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid OwnerUserId
+		{
+			get
+			{
+				return this._OwnerUserId;
+			}
+			set
+			{
+				if ((this._OwnerUserId != value))
+				{
+					this.OnOwnerUserIdChanging(value);
+					this.SendPropertyChanging();
+					this._OwnerUserId = value;
+					this.SendPropertyChanged("OwnerUserId");
+					this.OnOwnerUserIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime NOT NULL")]
+		public System.DateTime StartDate
+		{
+			get
+			{
+				return this._StartDate;
+			}
+			set
+			{
+				if ((this._StartDate != value))
+				{
+					this.OnStartDateChanging(value);
+					this.SendPropertyChanging();
+					this._StartDate = value;
+					this.SendPropertyChanged("StartDate");
+					this.OnStartDateChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime")]
+		public System.Nullable<System.DateTime> EndDate
+		{
+			get
+			{
+				return this._EndDate;
+			}
+			set
+			{
+				if ((this._EndDate != value))
+				{
+					this.OnEndDateChanging(value);
+					this.SendPropertyChanging();
+					this._EndDate = value;
+					this.SendPropertyChanged("EndDate");
+					this.OnEndDateChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime NOT NULL")]
+		public 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();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateExpired", DbType="DateTime")]
+		public System.Nullable<System.DateTime> DateExpired
+		{
+			get
+			{
+				return this._DateExpired;
+			}
+			set
+			{
+				if ((this._DateExpired != value))
+				{
+					this.OnDateExpiredChanging(value);
+					this.SendPropertyChanging();
+					this._DateExpired = value;
+					this.SendPropertyChanged("DateExpired");
+					this.OnDateExpiredChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimProject_DimJob", Storage="_DimJobs", ThisKey="Id", OtherKey="ProjectId")]
+		public EntitySet<DimJob> DimJobs
+		{
+			get
+			{
+				return this._DimJobs;
+			}
+			set
+			{
+				this._DimJobs.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimProject_FactProjectInfo", Storage="_FactProjectInfos", ThisKey="Id", OtherKey="ProjectId")]
+		public EntitySet<FactProjectInfo> FactProjectInfos
+		{
+			get
+			{
+				return this._FactProjectInfos;
+			}
+			set
+			{
+				this._FactProjectInfos.Assign(value);
+			}
+		}
+		
+		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_DimJobs(DimJob entity)
+		{
+			this.SendPropertyChanging();
+			entity.DimProject = this;
+		}
+		
+		private void detach_DimJobs(DimJob entity)
+		{
+			this.SendPropertyChanging();
+			entity.DimProject = null;
+		}
+		
+		private void attach_FactProjectInfos(FactProjectInfo entity)
+		{
+			this.SendPropertyChanging();
+			entity.DimProject = this;
+		}
+		
+		private void detach_FactProjectInfos(FactProjectInfo entity)
+		{
+			this.SendPropertyChanging();
+			entity.DimProject = null;
+		}
+	}
 }
 #pragma warning restore 1591
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IPersistenceManager.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IPersistenceManager.cs	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IPersistenceManager.cs	(revision 16117)
@@ -31,5 +31,6 @@
 
     #region Hive daos
-    AssignedResourceDao AssignedResourceDao { get; }
+    AssignedJobResourceDao AssignedJobResourceDao { get; }
+    AssignedProjectResourceDao AssignedProjectResourceDao { get; }
     DowntimeDao DowntimeDao { get; }
     JobDao JobDao { get; }
@@ -38,7 +39,8 @@
     PluginDao PluginDao { get; }
     PluginDataDao PluginDataDao { get; }
+    ProjectDao ProjectDao { get; }
+    ProjectPermissionDao ProjectPermissionDao { get; }
     RequiredPluginDao RequiredPluginDao { get; }
     ResourceDao ResourceDao { get; }
-    ResourcePermissionDao ResourcePermissionDao { get; }
     SlaveDao SlaveDao { get; }
     SlaveGroupDao SlaveGroupDao { get; }
@@ -56,4 +58,6 @@
     FactClientInfoDao FactClientInfoDao { get; }
     FactTaskDao FactTaskDao { get; }
+    DimProjectDao DimProjectDao { get; }
+    FactProjectInfoDao FactProjectInfoDao { get; }
     #endregion
 
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Manager/PersistenceManager.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Manager/PersistenceManager.cs	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Manager/PersistenceManager.cs	(revision 16117)
@@ -38,7 +38,12 @@
     #region Hive daos
 
-    private AssignedResourceDao assignedResourceDao;
-    public AssignedResourceDao AssignedResourceDao {
-      get { return assignedResourceDao ?? (assignedResourceDao = new AssignedResourceDao(dataContext)); }
+    private AssignedJobResourceDao assignedJobResourceDao;
+    public AssignedJobResourceDao AssignedJobResourceDao {
+      get { return assignedJobResourceDao ?? (assignedJobResourceDao = new AssignedJobResourceDao(dataContext)); }
+    }
+
+    private AssignedProjectResourceDao assignedProjectResourceDao;
+    public AssignedProjectResourceDao AssignedProjectResourceDao {
+      get { return assignedProjectResourceDao ?? (assignedProjectResourceDao = new AssignedProjectResourceDao(dataContext)); }
     }
 
@@ -73,4 +78,14 @@
     }
 
+    private ProjectDao projectDao;
+    public ProjectDao ProjectDao {
+      get { return projectDao ?? (projectDao = new ProjectDao(dataContext)); }
+    }
+
+    private ProjectPermissionDao projectPermissionDao;
+    public ProjectPermissionDao ProjectPermissionDao {
+      get { return projectPermissionDao ?? (projectPermissionDao = new ProjectPermissionDao(dataContext)); }
+    }
+
     private RequiredPluginDao requiredPluginDao;
     public RequiredPluginDao RequiredPluginDao {
@@ -83,9 +98,4 @@
     }
 
-    private ResourcePermissionDao resourcePermissionDao;
-    public ResourcePermissionDao ResourcePermissionDao {
-      get { return resourcePermissionDao ?? (resourcePermissionDao = new ResourcePermissionDao(dataContext)); }
-    }
-
     private SlaveDao slaveDao;
     public SlaveDao SlaveDao {
@@ -149,4 +159,14 @@
     public FactTaskDao FactTaskDao {
       get { return factTaskDao ?? (factTaskDao = new FactTaskDao(dataContext)); }
+    }
+
+    private DimProjectDao dimProjectDao;
+    public DimProjectDao DimProjectDao {
+      get { return dimProjectDao ?? (dimProjectDao = new DimProjectDao(dataContext)); }
+    }
+
+    private FactProjectInfoDao factProjectInfoDao;
+    public FactProjectInfoDao FactProjectInfoDao {
+      get { return factProjectInfoDao ?? (factProjectInfoDao = new FactProjectInfoDao(dataContext)); }
     }
     #endregion
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql	(revision 16117)
@@ -17,5 +17,5 @@
  * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
  */
-USE [HeuristicLab.Hive-3.3]
+USE [HeuristicLab.Hive-3.4]
 
 EXEC sp_configure filestream_access_level, 2
@@ -25,8 +25,14 @@
 
 SET ARITHABORT ON
-CREATE TABLE [dbo].[AssignedResources](
+
+CREATE TABLE [dbo].[AssignedProjectResource](
   [ResourceId] UniqueIdentifier NOT NULL,
-  [TaskId] UniqueIdentifier NOT NULL,
-  CONSTRAINT [PK_dbo.ResourceIdTaskId] PRIMARY KEY ([ResourceId], [TaskId])
+  [ProjectId] UniqueIdentifier NOT NULL,
+  CONSTRAINT [PK_dbo.ResourceIdProjectId] PRIMARY KEY ([ResourceId], [ProjectId])
+  )
+CREATE TABLE [dbo].[AssignedJobResource](
+  [ResourceId] UniqueIdentifier NOT NULL,
+  [JobId] UniqueIdentifier NOT NULL,
+  CONSTRAINT [PK_dbo.ResourceIdJobId] PRIMARY KEY ([ResourceId], [JobId])
   )
 CREATE TABLE [dbo].[Plugin](
@@ -67,10 +73,4 @@
   CONSTRAINT [PK_dbo.Resource] PRIMARY KEY ([ResourceId])
   )
-CREATE TABLE [dbo].[ResourcePermission](
-  [ResourceId] UniqueIdentifier NOT NULL,
-  [GrantedUserId] UniqueIdentifier NOT NULL,
-  [GrantedByUserId] UniqueIdentifier NOT NULL,
-  CONSTRAINT [PK_dbo.ResourcePermission] PRIMARY KEY ([ResourceId], [GrantedUserId])
-  )
 CREATE TABLE [dbo].[Task](
   [TaskId] UniqueIdentifier NOT NULL,
@@ -103,7 +103,8 @@
   [Name] VarChar(MAX) NOT NULL,
   [Description] VarChar(MAX),
-  [ResourceIds] VarChar(MAX),
   [OwnerUserId] UniqueIdentifier NOT NULL,
   [DateCreated] DateTime NOT NULL,
+  [ProjectId] UniqueIdentifier NOT NULL,
+  [JobState] VarChar(30) NOT NULL,
   CONSTRAINT [PK_dbo.Job] PRIMARY KEY ([JobId])
   )
@@ -148,32 +149,58 @@
   CONSTRAINT [PK_UserPriority] PRIMARY KEY ([UserId])
   )
-ALTER TABLE [dbo].[AssignedResources]
-  ADD CONSTRAINT [Resource_AssignedResource] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId])
-ALTER TABLE [dbo].[AssignedResources]
-  ADD CONSTRAINT [Task_AssignedResource] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId])
+CREATE TABLE [dbo].[Project](
+  [ProjectId] UniqueIdentifier NOT NULL,
+  [ParentProjectId] UniqueIdentifier,
+  [DateCreated] DateTime NOT NULL,
+  [Name] VarChar(MAX) NOT NULL,
+  [Description] VarChar(MAX),
+  [OwnerUserId] UniqueIdentifier NOT NULL,
+  [StartDate] DateTime NOT NULL,
+  [EndDate] DateTime,
+  CONSTRAINT [PK_dbo.Project] PRIMARY KEY ([ProjectId])
+  )
+CREATE TABLE [dbo].[ProjectPermission](
+  [ProjectId] UniqueIdentifier NOT NULL,
+  [GrantedUserId] UniqueIdentifier NOT NULL,
+  [GrantedByUserId] UniqueIdentifier NOT NULL,
+  CONSTRAINT [PK_dbo.ProjectPermission] PRIMARY KEY ([ProjectId], [GrantedUserId])
+  )
+
+ALTER TABLE [dbo].[AssignedProjectResource]
+  ADD CONSTRAINT [Resource_AssignedProjectResource] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId]) ON UPDATE CASCADE ON DELETE CASCADE;
+ALTER TABLE [dbo].[AssignedProjectResource]
+  ADD CONSTRAINT [Project_AssignedProjectResource] FOREIGN KEY ([ProjectId]) REFERENCES [dbo].[Project]([ProjectId]) ON UPDATE CASCADE ON DELETE CASCADE;
+ALTER TABLE [dbo].[AssignedJobResource]
+  ADD CONSTRAINT [Resource_AssignedJobResource] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId]) ON UPDATE CASCADE ON DELETE CASCADE;
+ALTER TABLE [dbo].[AssignedJobResource]
+  ADD CONSTRAINT [Job_AssignedJobResource] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId]) ON UPDATE CASCADE ON DELETE CASCADE;
 ALTER TABLE [dbo].[RequiredPlugins]
-  ADD CONSTRAINT [Plugin_RequiredPlugin] FOREIGN KEY ([PluginId]) REFERENCES [dbo].[Plugin]([PluginId])
+  ADD CONSTRAINT [Plugin_RequiredPlugin] FOREIGN KEY ([PluginId]) REFERENCES [dbo].[Plugin]([PluginId]) ON UPDATE CASCADE ON DELETE CASCADE;
 ALTER TABLE [dbo].[RequiredPlugins]
-  ADD CONSTRAINT [Task_RequiredPlugin] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId])
+  ADD CONSTRAINT [Task_RequiredPlugin] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId]) ON UPDATE CASCADE ON DELETE CASCADE;
 ALTER TABLE [dbo].[Resource]
-  ADD CONSTRAINT [Resource_Resource] FOREIGN KEY ([ParentResourceId]) REFERENCES [dbo].[Resource]([ResourceId])
-ALTER TABLE [dbo].[ResourcePermission]
-  ADD CONSTRAINT [Resource_ResourcePermission] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId])
+  ADD CONSTRAINT [Resource_Resource] FOREIGN KEY ([ParentResourceId]) REFERENCES [dbo].[Resource]([ResourceId]);
 ALTER TABLE [dbo].[Task]
-  ADD CONSTRAINT [Task_Task] FOREIGN KEY ([ParentTaskId]) REFERENCES [dbo].[Task]([TaskId])
+  ADD CONSTRAINT [Task_Task] FOREIGN KEY ([ParentTaskId]) REFERENCES [dbo].[Task]([TaskId]);
 ALTER TABLE [dbo].[Task]
-  ADD CONSTRAINT [Job_Job] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId])
+  ADD CONSTRAINT [Job_Task] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId]) ON UPDATE CASCADE ON DELETE CASCADE;
 ALTER TABLE [dbo].[Downtime]
-  ADD CONSTRAINT [Resource_Downtime] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId])
+  ADD CONSTRAINT [Resource_Downtime] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId]) ON UPDATE CASCADE ON DELETE CASCADE;
+ALTER TABLE [dbo].[Job]
+	ADD CONSTRAINT [Project_Job] FOREIGN KEY ([ProjectId]) REFERENCES [dbo].[Project]([ProjectId]);
 ALTER TABLE [dbo].[TaskData]
-  ADD CONSTRAINT [Task_TaskData] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId])
+  ADD CONSTRAINT [Task_TaskData] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId]) ON UPDATE CASCADE ON DELETE CASCADE;
 ALTER TABLE [dbo].[PluginData]
-  ADD CONSTRAINT [Plugin_PluginData] FOREIGN KEY ([PluginId]) REFERENCES [dbo].[Plugin]([PluginId])
+  ADD CONSTRAINT [Plugin_PluginData] FOREIGN KEY ([PluginId]) REFERENCES [dbo].[Plugin]([PluginId]) ON UPDATE CASCADE ON DELETE CASCADE;
 ALTER TABLE [dbo].[StateLog]
-  ADD CONSTRAINT [Task_StateLog] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId])
+  ADD CONSTRAINT [Task_StateLog] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId]) ON UPDATE CASCADE ON DELETE CASCADE;
 ALTER TABLE [dbo].[StateLog]
-  ADD CONSTRAINT [Resource_StateLog] FOREIGN KEY ([SlaveId]) REFERENCES [dbo].[Resource]([ResourceId])
+  ADD CONSTRAINT [Resource_StateLog] FOREIGN KEY ([SlaveId]) REFERENCES [dbo].[Resource]([ResourceId]) ON UPDATE CASCADE ON DELETE CASCADE;
 ALTER TABLE [dbo].[JobPermission]
-  ADD CONSTRAINT [Job_JobPermission] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId])
+  ADD CONSTRAINT [Job_JobPermission] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId]) ON UPDATE CASCADE ON DELETE CASCADE;
+ALTER TABLE [dbo].[Project]
+  ADD CONSTRAINT [Project_Project] FOREIGN KEY ([ParentProjectId]) REFERENCES [dbo].[Project]([ProjectId]);
+ALTER TABLE [dbo].[ProjectPermission]
+  ADD CONSTRAINT [Project_ProjectPermission] FOREIGN KEY ([ProjectId]) REFERENCES [dbo].[Project]([ProjectId]) ON UPDATE CASCADE ON DELETE CASCADE;
 
 GO
@@ -192,11 +219,10 @@
 CREATE TABLE [statistics].[DimClient] (
     [Id]               UNIQUEIDENTIFIER CONSTRAINT [DF_DimClient_Id] DEFAULT (newsequentialid()) NOT NULL,
-    [Name]             VARCHAR (MAX)    NOT NULL,
     [ResourceId]       UNIQUEIDENTIFIER NOT NULL,
-    [ExpirationTime]   DATETIME         NULL,
-    [ResourceGroupId]  UNIQUEIDENTIFIER NULL,
-    [ResourceGroup2Id] UNIQUEIDENTIFIER NULL,
-    [GroupName]        VARCHAR (MAX)    NULL,
-    [GroupName2]       VARCHAR (MAX)    NULL,
+	[ParentResourceId] UNIQUEIDENTIFIER NULL,
+	[Name]             VARCHAR (MAX)    NOT NULL,
+	[ResourceType]     VARCHAR (MAX)    NULL,
+	[DateCreated]      DATETIME         NOT NULL,
+    [DateExpired]      DATETIME         NULL
     CONSTRAINT [PK_DimClient] PRIMARY KEY CLUSTERED ([Id] ASC)
 );
@@ -204,4 +230,5 @@
     [JobId]          UNIQUEIDENTIFIER NOT NULL,
     [UserId]         UNIQUEIDENTIFIER NOT NULL,
+	[ProjectId]      UNIQUEIDENTIFIER NOT NULL,
     [JobName]        VARCHAR (MAX)    NOT NULL,
     [UserName]       VARCHAR (MAX)    NOT NULL,
@@ -212,8 +239,35 @@
     CONSTRAINT [PK_DimJob] PRIMARY KEY CLUSTERED ([JobId] ASC)
 );
+CREATE TABLE [statistics].[DimProject] (
+    [Id]               UNIQUEIDENTIFIER CONSTRAINT [DF_DimProject_Id] DEFAULT (newsequentialid()) NOT NULL,
+    [ProjectId]        UNIQUEIDENTIFIER NOT NULL,
+	[ParentProjectId]  UNIQUEIDENTIFIER NULL,
+	[Name]             VARCHAR (MAX)    NOT NULL,
+	[Description]      VARCHAR (MAX)    NULL,
+	[OwnerUserId]      UNIQUEIDENTIFIER NOT NULL,
+	[StartDate]        DATETIME         NOT NULL,
+    [EndDate]          DATETIME         NULL,
+	[DateCreated]      DATETIME         NOT NULL,
+    [DateExpired]      DATETIME         NULL
+	CONSTRAINT [PK_DimProject] PRIMARY KEY CLUSTERED ([Id] ASC)
+);
 CREATE TABLE [statistics].[DimUser] (
     [UserId] UNIQUEIDENTIFIER NOT NULL,
     [Name]   VARCHAR (MAX)    NOT NULL,
     CONSTRAINT [PK_DimUser] PRIMARY KEY CLUSTERED ([UserId] ASC)
+);
+
+
+
+CREATE TABLE [statistics].[FactProjectInfo] (
+	[ProjectId]		UNIQUEIDENTIFIER NOT NULL,
+	[Time]			DATETIME		 NOT NULL,
+	[NumTotalCores]	INT				 NOT NULL,
+	[NumUsedCores]  INT				 NOT NULL,
+	[TotalMemory]	INT				 NOT NULL,
+	[UsedMemory]	INT				 NOT NULL
+	CONSTRAINT [PK_FactProjectInfo] PRIMARY KEY CLUSTERED ([ProjectId] ASC, [Time] ASC),
+	CONSTRAINT [FK_FactProjectInfo_DimTime] FOREIGN KEY ([Time]) REFERENCES [statistics].[DimTime] ([Time]),
+	CONSTRAINT [FK_FactProjectInfo_DimProject] FOREIGN KEY ([ProjectId]) REFERENCES [statistics].[DimProject] ([Id])
 );
 CREATE TABLE [statistics].[FactClientInfo] (
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Prepare Hive Database.sql
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Prepare Hive Database.sql	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Prepare Hive Database.sql	(revision 16117)
@@ -19,14 +19,26 @@
 
 /* this script is supposed to be executed after the plain DB is generated by the linq-to-sql schema */
-USE [HeuristicLab.Hive-3.3]
-
-ALTER TABLE [dbo].[AssignedResources]  DROP  CONSTRAINT [Task_AssignedResource]
-ALTER TABLE [dbo].[AssignedResources]  WITH CHECK ADD  CONSTRAINT [Task_AssignedResource] FOREIGN KEY([TaskId])
-REFERENCES [dbo].[Task] ([TaskId])
-ON UPDATE CASCADE
-ON DELETE CASCADE
-GO
-ALTER TABLE [dbo].[AssignedResources]  DROP  CONSTRAINT [Resource_AssignedResource]
-ALTER TABLE [dbo].[AssignedResources]  WITH CHECK ADD  CONSTRAINT [Resource_AssignedResource] FOREIGN KEY([ResourceId])
+USE [HeuristicLab.Hive-3.4]
+
+ALTER TABLE [dbo].[AssignedProjectResource]  DROP  CONSTRAINT [Project_AssignedProjectResource]
+ALTER TABLE [dbo].[AssignedProjectResource]  WITH CHECK ADD  CONSTRAINT [Project_AssignedProjectResource] FOREIGN KEY([ProjectId])
+REFERENCES [dbo].[Project] ([ProjectId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+ALTER TABLE [dbo].[AssignedProjectResource]  DROP  CONSTRAINT [Resource_AssignedProjectResource]
+ALTER TABLE [dbo].[AssignedProjectResource]  WITH CHECK ADD  CONSTRAINT [Resource_AssignedProjectResource] FOREIGN KEY([ResourceId])
+REFERENCES [dbo].[Resource] ([ResourceId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+ALTER TABLE [dbo].[AssignedJobResource]  DROP  CONSTRAINT [Job_AssignedJobResource]
+ALTER TABLE [dbo].[AssignedJobResource]  WITH CHECK ADD  CONSTRAINT [Job_AssignedJobResource] FOREIGN KEY([JobId])
+REFERENCES [dbo].[Job] ([JobId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+ALTER TABLE [dbo].[AssignedJobResource]  DROP  CONSTRAINT [Resource_AssignedJobResource]
+ALTER TABLE [dbo].[AssignedJobResource]  WITH CHECK ADD  CONSTRAINT [Resource_AssignedJobResource] FOREIGN KEY([ResourceId])
 REFERENCES [dbo].[Resource] ([ResourceId])
 ON UPDATE CASCADE
@@ -88,4 +100,9 @@
 ALTER TABLE dbo.Job ALTER COLUMN JobId ADD ROWGUIDCOL;
 ALTER TABLE dbo.Job WITH NOCHECK ADD CONSTRAINT [DF_Job_JobId] DEFAULT (NEWSEQUENTIALID()) FOR JobId;
+ALTER TABLE [dbo].[Job]  DROP  CONSTRAINT [Project_Job]
+ALTER TABLE [dbo].[Job]  WITH CHECK ADD  CONSTRAINT [Project_Job] FOREIGN KEY([ProjectId])
+REFERENCES [dbo].[Project] ([ProjectId])
+ON UPDATE CASCADE
+GO
 
 ALTER TABLE dbo.StateLog ALTER COLUMN StateLogId ADD ROWGUIDCOL;
@@ -99,7 +116,10 @@
 GO
 
-ALTER TABLE [dbo].[ResourcePermission]  DROP  CONSTRAINT [Resource_ResourcePermission]
-ALTER TABLE [dbo].[ResourcePermission]  WITH CHECK ADD CONSTRAINT [Resource_ResourcePermission] FOREIGN KEY([ResourceId])
-REFERENCES [dbo].[Resource] ([ResourceId])
+ALTER TABLE dbo.Project ALTER COLUMN ProjectId ADD ROWGUIDCOL;
+ALTER TABLE dbo.Project WITH NOCHECK ADD CONSTRAINT [DF_Project_ProjectId] DEFAULT (NEWSEQUENTIALID()) FOR ProjectId;
+
+ALTER TABLE [dbo].[ProjectPermission]  DROP  CONSTRAINT [Project_ProjectPermission]
+ALTER TABLE [dbo].[ProjectPermission]  WITH CHECK ADD CONSTRAINT [Project_ProjectPermission] FOREIGN KEY([ProjectId])
+REFERENCES [dbo].[Project] ([ProjectId])
 ON UPDATE CASCADE
 ON DELETE CASCADE
@@ -123,4 +143,6 @@
 
 
+
+-- OBSOLETE - DO NOT PERFORM (start)
 /****** Object:  Trigger [dbo].[tr_JobDeleteCascade]    Script Date: 04/19/2011 16:31:53 ******/
 SET ANSI_NULLS ON
@@ -175,4 +197,4 @@
 END
 GO
-
-
+-- OBSOLETE (end)
+
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.Designer.cs
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.Designer.cs	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.Designer.cs	(revision 16117)
@@ -13,5 +13,5 @@
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]
     public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
@@ -21,15 +21,4 @@
             get {
                 return defaultInstance;
-            }
-        }
-        
-        [global::System.Configuration.ApplicationScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
-        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=.\\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hi" +
-            "ve-3.3")]
-        public string HeuristicLab_Hive_LinqConnectionString {
-            get {
-                return ((string)(this["HeuristicLab_Hive_LinqConnectionString"]));
             }
         }
@@ -52,4 +41,15 @@
             }
         }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
+        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=localhost;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-" +
+            "3.4")]
+        public string HeuristicLab_Hive_LinqConnectionString {
+            get {
+                return ((string)(this["HeuristicLab_Hive_LinqConnectionString"]));
+            }
+        }
     }
 }
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.settings
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.settings	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.settings	(revision 16117)
@@ -3,12 +3,4 @@
   <Profiles />
   <Settings>
-    <Setting Name="HeuristicLab_Hive_LinqConnectionString" Type="(Connection string)" Scope="Application">
-      <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
-&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;ConnectionString&gt;Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.3&lt;/ConnectionString&gt;
-  &lt;ProviderName&gt;System.Data.SqlClient&lt;/ProviderName&gt;
-&lt;/SerializableConnectionString&gt;</DesignTimeValue>
-      <Value Profile="(Default)">Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.3</Value>
-    </Setting>
     <Setting Name="LongRunningDatabaseCommandTimeout" Type="System.TimeSpan" Scope="Application">
       <Value Profile="(Default)">00:05:00</Value>
@@ -17,4 +9,11 @@
       <Value Profile="(Default)">HL.Hive</Value>
     </Setting>
+    <Setting Name="HeuristicLab_Hive_LinqConnectionString" Type="(Connection string)" Scope="Application">
+      <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
+&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;ConnectionString&gt;Data Source=localhost;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.4&lt;/ConnectionString&gt;
+&lt;/SerializableConnectionString&gt;</DesignTimeValue>
+      <Value Profile="(Default)">Data Source=localhost;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.4</Value>
+    </Setting>
   </Settings>
 </SettingsFile>
Index: trunk/HeuristicLab.Services.Hive.DataAccess/3.3/app.config
===================================================================
--- trunk/HeuristicLab.Services.Hive.DataAccess/3.3/app.config	(revision 15682)
+++ trunk/HeuristicLab.Services.Hive.DataAccess/3.3/app.config	(revision 16117)
@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
+  <configSections>
+  </configSections>
   <connectionStrings>
-    <add name="HeuristicLab.Services.Hive.DataAccess.Settings.HeuristicLab_Hive_LinqConnectionString" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.4" />
+    <add name="HeuristicLab.Services.Hive.DataAccess.Settings.HeuristicLab_Hive_LinqConnectionString"
+      connectionString="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.4" />
   </connectionStrings>
 
