Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/30/18 11:32:56 (6 years ago)
Author:
jkarder
Message:

#2839: merged [15377-16116/branches/2839_HiveProjectManagement] into trunk

Location:
trunk
Files:
18 edited
6 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/HeuristicLab.Services.Hive.DataAccess

  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/DimClientDao.cs

    r15583 r16117  
    3333    }
    3434
    35     public IQueryable<DimClient> GetActiveClients() {
    36       return Table.Where(x => x.ExpirationTime == null);
     35    public IQueryable<DimClient> GetAllOnlineClients() {
     36      return Table.Where(x => x.DateExpired == null);
    3737    }
    3838
    39     public IQueryable<DimClient> GetExpiredClients() {
    40       return Table.Where(x => x.ExpirationTime != null);
     39    public IQueryable<DimClient> GetAllExpiredClients() {
     40      return Table.Where(x => x.DateExpired != null);
     41    }
     42
     43    public IQueryable<DimClient> GetAllOnlineSlaves() {
     44      return Table.Where(x => x.DateExpired == null && x.ResourceType == "Slave");
     45    }
     46
     47    public IQueryable<DimClient> GetAllOnlineSlaveGroups() {
     48      return Table.Where(x => x.DateExpired == null && x.ResourceType == "GROUP");
     49    }
     50
     51    public IQueryable<DimClient> GetAllExpiredSlaves() {
     52      return Table.Where(x => x.DateExpired != null && x.ResourceType == "Slave");
     53    }
     54
     55    public IQueryable<DimClient> GetAllExpiredSlaveGroups() {
     56      return Table.Where(x => x.DateExpired != null && x.ResourceType == "GROUP");
    4157    }
    4258
     
    4460      string paramIds = string.Join(",", ids.Select(x => string.Format("'{0}'", x)));
    4561      if (!string.IsNullOrWhiteSpace(paramIds)) {
    46         string query = string.Format(UpdateExpirationTimeQuery, "{0}", paramIds);
     62        string query = string.Format(UpdateDateExpiredQuery, "{0}", paramIds);
    4763        return DataContext.ExecuteCommand(query, time);
    4864      }
     
    5975
    6076    #region String queries
    61     private const string UpdateExpirationTimeQuery =
     77    private const string UpdateDateExpiredQuery =
    6278      @"UPDATE [statistics].[DimClient]
    63            SET ExpirationTime = {0}
     79           SET DateExpired = {0}
    6480         WHERE Id IN ({1});";
    6581    #endregion
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/DimProjectDao.cs

    r15760 r16117  
    5555        (from dimProject in db.GetTable<DimProject>()
    5656         where dimProject.ProjectId == projectId
    57          select dimProject).ToList());
     57         select dimProject));
    5858    private static readonly Func<DataContext, Guid, Guid> GetLastValidIdByProjectIdQuery =
    5959      CompiledQuery.Compile((DataContext db, Guid projectId) =>
     
    6767        (from dimProject in db.GetTable<DimProject>()
    6868         where dimProject.DateExpired == null
    69          select dimProject).ToList());
     69         select dimProject));
    7070    #endregion
    7171  }
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/HiveStatistics/FactTaskDao.cs

    r15583 r16117  
    6666      return from factTask in Table
    6767             join client in DimClientTable on factTask.LastClientId equals client.Id
    68              where client.ResourceGroupId == id
     68             where client.ParentResourceId == id
    6969             select factTask;
    7070    }
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/JobDao.cs

    r15583 r16117  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Data.Linq;
    2425using System.Linq;
     
    3233    }
    3334
     35    public void DeleteByState(JobState state) {
     36      DataContext.ExecuteCommand(DeleteByStateQueryString, Enum.GetName(typeof(JobState), state));
     37    }
     38
     39    public IEnumerable<Job> GetByProjectId(Guid id) {
     40      return GetByProjectIdQuery(DataContext, id);
     41    }
     42
     43    public IEnumerable<Job> GetByProjectIds(IEnumerable<Guid> projectIds) {
     44      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
     45      if(!string.IsNullOrWhiteSpace(paramProjectIds)) {
     46        string queryString = string.Format(GetByProjectIdsQueryString, paramProjectIds);
     47        return DataContext.ExecuteQuery<Job>(queryString);
     48      }
     49      return Enumerable.Empty<Job>();
     50    }
     51
     52    public IEnumerable<Job> GetByState(JobState state) {
     53      return GetByStateQuery(DataContext, state);
     54    }
     55
     56    public IEnumerable<Guid> GetJobIdsByState(JobState state) {
     57      return GetJobIdsByStateQuery(DataContext, state);
     58    }
     59
     60    public IEnumerable<Job> GetJobsReadyForDeletion() {
     61      return GetJobsReadyForDeletionQuery(DataContext);
     62    }
     63
     64
    3465    #region Compiled queries
    3566    private static readonly Func<DataContext, Guid, Job> GetByIdQuery =
     
    3869         where job.JobId == jobId
    3970         select job).SingleOrDefault());
     71    private static readonly Func<DataContext, Guid, IEnumerable<Job>> GetByProjectIdQuery =
     72      CompiledQuery.Compile((DataContext db, Guid projectId) =>
     73        (from job in db.GetTable<Job>()
     74         where job.ProjectId == projectId
     75         select job));
     76    private static readonly Func<DataContext, JobState, IEnumerable<Job>> GetByStateQuery =
     77      CompiledQuery.Compile((DataContext db, JobState jobState) =>
     78        (from job in db.GetTable<Job>()
     79         where job.State == jobState
     80         select job));
     81    private static readonly Func<DataContext, JobState, IEnumerable<Guid>> GetJobIdsByStateQuery =
     82      CompiledQuery.Compile((DataContext db, JobState jobState) =>
     83        (from job in db.GetTable<Job>()
     84         where job.State == jobState
     85         select job.JobId));
     86    private static readonly Func<DataContext, IEnumerable<Job>> GetJobsReadyForDeletionQuery =
     87      CompiledQuery.Compile((DataContext db) =>
     88        (from job in db.GetTable<Job>()
     89         where job.State == JobState.StatisticsPending
     90         && (from task in db.GetTable<Task>()
     91             where task.JobId == job.JobId
     92             select task.State == TaskState.Finished
     93              || task.State == TaskState.Aborted
     94              || task.State == TaskState.Failed).All(x => x)
     95         select job));
     96    #endregion
     97
     98    #region String queries
     99    private const string DeleteByStateQueryString = @"
     100      DELETE FROM [Job]
     101      WHERE JobState = {0}
     102    ";
     103    private const string GetStatisticsPendingJobs = @"
     104      SELECT DISTINCT j.*
     105      FROM [Job] j
     106      WHERE j.JobState = 'StatisticsPending'
     107      AND 'Calculating' NOT IN (
     108        SELECT t.TaskState
     109        FROM [Task] t
     110        WHERE t.JobId = j.JobId)
     111    ";
     112    private const string GetByProjectIdsQueryString = @"
     113      SELECT DISTINCT j.*
     114      FROM [Job] j
     115      WHERE j.ProjectId IN ({0})
     116    ";
    40117    #endregion
    41118  }
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectPermissionDao.cs

    r16116 r16117  
    2626
    2727namespace HeuristicLab.Services.Hive.DataAccess.Daos {
    28   public class ResourcePermissionDao : GenericDao<Guid, ResourcePermission> {
    29     public ResourcePermissionDao(DataContext dataContext) : base(dataContext) { }
     28  public class ProjectPermissionDao : GenericDao<Guid, ProjectPermission> {
     29    public ProjectPermissionDao(DataContext dataContext) : base(dataContext) { }
    3030
    31     public override ResourcePermission GetById(Guid id) {
     31    public override ProjectPermission GetById(Guid id) {
    3232      throw new NotImplementedException();
    3333    }
    3434
    35     public IEnumerable<ResourcePermission> GetByResourceId(Guid id) {
    36       return GetByResourceIdGetByIdQuery(DataContext, id);
     35    public IEnumerable<ProjectPermission> GetByProjectId(Guid id) {
     36      return GetByProjectIdGetByIdQuery(DataContext, id);
    3737    }
    3838
    39     public void DeleteByResourceAndGrantedUserId(Guid resourceId, IEnumerable<Guid> grantedUserId) {
    40       string paramIds = string.Join(",", grantedUserId.Select(x => string.Format("'{0}'", x)));
     39    public bool CheckUserGrantedForProject(Guid projectId, IEnumerable<Guid> userAndGroupIds) {
     40      string paramUserAndGroupIds = string.Join(",", userAndGroupIds.ToList().Select(x => string.Format("'{0}'", x)));
     41      if(!string.IsNullOrWhiteSpace(paramUserAndGroupIds)) {
     42        string queryString = string.Format(CheckUserGrantedForProjectQueryString, projectId, paramUserAndGroupIds);
     43        return DataContext.ExecuteQuery<int>(queryString).First() > 0;
     44      }
     45      return false;
     46    }
     47
     48    public void DeleteByProjectIdAndGrantedUserIds(Guid projectId, IEnumerable<Guid> grantedUserIds) {
     49      string paramIds = string.Join(",", grantedUserIds.ToList().Select(x => string.Format("'{0}'", x)));
    4150      if (!string.IsNullOrWhiteSpace(paramIds)) {
    42         string query = string.Format(DeleteByGrantedUserQuery, resourceId, paramIds);
     51        string query = string.Format(DeleteByProjectIdAndGrantedUserIdsQueryString, projectId, paramIds);
     52        DataContext.ExecuteCommand(query);
     53      }
     54    }
     55
     56    public void DeleteByProjectIdsAndGrantedUserIds(IEnumerable<Guid> projectIds, IEnumerable<Guid> grantedUserIds) {
     57      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
     58      string paramUserIds = string.Join(",", grantedUserIds.ToList().Select(x => string.Format("'{0}'", x)));
     59      if (!string.IsNullOrWhiteSpace(paramProjectIds) && !string.IsNullOrWhiteSpace(paramUserIds)) {
     60        string query = string.Format(DeleteByProjectIdsAndGrantedUserIdsQueryString, paramProjectIds, paramUserIds);
    4361        DataContext.ExecuteCommand(query);
    4462      }
     
    4664
    4765    #region Compiled queries
    48     private static readonly Func<DataContext, Guid, IEnumerable<ResourcePermission>> GetByResourceIdGetByIdQuery =
    49       CompiledQuery.Compile((DataContext db, Guid resourceId) =>
    50         from resourcePermission in db.GetTable<ResourcePermission>()
    51         where resourcePermission.ResourceId == resourceId
    52         select resourcePermission);
     66    private static readonly Func<DataContext, Guid, IEnumerable<ProjectPermission>> GetByProjectIdGetByIdQuery =
     67      CompiledQuery.Compile((DataContext db, Guid projectId) =>
     68        from projectPermission in db.GetTable<ProjectPermission>()
     69        where projectPermission.ProjectId == projectId
     70        select projectPermission);
    5371    #endregion
    5472
    5573    #region String queries
    56     private const string DeleteByGrantedUserQuery =
    57       @"DELETE FROM [ResourcePermission]
    58          WHERE ResourceId = '{0}'
    59            AND GrantedUserId IN ({1});";
     74    private const string DeleteByProjectIdAndGrantedUserIdsQueryString = @"
     75      DELETE FROM [ProjectPermission]
     76      WHERE ProjectId = '{0}'
     77      AND GrantedUserId IN ({1});
     78    ";
     79    private const string DeleteByProjectIdsAndGrantedUserIdsQueryString = @"
     80      DELETE FROM [ProjectPermission]
     81      WHERE ProjectId IN ({0})
     82      AND GrantedUserId IN ({1});
     83    ";
     84    private const string CheckUserGrantedForProjectQueryString = @"
     85      SELECT COUNT(pp.ProjectId)
     86      FROM [ProjectPermission] pp
     87      WHERE pp.ProjectId = '{0}'
     88      AND pp.GrantedUserId IN ({1})
     89    ";
     90    private const string GetGrantedProjectsForUserQueryString = @"
     91      SELECT DISTINCT p.*
     92      FROM [ProjectPermission] pp, [Project] p
     93      WHERE pp.GrantedUserId IN ({0})
     94      AND  pp.ProjectId = p.ProjectId
     95    ";
    6096    #endregion
    6197  }
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs

    r15583 r16117  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Data.Linq;
    2425using System.Linq;
     
    3637    }
    3738
     39    public void DeleteByIds(IEnumerable<Guid> ids) {
     40      string paramResourceIds = string.Join(",", ids.ToList().Select(x => string.Format("'{0}'", x)));
     41      if (!string.IsNullOrWhiteSpace(paramResourceIds)) {
     42        string queryString = string.Format(DeleteByIdsQueryString, paramResourceIds);
     43        DataContext.ExecuteCommand(queryString);
     44      }
     45    }
     46
     47    public bool CheckExistence(IEnumerable<Guid> ids) {
     48      string paramResourceIds = string.Join(",", ids.ToList().Select(x => string.Format("'{0}'", x)));
     49      if (!string.IsNullOrWhiteSpace(paramResourceIds)) {
     50        string queryString = string.Format(CountExistenceQuery, paramResourceIds);
     51        return DataContext.ExecuteQuery<int>(queryString).SingleOrDefault() == ids.Count();
     52      }
     53      return false;
     54    }
     55
    3856    public IQueryable<Resource> GetResourcesWithValidOwner() {
    3957      return Table.Where(x => x.OwnerUserId != null);
     58    }
     59
     60    public IEnumerable<Resource> GetChildResourcesById(Guid id) {
     61      return DataContext.ExecuteQuery<Resource>(GetChildResourcesByIdQuery, id);
     62    }
     63
     64    public IEnumerable<Guid> GetChildResourceIdsById(Guid id) {
     65      return DataContext.ExecuteQuery<Guid>(GetChildResourceIdsByIdQuery, id);
     66    }
     67
     68    public IEnumerable<Resource> GetParentResourcesById(Guid id) {
     69      return DataContext.ExecuteQuery<Resource>(GetParentResourcesByIdQuery, id);
     70    }
     71
     72    public IEnumerable<Guid> GetParentResourceIdsById(Guid id) {
     73      return DataContext.ExecuteQuery<Guid>(GetParentResourceIdsByIdQuery, id);
     74    }
     75
     76    public IEnumerable<Resource> GetCurrentAndParentResourcesById(Guid id) {
     77      return DataContext.ExecuteQuery<Resource>(GetCurrentAndParentResourcesByIdQuery, id);
     78    }
     79
     80    public IEnumerable<Guid> GetCurrentAndParentResourceIdsById(Guid id) {
     81      return DataContext.ExecuteQuery<Guid>(GetCurrentAndParentResourceIdsByIdQuery, id);
    4082    }
    4183
     
    5395        select resource).FirstOrDefault());
    5496    #endregion
     97
     98    #region String queries
     99    private const string DeleteByIdsQueryString = @"
     100      DELETE FROM [Resource]
     101      WHERE ResourceId IN ({0})
     102    ";
     103    private const string CountExistenceQuery = @"
     104      SELECT COUNT(DISTINCT r.ResourceId)
     105      FROM [Resource] r
     106      WHERE r.ResourceId IN ({0})
     107    ";
     108    private const string GetChildResourcesByIdQuery = @"
     109      WITH rtree AS
     110      (
     111        SELECT ResourceId, ParentResourceId
     112        FROM [Resource]
     113        UNION ALL
     114        SELECT rt.ResourceId, r.ParentResourceId
     115        FROM [Resource] r
     116        JOIN rtree rt ON rt.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rt.ParentResourceId <> rt.ResourceId
     117      )
     118      SELECT DISTINCT res.*
     119      FROM rtree, [Resource] res
     120      WHERE rtree.ParentResourceId = {0}
     121      AND rtree.ResourceId = res.ResourceId
     122    ";
     123    private const string GetChildResourceIdsByIdQuery = @"
     124      WITH rtree AS
     125      (
     126        SELECT ResourceId, ParentResourceId
     127        FROM [Resource]
     128        UNION ALL
     129        SELECT rt.ResourceId, r.ParentResourceId
     130        FROM [Resource] r
     131        JOIN rtree rt ON rt.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rt.ParentResourceId <> rt.ResourceId
     132      )
     133      SELECT DISTINCT rtree.ResourceId
     134      FROM rtree
     135      WHERE rtree.ParentResourceId = {0}
     136    ";
     137    private const string GetParentResourcesByIdQuery = @"
     138      WITH rbranch AS
     139      (
     140        SELECT ResourceId, ParentResourceId
     141        FROM [Resource]
     142        UNION ALL
     143        SELECT rb.ResourceId, r.ParentResourceId
     144        FROM [Resource] r
     145        JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rb.ParentResourceId <> rb.ResourceId
     146      )
     147      SELECT DISTINCT res.*
     148      FROM rbranch, [Resource] res
     149      WHERE rbranch.ResourceId = {0}
     150      AND rbranch.ParentResourceId = res.ResourceId
     151    ";
     152    private const string GetParentResourceIdsByIdQuery = @"
     153      WITH rbranch AS
     154      (
     155        SELECT ResourceId, ParentResourceId
     156        FROM [Resource]
     157        UNION ALL
     158        SELECT rb.ResourceId, r.ParentResourceId
     159        FROM [Resource] r
     160        JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rb.ParentResourceId <> rb.ResourceId
     161      )
     162      SELECT DISTINCT rbranch.ParentResourceId
     163      FROM rbranch
     164      WHERE rbranch.ResourceId = {0}
     165    ";
     166    private const string GetCurrentAndParentResourcesByIdQuery = @"
     167      WITH rbranch AS
     168      (
     169        SELECT ResourceId, ParentResourceId
     170        FROM [Resource]
     171        WHERE ResourceId = {0}
     172        UNION ALL
     173        SELECT r.ResourceId, r.ParentResourceId
     174        FROM [Resource] r
     175        JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId
     176      )
     177      SELECT DISTINCT res.*
     178      FROM rbranch, [Resource] res
     179      WHERE rbranch.ResourceId = res.ResourceId
     180    ";
     181    private const string GetCurrentAndParentResourceIdsByIdQuery = @"
     182      WITH rbranch AS
     183      (
     184        SELECT ResourceId, ParentResourceId
     185        FROM [Resource]
     186        WHERE ResourceId = {0}
     187        UNION ALL
     188        SELECT r.ResourceId, r.ParentResourceId
     189        FROM [Resource] r
     190        JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId
     191      )
     192      SELECT DISTINCT rbranch.ResourceId
     193      FROM rbranch
     194    ";
     195    #endregion
    55196  }
    56197}
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/TaskDao.cs

    r15583 r16117  
    2727namespace HeuristicLab.Services.Hive.DataAccess.Daos {
    2828  public class TaskDao : GenericDao<Guid, Task> {
    29     private Table<AssignedResource> AssignedResourceTable {
    30       get { return DataContext.GetTable<AssignedResource>(); }
    31     }
    32 
    3329    public TaskDao(DataContext dataContext) : base(dataContext) { }
    3430
     
    5450      //Because there is at the moment no case where this makes sense (there don't exist parent tasks which need to be calculated),
    5551      //we skip this step because it's wasted runtime
    56       return DataContext.ExecuteQuery<TaskPriorityInfo>(GetWaitingTasksQueryString, slave.ResourceId, Enum.GetName(typeof(TaskState), TaskState.Waiting), slave.FreeCores, slave.FreeMemory).ToList();
     52      return DataContext.ExecuteQuery<TaskPriorityInfo>(GetWaitingTasksQueryString,
     53        slave.ResourceId,
     54        Enum.GetName(typeof(TaskState), TaskState.Waiting),
     55        slave.FreeCores,
     56        slave.FreeMemory).ToList();
    5757    }
    5858
     
    6262    /// <param name="resourceIds">list of resourceids which for which the task should be valid</param>
    6363    /// <param name="count">maximum number of task to return</param>
    64     /// <param name="finished">if true, all parent task which have FinishWhenChildJobsFinished=true are returned, otherwise only FinishWhenChildJobsFinished=false are returned</param>
     64    /// <param name="finished">if true, all parent tasks which have FinishWhenChildJobsFinished=true are returned, otherwise only FinishWhenChildJobsFinished=false are returned</param>
    6565    /// <returns></returns>
    6666    public IEnumerable<Task> GetParentTasks(IEnumerable<Guid> resourceIds, int count, bool finished) {
    67       var query = from ar in AssignedResourceTable
    68                   where resourceIds.Contains(ar.ResourceId)
    69                      && ar.Task.State == TaskState.Waiting
    70                      && ar.Task.IsParentTask
    71                      && (finished ? ar.Task.FinishWhenChildJobsFinished : !ar.Task.FinishWhenChildJobsFinished)
    72                      && (from child in Table
    73                          where child.ParentTaskId == ar.Task.TaskId
    74                          select child.State == TaskState.Finished
    75                              || child.State == TaskState.Aborted
    76                              || child.State == TaskState.Failed).All(x => x)
    77                      && (from child in Table // avoid returning WaitForChildTasks task where no child-task exist (yet)
    78                          where child.ParentTaskId == ar.Task.TaskId
    79                          select child).Any()
    80                   orderby ar.Task.Priority descending
    81                   select ar.Task;
     67    var query = from t in Table
     68                where t.State == TaskState.Waiting
     69                    && t.IsParentTask
     70                    && t.Job.AssignedJobResources.All(x => resourceIds.ToList().Contains(x.ResourceId))
     71                    && t.FinishWhenChildJobsFinished == finished
     72                    && t.ChildJobs.Any()
     73                    && t.ChildJobs.All(x =>
     74                      x.State == TaskState.Finished
     75                      || x.State == TaskState.Aborted
     76                      || x.State == TaskState.Failed)
     77                  orderby t.Priority descending
     78                  select t;
    8279      return count == 0 ? query.ToArray() : query.Take(count).ToArray();
    8380    }
     
    9693
    9794    #region String queries
     95    private const string GetCalculatingChildTasksByProjectId = @"
     96      SELECT t.* FROM [Task] t, [Job] j
     97        WHERE t.IsParentTask = 0
     98        AND t.TaskState = 'Calculating'
     99        AND t.JobId = j.JobId
     100        AND j.ProjectId = {0}
     101        ORDER BY j.ProjectId
     102    ";
    98103    private const string GetWaitingTasksQueryString = @"
    99       WITH pr AS (
     104      WITH rbranch AS (
    100105        SELECT ResourceId, ParentResourceId
    101106        FROM [Resource]
     
    103108        UNION ALL
    104109        SELECT r.ResourceId, r.ParentResourceId
    105         FROM [Resource] r JOIN pr ON r.ResourceId = pr.ParentResourceId
     110        FROM [Resource] r
     111        JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId
    106112      )
    107113      SELECT DISTINCT t.TaskId, t.JobId, t.Priority
    108       FROM pr JOIN AssignedResources ar ON ar.ResourceId = pr.ResourceId
    109           JOIN Task t ON t.TaskId = ar.TaskId
     114      FROM [Task] t, [Job] j, [AssignedJobResource] ajr, rbranch
    110115      WHERE NOT (t.IsParentTask = 1 AND t.FinishWhenChildJobsFinished = 1)
    111           AND t.TaskState = {1}
    112           AND t.CoresNeeded <= {2}
    113           AND t.MemoryNeeded <= {3}
     116      AND t.TaskState = {1}
     117      AND t.CoresNeeded <= {2}
     118      AND t.MemoryNeeded <= {3}
     119      AND t.JobId = j.JobId
     120      AND j.JobState = 'Online'
     121      AND j.JobId = ajr.JobId
     122      AND ajr.ResourceId = rbranch.ResourceId
    114123    ";
    115124
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj

    r12878 r16117  
    104104  <ItemGroup>
    105105    <None Include="Plugin.cs.frame" />
    106     <Compile Include="Daos\AssignedResourceDao.cs" />
     106    <Compile Include="Daos\AssignedJobResourceDao.cs" />
     107    <Compile Include="Daos\AssignedProjectResourceDao.cs" />
    107108    <Compile Include="Daos\DowntimeDao.cs" />
    108109    <Compile Include="Daos\GenericDao.cs" />
    109110    <Compile Include="Daos\HiveStatistics\DimClientDao.cs" />
    110111    <Compile Include="Daos\HiveStatistics\DimJobDao.cs" />
     112    <Compile Include="Daos\HiveStatistics\DimProjectDao.cs" />
    111113    <Compile Include="Daos\HiveStatistics\DimTimeDao.cs" />
    112114    <Compile Include="Daos\HiveStatistics\DimUserDao.cs" />
    113115    <Compile Include="Daos\HiveStatistics\FactClientInfoDao.cs" />
     116    <Compile Include="Daos\HiveStatistics\FactProjectInfoDao.cs" />
    114117    <Compile Include="Daos\HiveStatistics\FactTaskDao.cs" />
    115118    <Compile Include="Daos\JobDao.cs" />
     
    118121    <Compile Include="Daos\PluginDao.cs" />
    119122    <Compile Include="Daos\PluginDataDao.cs" />
     123    <Compile Include="Daos\ProjectDao.cs" />
     124    <Compile Include="Daos\ProjectPermissionDao.cs" />
    120125    <Compile Include="Daos\RequiredPluginDao.cs" />
    121126    <Compile Include="Daos\ResourceDao.cs" />
    122     <Compile Include="Daos\ResourcePermissionDao.cs" />
    123127    <Compile Include="Daos\SlaveDao.cs" />
    124128    <Compile Include="Daos\SlaveGroupDao.cs" />
     
    128132    <Compile Include="Daos\UserPriorityDao.cs" />
    129133    <Compile Include="Data\TableInformation.cs" />
     134    <Compile Include="Enums\JobState.cs" />
    130135    <Compile Include="Interfaces\IGenericDao.cs" />
    131136    <Compile Include="Enums\Command.cs" />
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml

    r14748 r16117  
    11<?xml version="1.0" encoding="utf-8"?><Database Name="HeuristicLab.Hive" Class="HiveDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
    2   <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" />
    3   <Table Name="dbo.AssignedResources" Member="AssignedResources">
    4     <Type Name="AssignedResource">
     2  <Table Name="dbo.AssignedProjectResource" Member="AssignedProjectResources">
     3    <Type Name="AssignedProjectResource">
    54      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    6       <Column Name="TaskId" Storage="_JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    7       <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
    8       <Association Name="Task_AssignedResource" Member="Task" Storage="_Job" ThisKey="TaskId" OtherKey="TaskId" Type="Task" IsForeignKey="true" DeleteRule="CASCADE" />
     5      <Column Name="ProjectId" Storage="_JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
     6      <Association Name="Resource_AssignedProjectResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
     7      <Association Name="Project_AssignedProjectResource" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" DeleteRule="CASCADE" />
    98    </Type>
    109  </Table>
     
    3837      <Column Name="HbInterval" Type="System.Int32" DbType="Int" CanBeNull="false" />
    3938      <Column Name="OwnerUserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
    40       <Association Name="Resource_AssignedResource" Member="AssignedResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedResource" />
     39      <Association Name="Resource_AssignedProjectResource" Member="AssignedProjectResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedProjectResource" />
    4140      <Association Name="Resource_Resource" Member="ChildResources" ThisKey="ResourceId" OtherKey="ParentResourceId" Type="Resource" />
    4241      <Association Name="Resource_Downtime" Member="Downtimes" Storage="_UptimeCalendars" ThisKey="ResourceId" OtherKey="ResourceId" Type="Downtime" />
    4342      <Association Name="Resource_StateLog" Member="StateLogs" ThisKey="ResourceId" OtherKey="SlaveId" Type="StateLog" />
    44       <Association Name="Resource_ResourcePermission" Member="ResourcePermissions" ThisKey="ResourceId" OtherKey="ResourceId" Type="ResourcePermission" />
     43      <Association Name="Resource_AssignedJobResource" Member="AssignedJobResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedJobResource" />
    4544      <Association Name="Resource_Resource" Member="ParentResource" ThisKey="ParentResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
    4645      <Type Name="Slave" InheritanceCode="Slave" IsInheritanceDefault="true">
     
    7675      <Column Name="Command" Type="global::HeuristicLab.Services.Hive.DataAccess.Command?" DbType="VarChar(30)" CanBeNull="true" />
    7776      <Column Name="JobId" Storage="_HiveExperimentId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
    78       <Association Name="Task_AssignedResource" Member="AssignedResources" ThisKey="TaskId" OtherKey="TaskId" Type="AssignedResource" />
    7977      <Association Name="Task_RequiredPlugin" Member="RequiredPlugins" ThisKey="TaskId" OtherKey="TaskId" Type="RequiredPlugin" />
    8078      <Association Name="Task_Task" Member="ChildJobs" Storage="_Jobs" ThisKey="TaskId" OtherKey="ParentTaskId" Type="Task" />
     
    103101      <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
    104102      <Column Name="Description" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
    105       <Column Name="ResourceIds" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
    106103      <Column Name="OwnerUserId" Storage="_UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
    107104      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
     105      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
     106      <Column Name="JobState" Member="State" Type="global::HeuristicLab.Services.Hive.DataAccess.JobState" DbType="VarChar(30)" CanBeNull="false" />
    108107      <Association Name="Job_Task" Member="Tasks" Storage="_Jobs" ThisKey="JobId" OtherKey="JobId" Type="Task" />
    109108      <Association Name="Job_JobPermission" Member="JobPermissions" Storage="_HiveExperimentPermissions" ThisKey="JobId" OtherKey="JobId" Type="JobPermission" />
     109      <Association Name="Job_AssignedJobResource" Member="AssignedJobResources" ThisKey="JobId" OtherKey="JobId" Type="AssignedJobResource" />
     110      <Association Name="Project_Job" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" />
    110111    </Type>
    111112  </Table>
     
    155156    </Type>
    156157  </Table>
    157   <Table Name="dbo.ResourcePermission" Member="ResourcePermissions">
    158     <Type Name="ResourcePermission">
    159       <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    160       <Column Name="GrantedUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    161       <Column Name="GrantedByUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
    162       <Association Name="Resource_ResourcePermission" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
    163     </Type>
    164   </Table>
    165158  <Table Name="" Member="UserPriorities">
    166159    <Type Name="UserPriority">
     
    174167      <Column Name="Name" Type="System.String" DbType="VarChar(MAX) NOT NULL" CanBeNull="false" />
    175168      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
    176       <Column Name="ExpirationTime" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
    177       <Column Name="ResourceGroupId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
    178       <Column Name="ResourceGroup2Id" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
    179       <Column Name="GroupName" Type="System.String" CanBeNull="true" />
    180       <Column Name="GroupName2" Type="System.String" CanBeNull="true" />
     169      <Column Name="ParentResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
     170      <Column Name="ResourceType" Type="System.String" CanBeNull="false" />
     171      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
     172      <Column Name="DateExpired" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
    181173      <Association Name="DimClient_FactTask" Member="FactTasks" ThisKey="Id" OtherKey="LastClientId" Type="FactTask" />
    182174      <Association Name="DimClient_FactClientInfo" Member="FactClientInfos" ThisKey="Id" OtherKey="ClientId" Type="FactClientInfo" />
     
    215207      <Column Name="CompletedTasks" Type="System.Int32" DbType="INT NOT NULL" CanBeNull="false" />
    216208      <Column Name="DateCompleted" Type="System.DateTime" DbType="DateTime NULL" CanBeNull="true" />
     209      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
    217210      <Association Name="DimJob_FactTask" Member="FactTasks" ThisKey="JobId" OtherKey="JobId" Type="FactTask" />
     211      <Association Name="DimProject_DimJob" Member="DimProject" ThisKey="ProjectId" OtherKey="Id" Type="DimProject" IsForeignKey="true" />
    218212    </Type>
    219213  </Table>
     
    227221      <Column Name="Minute" Type="System.DateTime" CanBeNull="false" />
    228222      <Association Name="DimTime_FactClientInfo" Member="FactClientInfos" ThisKey="Time" OtherKey="Time" Type="FactClientInfo" />
     223      <Association Name="DimTime_FactProjectInfo" Member="FactProjectInfos" ThisKey="Time" OtherKey="Time" Type="FactProjectInfo" />
    229224    </Type>
    230225  </Table>
     
    240235      <Column Name="ClientId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    241236      <Column Name="Time" Type="System.DateTime" DbType="DateTime NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    242       <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier NULL" IsPrimaryKey="true" CanBeNull="false" />
     237      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    243238      <Column Name="NumUsedCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
    244239      <Column Name="NumTotalCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
     
    256251    </Type>
    257252  </Table>
     253  <Table Name="dbo.Project" Member="Projects">
     254    <Type Name="Project">
     255      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
     256      <Column Name="ParentProjectId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
     257      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
     258      <Column Name="Name" Type="System.String" DbType="VarChar(MAX) NOT NULL" CanBeNull="false" />
     259      <Column Name="Description" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
     260      <Column Name="OwnerUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
     261      <Column Name="StartDate" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
     262      <Column Name="EndDate" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
     263      <Association Name="Project_AssignedProjectResource" Member="AssignedProjectResources" ThisKey="ProjectId" OtherKey="ProjectId" Type="AssignedProjectResource" />
     264      <Association Name="Project_Job" Member="Jobs" ThisKey="ProjectId" OtherKey="ProjectId" Type="Job" />
     265      <Association Name="Project_Project" Member="ChildProjects" Storage="_Projects" ThisKey="ProjectId" OtherKey="ParentProjectId" Type="Project" />
     266      <Association Name="Project_ProjectPermission" Member="ProjectPermissions" ThisKey="ProjectId" OtherKey="ProjectId" Type="ProjectPermission" />
     267      <Association Name="Project_Project" Member="ParentProject" Storage="_Project1" ThisKey="ParentProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" />
     268    </Type>
     269  </Table>
     270  <Table Name="dbo.ProjectPermission" Member="ProjectPermissions">
     271    <Type Name="ProjectPermission">
     272      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
     273      <Column Name="GrantedUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
     274      <Column Name="GrantedByUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
     275      <Association Name="Project_ProjectPermission" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" />
     276    </Type>
     277  </Table>
     278  <Table Name="dbo.AssignedJobResource" Member="AssignedJobResources">
     279    <Type Name="AssignedJobResource">
     280      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
     281      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
     282      <Association Name="Resource_AssignedJobResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
     283      <Association Name="Job_AssignedJobResource" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
     284    </Type>
     285  </Table>
     286  <Table Name="[statistics].FactProjectInfo" Member="FactProjectInfos">
     287    <Type Name="FactProjectInfo">
     288      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
     289      <Column Name="Time" Type="System.DateTime" DbType="DateTime NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
     290      <Column Name="NumTotalCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
     291      <Column Name="NumUsedCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
     292      <Column Name="TotalMemory" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
     293      <Column Name="UsedMemory" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
     294      <Association Name="DimProject_FactProjectInfo" Member="DimProject" ThisKey="ProjectId" OtherKey="Id" Type="DimProject" IsForeignKey="true" />
     295      <Association Name="DimTime_FactProjectInfo" Member="DimTime" ThisKey="Time" OtherKey="Time" Type="DimTime" IsForeignKey="true" />
     296    </Type>
     297  </Table>
     298  <Table Name="[statistics].DimProject" Member="DimProjects">
     299    <Type Name="DimProject">
     300      <Column Name="Id" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
     301      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
     302      <Column Name="ParentProjectId" Storage="_ParentId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
     303      <Column Name="Name" Type="System.String" CanBeNull="false" />
     304      <Column Name="Description" Type="System.String" CanBeNull="true" />
     305      <Column Name="OwnerUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
     306      <Column Name="StartDate" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
     307      <Column Name="EndDate" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
     308      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
     309      <Column Name="DateExpired" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
     310      <Association Name="DimProject_DimJob" Member="DimJobs" ThisKey="Id" OtherKey="ProjectId" Type="DimJob" />
     311      <Association Name="DimProject_FactProjectInfo" Member="FactProjectInfos" ThisKey="Id" OtherKey="ProjectId" Type="FactProjectInfo" />
     312    </Type>
     313  </Table>
    258314</Database>
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout

    r12926 r16117  
    11<?xml version="1.0" encoding="utf-8"?>
    2 <ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 15.75, 17.875" name="HiveDataContext">
     2<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 16.25, 23.875" name="HiveDataContext">
    33  <DataContextMoniker Name="/HiveDataContext" />
    44  <nestedChildShapes>
    5     <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="8.875, 4.5, 2, 1.1939925130208327">
    6       <DataClassMoniker Name="/HiveDataContext/AssignedResource" />
    7       <nestedChildShapes>
    8         <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="8.89, 4.9600000000000009, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     5    <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="13.875, 8.25, 2, 1.1939925130208327">
     6      <DataClassMoniker Name="/HiveDataContext/AssignedProjectResource" />
     7      <nestedChildShapes>
     8        <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="13.89, 8.71, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    99      </nestedChildShapes>
    1010    </classShape>
     
    3939      </nestedChildShapes>
    4040    </classShape>
    41     <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 1.9631982421874996">
     41    <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 2.1554996744791666">
    4242      <DataClassMoniker Name="/HiveDataContext/Job" />
    4343      <nestedChildShapes>
    44         <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     44        <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    4545      </nestedChildShapes>
    4646    </classShape>
     
    6969      </nodes>
    7070    </inheritanceConnector>
    71     <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">
    72       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedResource" />
    73       <nodes>
    74         <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
    75         <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
    76       </nodes>
    77     </associationConnector>
    7871    <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds="4.125, 1, 2, 1.3862939453125">
    7972      <DataClassMoniker Name="/HiveDataContext/TaskData" />
     
    141134      </nodes>
    142135    </associationConnector>
    143     <associationConnector edgePoints="[(8.5 : 4.1170068359375); (8.875 : 4.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    144       <AssociationMoniker Name="/HiveDataContext/Task/Task_AssignedResource" />
    145       <nodes>
    146         <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
    147         <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
    148       </nodes>
    149     </associationConnector>
    150     <associationConnector edgePoints="[(7.4687475 : 4.1170068359375); (7.4687475 : 5.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     136    <associationConnector edgePoints="[(7.5 : 4.1170068359375); (7.5 : 5.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    151137      <AssociationMoniker Name="/HiveDataContext/Task/Task_RequiredPlugin" />
    152138      <nodes>
     
    183169      </nodes>
    184170    </associationConnector>
    185     <associationConnector edgePoints="[(4.125 : 4.10659912109375); (3.75 : 4.10659912109375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     171    <associationConnector edgePoints="[(4.125 : 4.20274983723958); (3.75 : 4.20274983723958)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    186172      <AssociationMoniker Name="/HiveDataContext/Job/Job_JobPermission" />
    187173      <nodes>
     
    190176      </nodes>
    191177    </associationConnector>
    192     <classShape Id="a3f352be-9f15-4e73-8d44-3e8ac02fb4cf" absoluteBounds="11.25, 3.875, 2, 1.3862939453124996">
    193       <DataClassMoniker Name="/HiveDataContext/ResourcePermission" />
    194       <nestedChildShapes>
    195         <elementListCompartment Id="45e2f1a8-8a1e-4647-b649-10ec55976ab4" absoluteBounds="11.265, 4.335, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    196       </nestedChildShapes>
    197     </classShape>
    198     <associationConnector edgePoints="[(12.5942481820367 : 2.9631982421875); (12.5942481820367 : 3.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    199       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_ResourcePermission" />
    200       <nodes>
    201         <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
    202         <classShapeMoniker Id="a3f352be-9f15-4e73-8d44-3e8ac02fb4cf" />
    203       </nodes>
    204     </associationConnector>
    205178    <classShape Id="f9e8867f-fd15-4a72-8ca4-4f02cd3f141f" absoluteBounds="4.125, 5.5, 2, 1.1939925130208327">
    206179      <DataClassMoniker Name="/HiveDataContext/UserPriority" />
     
    209182      </nestedChildShapes>
    210183    </classShape>
    211     <classShape Id="b5b919c2-4efc-4f09-8f52-9d541a11e961" absoluteBounds="4.625, 15.25, 2, 2.3478011067708344">
     184    <classShape Id="b5b919c2-4efc-4f09-8f52-9d541a11e961" absoluteBounds="5.5, 12.25, 2, 2.1554996744791666">
    212185      <DataClassMoniker Name="/HiveDataContext/DimClient" />
    213186      <nestedChildShapes>
    214         <elementListCompartment Id="30f62a7b-0b16-404e-b972-fb12bfe978dd" absoluteBounds="4.6400000000000006, 15.71, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    215       </nestedChildShapes>
    216     </classShape>
    217     <classShape Id="04f52807-ce17-4d65-bd23-cc38c6dfbd7a" absoluteBounds="6.875, 11.25, 2, 3.8862125651041666">
     187        <elementListCompartment Id="30f62a7b-0b16-404e-b972-fb12bfe978dd" absoluteBounds="5.5150000000000006, 12.71, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     188      </nestedChildShapes>
     189    </classShape>
     190    <classShape Id="04f52807-ce17-4d65-bd23-cc38c6dfbd7a" absoluteBounds="8.25, 12.25, 2, 3.8862125651041666">
    218191      <DataClassMoniker Name="/HiveDataContext/FactTask" />
    219192      <nestedChildShapes>
    220         <elementListCompartment Id="63e3ddcb-a6fe-48e0-a674-e650a55a9f2c" absoluteBounds="6.8900000000000006, 11.71, 1.9700000000000002, 3.3262125651041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    221       </nestedChildShapes>
    222     </classShape>
    223     <classShape Id="e0cb8641-a75e-4b9f-beda-3218c56938b1" absoluteBounds="8.125, 8.25, 2, 2.3478011067708344">
     193        <elementListCompartment Id="63e3ddcb-a6fe-48e0-a674-e650a55a9f2c" absoluteBounds="8.265, 12.71, 1.9700000000000002, 3.3262125651041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     194      </nestedChildShapes>
     195    </classShape>
     196    <classShape Id="e0cb8641-a75e-4b9f-beda-3218c56938b1" absoluteBounds="11.125, 12.25, 2, 2.5401025390625005">
    224197      <DataClassMoniker Name="/HiveDataContext/DimJob" />
    225198      <nestedChildShapes>
    226         <elementListCompartment Id="6b9e8260-7e4b-4357-9c26-eebebfd69504" absoluteBounds="8.14, 8.71, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    227       </nestedChildShapes>
    228     </classShape>
    229     <classShape Id="a769f2ac-c8e3-4860-baa5-c46f46c38ed8" absoluteBounds="3.625, 8.5, 2, 1.9631982421875005">
     199        <elementListCompartment Id="6b9e8260-7e4b-4357-9c26-eebebfd69504" absoluteBounds="11.14, 12.71, 1.9700000000000002, 1.9801025390625" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     200      </nestedChildShapes>
     201    </classShape>
     202    <classShape Id="a769f2ac-c8e3-4860-baa5-c46f46c38ed8" absoluteBounds="10, 21.625, 2, 1.9631982421875005">
    230203      <DataClassMoniker Name="/HiveDataContext/DimTime" />
    231204      <nestedChildShapes>
    232         <elementListCompartment Id="694c4a5a-20fb-43a9-bc9a-7b59d794a7fb" absoluteBounds="3.6399999999999997, 8.96, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    233       </nestedChildShapes>
    234     </classShape>
    235     <classShape Id="66c34ced-4fdb-4a1d-b8dd-fe094679b7fb" absoluteBounds="0.625, 8.875, 2, 1.1939925130208344">
     205        <elementListCompartment Id="694c4a5a-20fb-43a9-bc9a-7b59d794a7fb" absoluteBounds="10.015, 22.085, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     206      </nestedChildShapes>
     207    </classShape>
     208    <classShape Id="66c34ced-4fdb-4a1d-b8dd-fe094679b7fb" absoluteBounds="4.125, 21.625, 2, 1.1939925130208344">
    236209      <DataClassMoniker Name="/HiveDataContext/DimUser" />
    237210      <nestedChildShapes>
    238         <elementListCompartment Id="6181c560-fc74-4d43-b064-a90032bf17a5" absoluteBounds="0.64000000000000012, 9.335, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    239       </nestedChildShapes>
    240     </classShape>
    241     <classShape Id="053a5cff-b18a-4ee5-8d43-48ed5c5dcfad" absoluteBounds="2.625, 11, 2, 3.3093082682291666">
     211        <elementListCompartment Id="6181c560-fc74-4d43-b064-a90032bf17a5" absoluteBounds="4.1400000000000006, 22.085, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     212      </nestedChildShapes>
     213    </classShape>
     214    <classShape Id="053a5cff-b18a-4ee5-8d43-48ed5c5dcfad" absoluteBounds="5.5, 17, 2, 3.3093082682291666">
    242215      <DataClassMoniker Name="/HiveDataContext/FactClientInfo" />
    243216      <nestedChildShapes>
    244         <elementListCompartment Id="0a1cc913-6636-455c-95b3-302f533527db" absoluteBounds="2.6399999999999997, 11.46, 1.9700000000000002, 2.7493082682291665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    245       </nestedChildShapes>
    246     </classShape>
    247     <associationConnector edgePoints="[(6.625 : 15.25); (6.875 : 15.1362125651042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     217        <elementListCompartment Id="0a1cc913-6636-455c-95b3-302f533527db" absoluteBounds="5.515, 17.46, 1.9700000000000002, 2.7493082682291665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     218      </nestedChildShapes>
     219    </classShape>
     220    <associationConnector edgePoints="[(7.5 : 13.3277498372396); (8.25 : 13.3277498372396)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    248221      <AssociationMoniker Name="/HiveDataContext/DimClient/DimClient_FactTask" />
    249222      <nodes>
     
    252225      </nodes>
    253226    </associationConnector>
    254     <associationConnector edgePoints="[(8.5 : 10.5978011067708); (8.5 : 11.25)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     227    <associationConnector edgePoints="[(11.125 : 13.5200512695313); (10.25 : 13.5200512695313)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    255228      <AssociationMoniker Name="/HiveDataContext/DimJob/DimJob_FactTask" />
    256229      <nodes>
     
    259232      </nodes>
    260233    </associationConnector>
    261     <associationConnector edgePoints="[(5.6249975 : 15.25); (5.6249975 : 12.6546541341146); (4.625 : 12.6546541341146)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     234    <associationConnector edgePoints="[(6.5 : 14.4054996744792); (6.5 : 17)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    262235      <AssociationMoniker Name="/HiveDataContext/DimClient/DimClient_FactClientInfo" />
    263236      <nodes>
     
    266239      </nodes>
    267240    </associationConnector>
    268     <associationConnector edgePoints="[(4.125 : 10.4631982421875); (4.125 : 11)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     241    <associationConnector edgePoints="[(11 : 21.625); (11 : 18.6546541341146); (7.5 : 18.6546541341146)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    269242      <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactClientInfo" />
    270243      <nodes>
     
    273246      </nodes>
    274247    </associationConnector>
    275     <associationConnector edgePoints="[(1.59375 : 10.0689925130208); (1.59375 : 12.6546541341146); (2.625 : 12.6546541341146)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     248    <associationConnector edgePoints="[(5.8125 : 21.625); (5.8125 : 20.3093082682292)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    276249      <AssociationMoniker Name="/HiveDataContext/DimUser/DimUser_FactClientInfo" />
    277250      <nodes>
     
    280253      </nodes>
    281254    </associationConnector>
     255    <classShape Id="30778876-b5f6-4a97-9ec7-792011973d75" absoluteBounds="11.25, 8.25, 2, 2.3478011067708344">
     256      <DataClassMoniker Name="/HiveDataContext/Project" />
     257      <nestedChildShapes>
     258        <elementListCompartment Id="2c8b0555-6cea-4cc9-b028-2d066c02401c" absoluteBounds="11.265, 8.71, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     259      </nestedChildShapes>
     260    </classShape>
     261    <associationConnector edgePoints="[(11.9592307692308 : 10.5978011067708); (11.9592307692308 : 10.8478011067708); (12.5546153846154 : 10.8478011067708); (12.5546153846154 : 10.5978011067708)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     262      <AssociationMoniker Name="/HiveDataContext/Project/Project_Project" />
     263      <nodes>
     264        <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" />
     265        <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" />
     266      </nodes>
     267    </associationConnector>
     268    <classShape Id="1c20ff2a-adeb-4830-9456-9a2a3e11cee3" absoluteBounds="13.875, 9.875, 2, 1.3862939453125005">
     269      <DataClassMoniker Name="/HiveDataContext/ProjectPermission" />
     270      <nestedChildShapes>
     271        <elementListCompartment Id="d115744c-dfef-4a5d-9b9a-30efc6ef4423" absoluteBounds="13.89, 10.335, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     272      </nestedChildShapes>
     273    </classShape>
     274    <associationConnector edgePoints="[(13.25 : 10.2364005533854); (13.875 : 10.2364005533854)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     275      <AssociationMoniker Name="/HiveDataContext/Project/Project_ProjectPermission" />
     276      <nodes>
     277        <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" />
     278        <classShapeMoniker Id="1c20ff2a-adeb-4830-9456-9a2a3e11cee3" />
     279      </nodes>
     280    </associationConnector>
     281    <associationConnector edgePoints="[(11.25 : 9.42390055338542); (4 : 9.42390055338542); (4 : 5.28049967447917); (5.125 : 5.28049967447917); (5.125 : 4.78049967447917)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     282      <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" />
     283      <nodes>
     284        <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" />
     285        <classShapeMoniker Id="e6f840cc-2968-4be1-b234-eef624ccacbb" />
     286      </nodes>
     287    </associationConnector>
     288    <associationConnector edgePoints="[(13.25 : 2.15469482421875); (15.71875 : 2.15469482421875); (15.71875 : 8.25)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     289      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedProjectResource" />
     290      <nodes>
     291        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
     292        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
     293      </nodes>
     294    </associationConnector>
     295    <associationConnector edgePoints="[(13.25 : 8.84699625651042); (13.875 : 8.84699625651042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     296      <AssociationMoniker Name="/HiveDataContext/Project/Project_AssignedProjectResource" />
     297      <nodes>
     298        <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" />
     299        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
     300      </nodes>
     301    </associationConnector>
     302    <classShape Id="0a400ab3-5f14-4eea-88f0-94420c71a7fb" absoluteBounds="8.875, 4.5, 2, 1.1939925130208327">
     303      <DataClassMoniker Name="/HiveDataContext/AssignedJobResource" />
     304      <nestedChildShapes>
     305        <elementListCompartment Id="8ef99b6f-aa50-465a-bb2b-3b9b9698d417" absoluteBounds="8.89, 4.96, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     306      </nestedChildShapes>
     307    </classShape>
     308    <associationConnector edgePoints="[(12.25 : 2.9631982421875); (12.25 : 5.09699625651042); (10.875 : 5.09699625651042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     309      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedJobResource" />
     310      <nodes>
     311        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
     312        <classShapeMoniker Id="0a400ab3-5f14-4eea-88f0-94420c71a7fb" />
     313      </nodes>
     314    </associationConnector>
     315    <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">
     316      <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedJobResource" />
     317      <nodes>
     318        <classShapeMoniker Id="e6f840cc-2968-4be1-b234-eef624ccacbb" />
     319        <classShapeMoniker Id="0a400ab3-5f14-4eea-88f0-94420c71a7fb" />
     320      </nodes>
     321    </associationConnector>
     322    <classShape Id="e261c9ea-27ec-47d1-8e68-aba5f835f0dd" absoluteBounds="13.75, 17, 2, 1.9631982421875023">
     323      <DataClassMoniker Name="/HiveDataContext/FactProjectInfo" />
     324      <nestedChildShapes>
     325        <elementListCompartment Id="4ba36f1f-053c-478d-b9b4-d0a2b63c3129" absoluteBounds="13.765, 17.46, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     326      </nestedChildShapes>
     327    </classShape>
     328    <classShape Id="55ff3cee-22ff-48f2-a8ff-ccb8e2e84af9" absoluteBounds="13.75, 12.25, 2, 2.73240397135417">
     329      <DataClassMoniker Name="/HiveDataContext/DimProject" />
     330      <nestedChildShapes>
     331        <elementListCompartment Id="cf69e9f9-115a-42d8-8d53-761a1edfc941" absoluteBounds="13.765, 12.71, 1.9700000000000002, 2.1724039713541665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     332      </nestedChildShapes>
     333    </classShape>
     334    <associationConnector edgePoints="[(14.75 : 14.9824039713542); (14.75 : 17)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     335      <AssociationMoniker Name="/HiveDataContext/DimProject/DimProject_FactProjectInfo" />
     336      <nodes>
     337        <classShapeMoniker Id="55ff3cee-22ff-48f2-a8ff-ccb8e2e84af9" />
     338        <classShapeMoniker Id="e261c9ea-27ec-47d1-8e68-aba5f835f0dd" />
     339      </nodes>
     340    </associationConnector>
     341    <associationConnector edgePoints="[(11.5312525 : 21.625); (11.5312525 : 17.8273270670573); (13.75 : 17.8273270670573)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     342      <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactProjectInfo" />
     343      <nodes>
     344        <classShapeMoniker Id="a769f2ac-c8e3-4860-baa5-c46f46c38ed8" />
     345        <classShapeMoniker Id="e261c9ea-27ec-47d1-8e68-aba5f835f0dd" />
     346      </nodes>
     347    </associationConnector>
     348    <associationConnector edgePoints="[(13.75 : 13.5200512695313); (13.125 : 13.5200512695313)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     349      <AssociationMoniker Name="/HiveDataContext/DimProject/DimProject_DimJob" />
     350      <nodes>
     351        <classShapeMoniker Id="55ff3cee-22ff-48f2-a8ff-ccb8e2e84af9" />
     352        <classShapeMoniker Id="e0cb8641-a75e-4b9f-beda-3218c56938b1" />
     353      </nodes>
     354    </associationConnector>
    282355  </nestedChildShapes>
    283356</ordesignerObjectsDiagram>
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs

    r12926 r16117  
    33// <auto-generated>
    44//     This code was generated by a tool.
    5 //     Runtime Version:4.0.30319.34209
     5//     Runtime Version:4.0.30319.42000
    66//
    77//     Changes to this file may cause incorrect behavior and will be lost if
     
    3131    #region Extensibility Method Definitions
    3232    partial void OnCreated();
    33     partial void InsertAssignedResource(AssignedResource instance);
    34     partial void UpdateAssignedResource(AssignedResource instance);
    35     partial void DeleteAssignedResource(AssignedResource instance);
     33    partial void InsertAssignedProjectResource(AssignedProjectResource instance);
     34    partial void UpdateAssignedProjectResource(AssignedProjectResource instance);
     35    partial void DeleteAssignedProjectResource(AssignedProjectResource instance);
    3636    partial void InsertPlugin(Plugin instance);
    3737    partial void UpdatePlugin(Plugin instance);
     
    6767    partial void UpdateLifecycle(Lifecycle instance);
    6868    partial void DeleteLifecycle(Lifecycle instance);
    69     partial void InsertResourcePermission(ResourcePermission instance);
    70     partial void UpdateResourcePermission(ResourcePermission instance);
    71     partial void DeleteResourcePermission(ResourcePermission instance);
    7269    partial void InsertUserPriority(UserPriority instance);
    7370    partial void UpdateUserPriority(UserPriority instance);
     
    9188    partial void UpdateFactClientInfo(FactClientInfo instance);
    9289    partial void DeleteFactClientInfo(FactClientInfo instance);
     90    partial void InsertProject(Project instance);
     91    partial void UpdateProject(Project instance);
     92    partial void DeleteProject(Project instance);
     93    partial void InsertProjectPermission(ProjectPermission instance);
     94    partial void UpdateProjectPermission(ProjectPermission instance);
     95    partial void DeleteProjectPermission(ProjectPermission instance);
     96    partial void InsertAssignedJobResource(AssignedJobResource instance);
     97    partial void UpdateAssignedJobResource(AssignedJobResource instance);
     98    partial void DeleteAssignedJobResource(AssignedJobResource instance);
     99    partial void InsertFactProjectInfo(FactProjectInfo instance);
     100    partial void UpdateFactProjectInfo(FactProjectInfo instance);
     101    partial void DeleteFactProjectInfo(FactProjectInfo instance);
     102    partial void InsertDimProject(DimProject instance);
     103    partial void UpdateDimProject(DimProject instance);
     104    partial void DeleteDimProject(DimProject instance);
    93105    #endregion
    94    
    95     public HiveDataContext() :
    96         base(global::HeuristicLab.Services.Hive.DataAccess.Settings.Default.HeuristicLab_Hive_LinqConnectionString, mappingSource)
    97     {
    98       OnCreated();
    99     }
    100106   
    101107    public HiveDataContext(string connection) :
     
    123129    }
    124130   
    125     public System.Data.Linq.Table<AssignedResource> AssignedResources
    126     {
    127       get
    128       {
    129         return this.GetTable<AssignedResource>();
     131    public System.Data.Linq.Table<AssignedProjectResource> AssignedProjectResources
     132    {
     133      get
     134      {
     135        return this.GetTable<AssignedProjectResource>();
    130136      }
    131137    }
     
    219225    }
    220226   
    221     public System.Data.Linq.Table<ResourcePermission> ResourcePermissions
    222     {
    223       get
    224       {
    225         return this.GetTable<ResourcePermission>();
    226       }
    227     }
    228    
    229227    public System.Data.Linq.Table<UserPriority> UserPriorities
    230228    {
     
    280278      {
    281279        return this.GetTable<FactClientInfo>();
     280      }
     281    }
     282   
     283    public System.Data.Linq.Table<Project> Projects
     284    {
     285      get
     286      {
     287        return this.GetTable<Project>();
     288      }
     289    }
     290   
     291    public System.Data.Linq.Table<ProjectPermission> ProjectPermissions
     292    {
     293      get
     294      {
     295        return this.GetTable<ProjectPermission>();
     296      }
     297    }
     298   
     299    public System.Data.Linq.Table<AssignedJobResource> AssignedJobResources
     300    {
     301      get
     302      {
     303        return this.GetTable<AssignedJobResource>();
     304      }
     305    }
     306   
     307    public System.Data.Linq.Table<FactProjectInfo> FactProjectInfos
     308    {
     309      get
     310      {
     311        return this.GetTable<FactProjectInfo>();
     312      }
     313    }
     314   
     315    public System.Data.Linq.Table<DimProject> DimProjects
     316    {
     317      get
     318      {
     319        return this.GetTable<DimProject>();
    282320      }
    283321    }
    284322  }
    285323 
    286   [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.AssignedResources")]
    287   public partial class AssignedResource : INotifyPropertyChanging, INotifyPropertyChanged
     324  [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.AssignedProjectResource")]
     325  public partial class AssignedProjectResource : INotifyPropertyChanging, INotifyPropertyChanged
    288326  {
    289327   
     
    296334    private EntityRef<Resource> _Resource;
    297335   
    298     private EntityRef<Task> _Job;
     336    private EntityRef<Project> _Project;
    299337   
    300338    #region Extensibility Method Definitions
     
    304342    partial void OnResourceIdChanging(System.Guid value);
    305343    partial void OnResourceIdChanged();
    306     partial void OnTaskIdChanging(System.Guid value);
    307     partial void OnTaskIdChanged();
     344    partial void OnProjectIdChanging(System.Guid value);
     345    partial void OnProjectIdChanged();
    308346    #endregion
    309347   
    310     public AssignedResource()
     348    public AssignedProjectResource()
    311349    {
    312350      this._Resource = default(EntityRef<Resource>);
    313       this._Job = default(EntityRef<Task>);
     351      this._Project = default(EntityRef<Project>);
    314352      OnCreated();
    315353    }
     
    340378   
    341379    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
    342     public System.Guid TaskId
     380    public System.Guid ProjectId
    343381    {
    344382      get
     
    350388        if ((this._JobId != value))
    351389        {
    352           if (this._Job.HasLoadedOrAssignedValue)
     390          if (this._Project.HasLoadedOrAssignedValue)
    353391          {
    354392            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
    355393          }
    356           this.OnTaskIdChanging(value);
     394          this.OnProjectIdChanging(value);
    357395          this.SendPropertyChanging();
    358396          this._JobId = value;
    359           this.SendPropertyChanged("TaskId");
    360           this.OnTaskIdChanged();
    361         }
    362       }
    363     }
    364    
    365     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
     397          this.SendPropertyChanged("ProjectId");
     398          this.OnProjectIdChanged();
     399        }
     400      }
     401    }
     402   
     403    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedProjectResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteOnNull=true)]
    366404    public Resource Resource
    367405    {
     
    380418          {
    381419            this._Resource.Entity = null;
    382             previousValue.AssignedResources.Remove(this);
     420            previousValue.AssignedProjectResources.Remove(this);
    383421          }
    384422          this._Resource.Entity = value;
    385423          if ((value != null))
    386424          {
    387             value.AssignedResources.Add(this);
     425            value.AssignedProjectResources.Add(this);
    388426            this._ResourceId = value.ResourceId;
    389427          }
     
    397435    }
    398436   
    399     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Task_AssignedResource", Storage="_Job", ThisKey="TaskId", OtherKey="TaskId", IsForeignKey=true, DeleteRule="CASCADE")]
    400     public Task Task
    401     {
    402       get
    403       {
    404         return this._Job.Entity;
    405       }
    406       set
    407       {
    408         Task previousValue = this._Job.Entity;
     437    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedProjectResource", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteOnNull=true)]
     438    public Project Project
     439    {
     440      get
     441      {
     442        return this._Project.Entity;
     443      }
     444      set
     445      {
     446        Project previousValue = this._Project.Entity;
    409447        if (((previousValue != value)
    410               || (this._Job.HasLoadedOrAssignedValue == false)))
     448              || (this._Project.HasLoadedOrAssignedValue == false)))
    411449        {
    412450          this.SendPropertyChanging();
    413451          if ((previousValue != null))
    414452          {
    415             this._Job.Entity = null;
    416             previousValue.AssignedResources.Remove(this);
    417           }
    418           this._Job.Entity = value;
     453            this._Project.Entity = null;
     454            previousValue.AssignedProjectResources.Remove(this);
     455          }
     456          this._Project.Entity = value;
    419457          if ((value != null))
    420458          {
    421             value.AssignedResources.Add(this);
    422             this._JobId = value.TaskId;
     459            value.AssignedProjectResources.Add(this);
     460            this._JobId = value.ProjectId;
    423461          }
    424462          else
     
    426464            this._JobId = default(System.Guid);
    427465          }
    428           this.SendPropertyChanged("Task");
     466          this.SendPropertyChanged("Project");
    429467        }
    430468      }
     
    903941    private System.Nullable<System.Guid> _OwnerUserId;
    904942   
    905     private EntitySet<AssignedResource> _AssignedResources;
     943    private EntitySet<AssignedProjectResource> _AssignedProjectResources;
    906944   
    907945    private EntitySet<Resource> _ChildResources;
     
    911949    private EntitySet<StateLog> _StateLogs;
    912950   
    913     private EntitySet<ResourcePermission> _ResourcePermissions;
     951    private EntitySet<AssignedJobResource> _AssignedJobResources;
    914952   
    915953    private EntityRef<Resource> _ParentResource;
     
    935973    public Resource()
    936974    {
    937       this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
     975      this._AssignedProjectResources = new EntitySet<AssignedProjectResource>(new Action<AssignedProjectResource>(this.attach_AssignedProjectResources), new Action<AssignedProjectResource>(this.detach_AssignedProjectResources));
    938976      this._ChildResources = new EntitySet<Resource>(new Action<Resource>(this.attach_ChildResources), new Action<Resource>(this.detach_ChildResources));
    939977      this._UptimeCalendars = new EntitySet<Downtime>(new Action<Downtime>(this.attach_UptimeCalendars), new Action<Downtime>(this.detach_UptimeCalendars));
    940978      this._StateLogs = new EntitySet<StateLog>(new Action<StateLog>(this.attach_StateLogs), new Action<StateLog>(this.detach_StateLogs));
    941       this._ResourcePermissions = new EntitySet<ResourcePermission>(new Action<ResourcePermission>(this.attach_ResourcePermissions), new Action<ResourcePermission>(this.detach_ResourcePermissions));
     979      this._AssignedJobResources = new EntitySet<AssignedJobResource>(new Action<AssignedJobResource>(this.attach_AssignedJobResources), new Action<AssignedJobResource>(this.detach_AssignedJobResources));
    942980      this._ParentResource = default(EntityRef<Resource>);
    943981      OnCreated();
     
    10681106    }
    10691107   
    1070     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedResource", Storage="_AssignedResources", ThisKey="ResourceId", OtherKey="ResourceId")]
    1071     public EntitySet<AssignedResource> AssignedResources
    1072     {
    1073       get
    1074       {
    1075         return this._AssignedResources;
    1076       }
    1077       set
    1078       {
    1079         this._AssignedResources.Assign(value);
     1108    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedProjectResource", Storage="_AssignedProjectResources", ThisKey="ResourceId", OtherKey="ResourceId")]
     1109    public EntitySet<AssignedProjectResource> AssignedProjectResources
     1110    {
     1111      get
     1112      {
     1113        return this._AssignedProjectResources;
     1114      }
     1115      set
     1116      {
     1117        this._AssignedProjectResources.Assign(value);
    10801118      }
    10811119    }
     
    11201158    }
    11211159   
    1122     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_ResourcePermission", Storage="_ResourcePermissions", ThisKey="ResourceId", OtherKey="ResourceId")]
    1123     public EntitySet<ResourcePermission> ResourcePermissions
    1124     {
    1125       get
    1126       {
    1127         return this._ResourcePermissions;
    1128       }
    1129       set
    1130       {
    1131         this._ResourcePermissions.Assign(value);
     1160    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedJobResource", Storage="_AssignedJobResources", ThisKey="ResourceId", OtherKey="ResourceId")]
     1161    public EntitySet<AssignedJobResource> AssignedJobResources
     1162    {
     1163      get
     1164      {
     1165        return this._AssignedJobResources;
     1166      }
     1167      set
     1168      {
     1169        this._AssignedJobResources.Assign(value);
    11321170      }
    11331171    }
     
    11871225    }
    11881226   
    1189     private void attach_AssignedResources(AssignedResource entity)
     1227    private void attach_AssignedProjectResources(AssignedProjectResource entity)
    11901228    {
    11911229      this.SendPropertyChanging();
     
    11931231    }
    11941232   
    1195     private void detach_AssignedResources(AssignedResource entity)
     1233    private void detach_AssignedProjectResources(AssignedProjectResource entity)
    11961234    {
    11971235      this.SendPropertyChanging();
     
    12351273    }
    12361274   
    1237     private void attach_ResourcePermissions(ResourcePermission entity)
     1275    private void attach_AssignedJobResources(AssignedJobResource entity)
    12381276    {
    12391277      this.SendPropertyChanging();
     
    12411279    }
    12421280   
    1243     private void detach_ResourcePermissions(ResourcePermission entity)
     1281    private void detach_AssignedJobResources(AssignedJobResource entity)
    12441282    {
    12451283      this.SendPropertyChanging();
     
    16201658    private System.Guid _HiveExperimentId;
    16211659   
    1622     private EntitySet<AssignedResource> _AssignedResources;
    1623    
    16241660    private EntitySet<RequiredPlugin> _RequiredPlugins;
    16251661   
     
    16661702    public Task()
    16671703    {
    1668       this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
    16691704      this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
    16701705      this._Jobs = new EntitySet<Task>(new Action<Task>(this.attach_Jobs), new Action<Task>(this.detach_Jobs));
     
    19241959    }
    19251960   
    1926     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Task_AssignedResource", Storage="_AssignedResources", ThisKey="TaskId", OtherKey="TaskId")]
    1927     public EntitySet<AssignedResource> AssignedResources
    1928     {
    1929       get
    1930       {
    1931         return this._AssignedResources;
    1932       }
    1933       set
    1934       {
    1935         this._AssignedResources.Assign(value);
    1936       }
    1937     }
    1938    
    19391961    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Task_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="TaskId", OtherKey="TaskId")]
    19401962    public EntitySet<RequiredPlugin> RequiredPlugins
     
    20912113        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    20922114      }
    2093     }
    2094    
    2095     private void attach_AssignedResources(AssignedResource entity)
    2096     {
    2097       this.SendPropertyChanging();
    2098       entity.Task = this;
    2099     }
    2100    
    2101     private void detach_AssignedResources(AssignedResource entity)
    2102     {
    2103       this.SendPropertyChanging();
    2104       entity.Task = null;
    21052115    }
    21062116   
     
    24252435    private string _Description;
    24262436   
    2427     private string _ResourceIds;
    2428    
    24292437    private System.Guid _UserId;
    24302438   
    24312439    private System.DateTime _DateCreated;
    24322440   
     2441    private System.Guid _ProjectId;
     2442   
     2443    private global::HeuristicLab.Services.Hive.DataAccess.JobState _State;
     2444   
    24332445    private EntitySet<Task> _Jobs;
    24342446   
    24352447    private EntitySet<JobPermission> _HiveExperimentPermissions;
     2448   
     2449    private EntitySet<AssignedJobResource> _AssignedJobResources;
     2450   
     2451    private EntityRef<Project> _Project;
    24362452   
    24372453    #region Extensibility Method Definitions
     
    24452461    partial void OnDescriptionChanging(string value);
    24462462    partial void OnDescriptionChanged();
    2447     partial void OnResourceIdsChanging(string value);
    2448     partial void OnResourceIdsChanged();
    24492463    partial void OnOwnerUserIdChanging(System.Guid value);
    24502464    partial void OnOwnerUserIdChanged();
    24512465    partial void OnDateCreatedChanging(System.DateTime value);
    24522466    partial void OnDateCreatedChanged();
     2467    partial void OnProjectIdChanging(System.Guid value);
     2468    partial void OnProjectIdChanged();
     2469    partial void OnStateChanging(global::HeuristicLab.Services.Hive.DataAccess.JobState value);
     2470    partial void OnStateChanged();
    24532471    #endregion
    24542472   
     
    24572475      this._Jobs = new EntitySet<Task>(new Action<Task>(this.attach_Jobs), new Action<Task>(this.detach_Jobs));
    24582476      this._HiveExperimentPermissions = new EntitySet<JobPermission>(new Action<JobPermission>(this.attach_HiveExperimentPermissions), new Action<JobPermission>(this.detach_HiveExperimentPermissions));
     2477      this._AssignedJobResources = new EntitySet<AssignedJobResource>(new Action<AssignedJobResource>(this.attach_AssignedJobResources), new Action<AssignedJobResource>(this.detach_AssignedJobResources));
     2478      this._Project = default(EntityRef<Project>);
    24592479      OnCreated();
    24602480    }
     
    25202540    }
    25212541   
    2522     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceIds", DbType="VarChar(MAX)")]
    2523     public string ResourceIds
    2524     {
    2525       get
    2526       {
    2527         return this._ResourceIds;
    2528       }
    2529       set
    2530       {
    2531         if ((this._ResourceIds != value))
    2532         {
    2533           this.OnResourceIdsChanging(value);
    2534           this.SendPropertyChanging();
    2535           this._ResourceIds = value;
    2536           this.SendPropertyChanged("ResourceIds");
    2537           this.OnResourceIdsChanged();
    2538         }
    2539       }
    2540     }
    2541    
    25422542    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier")]
    25432543    public System.Guid OwnerUserId
     
    25802580    }
    25812581   
     2582    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL")]
     2583    public System.Guid ProjectId
     2584    {
     2585      get
     2586      {
     2587        return this._ProjectId;
     2588      }
     2589      set
     2590      {
     2591        if ((this._ProjectId != value))
     2592        {
     2593          if (this._Project.HasLoadedOrAssignedValue)
     2594          {
     2595            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     2596          }
     2597          this.OnProjectIdChanging(value);
     2598          this.SendPropertyChanging();
     2599          this._ProjectId = value;
     2600          this.SendPropertyChanged("ProjectId");
     2601          this.OnProjectIdChanged();
     2602        }
     2603      }
     2604    }
     2605   
     2606    [global::System.Data.Linq.Mapping.ColumnAttribute(Name="JobState", Storage="_State", DbType="VarChar(30)", CanBeNull=false)]
     2607    public global::HeuristicLab.Services.Hive.DataAccess.JobState State
     2608    {
     2609      get
     2610      {
     2611        return this._State;
     2612      }
     2613      set
     2614      {
     2615        if ((this._State != value))
     2616        {
     2617          this.OnStateChanging(value);
     2618          this.SendPropertyChanging();
     2619          this._State = value;
     2620          this.SendPropertyChanged("State");
     2621          this.OnStateChanged();
     2622        }
     2623      }
     2624    }
     2625   
    25822626    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_Task", Storage="_Jobs", ThisKey="JobId", OtherKey="JobId")]
    25832627    public EntitySet<Task> Tasks
     
    26062650    }
    26072651   
     2652    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_AssignedJobResource", Storage="_AssignedJobResources", ThisKey="JobId", OtherKey="JobId")]
     2653    public EntitySet<AssignedJobResource> AssignedJobResources
     2654    {
     2655      get
     2656      {
     2657        return this._AssignedJobResources;
     2658      }
     2659      set
     2660      {
     2661        this._AssignedJobResources.Assign(value);
     2662      }
     2663    }
     2664   
     2665    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
     2666    public Project Project
     2667    {
     2668      get
     2669      {
     2670        return this._Project.Entity;
     2671      }
     2672      set
     2673      {
     2674        Project previousValue = this._Project.Entity;
     2675        if (((previousValue != value)
     2676              || (this._Project.HasLoadedOrAssignedValue == false)))
     2677        {
     2678          this.SendPropertyChanging();
     2679          if ((previousValue != null))
     2680          {
     2681            this._Project.Entity = null;
     2682            previousValue.Jobs.Remove(this);
     2683          }
     2684          this._Project.Entity = value;
     2685          if ((value != null))
     2686          {
     2687            value.Jobs.Add(this);
     2688            this._ProjectId = value.ProjectId;
     2689          }
     2690          else
     2691          {
     2692            this._ProjectId = default(System.Guid);
     2693          }
     2694          this.SendPropertyChanged("Project");
     2695        }
     2696      }
     2697    }
     2698   
    26082699    public event PropertyChangingEventHandler PropertyChanging;
    26092700   
     
    26452736   
    26462737    private void detach_HiveExperimentPermissions(JobPermission entity)
     2738    {
     2739      this.SendPropertyChanging();
     2740      entity.Job = null;
     2741    }
     2742   
     2743    private void attach_AssignedJobResources(AssignedJobResource entity)
     2744    {
     2745      this.SendPropertyChanging();
     2746      entity.Job = this;
     2747    }
     2748   
     2749    private void detach_AssignedJobResources(AssignedJobResource entity)
    26472750    {
    26482751      this.SendPropertyChanging();
     
    27472850    }
    27482851   
    2749     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Task_TaskData", Storage="_Job", ThisKey="TaskId", OtherKey="TaskId", IsForeignKey=true)]
     2852    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Task_TaskData", Storage="_Job", ThisKey="TaskId", OtherKey="TaskId", IsForeignKey=true, DeleteOnNull=true)]
    27502853    public Task Task
    27512854    {
     
    33853488    }
    33863489   
    3387     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_JobPermission", Storage="_HiveExperiment", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
     3490    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_JobPermission", Storage="_HiveExperiment", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true, DeleteOnNull=true)]
    33883491    public Job Job
    33893492    {
     
    35263629  }
    35273630 
    3528   [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ResourcePermission")]
    3529   public partial class ResourcePermission : INotifyPropertyChanging, INotifyPropertyChanged
    3530   {
    3531    
    3532     private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
    3533    
    3534     private System.Guid _ResourceId;
    3535    
    3536     private System.Guid _GrantedUserId;
    3537    
    3538     private System.Guid _GrantedByUserId;
    3539    
    3540     private EntityRef<Resource> _Resource;
    3541    
    3542     #region Extensibility Method Definitions
    3543     partial void OnLoaded();
    3544     partial void OnValidate(System.Data.Linq.ChangeAction action);
    3545     partial void OnCreated();
    3546     partial void OnResourceIdChanging(System.Guid value);
    3547     partial void OnResourceIdChanged();
    3548     partial void OnGrantedUserIdChanging(System.Guid value);
    3549     partial void OnGrantedUserIdChanged();
    3550     partial void OnGrantedByUserIdChanging(System.Guid value);
    3551     partial void OnGrantedByUserIdChanged();
    3552     #endregion
    3553    
    3554     public ResourcePermission()
    3555     {
    3556       this._Resource = default(EntityRef<Resource>);
    3557       OnCreated();
    3558     }
    3559    
    3560     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
    3561     public System.Guid ResourceId
    3562     {
    3563       get
    3564       {
    3565         return this._ResourceId;
    3566       }
    3567       set
    3568       {
    3569         if ((this._ResourceId != value))
    3570         {
    3571           if (this._Resource.HasLoadedOrAssignedValue)
    3572           {
    3573             throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
    3574           }
    3575           this.OnResourceIdChanging(value);
    3576           this.SendPropertyChanging();
    3577           this._ResourceId = value;
    3578           this.SendPropertyChanged("ResourceId");
    3579           this.OnResourceIdChanged();
    3580         }
    3581       }
    3582     }
    3583    
    3584     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedUserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
    3585     public System.Guid GrantedUserId
    3586     {
    3587       get
    3588       {
    3589         return this._GrantedUserId;
    3590       }
    3591       set
    3592       {
    3593         if ((this._GrantedUserId != value))
    3594         {
    3595           this.OnGrantedUserIdChanging(value);
    3596           this.SendPropertyChanging();
    3597           this._GrantedUserId = value;
    3598           this.SendPropertyChanged("GrantedUserId");
    3599           this.OnGrantedUserIdChanged();
    3600         }
    3601       }
    3602     }
    3603    
    3604     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedByUserId", DbType="UniqueIdentifier NOT NULL")]
    3605     public System.Guid GrantedByUserId
    3606     {
    3607       get
    3608       {
    3609         return this._GrantedByUserId;
    3610       }
    3611       set
    3612       {
    3613         if ((this._GrantedByUserId != value))
    3614         {
    3615           this.OnGrantedByUserIdChanging(value);
    3616           this.SendPropertyChanging();
    3617           this._GrantedByUserId = value;
    3618           this.SendPropertyChanged("GrantedByUserId");
    3619           this.OnGrantedByUserIdChanged();
    3620         }
    3621       }
    3622     }
    3623    
    3624     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_ResourcePermission", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true)]
    3625     public Resource Resource
    3626     {
    3627       get
    3628       {
    3629         return this._Resource.Entity;
    3630       }
    3631       set
    3632       {
    3633         Resource previousValue = this._Resource.Entity;
    3634         if (((previousValue != value)
    3635               || (this._Resource.HasLoadedOrAssignedValue == false)))
    3636         {
    3637           this.SendPropertyChanging();
    3638           if ((previousValue != null))
    3639           {
    3640             this._Resource.Entity = null;
    3641             previousValue.ResourcePermissions.Remove(this);
    3642           }
    3643           this._Resource.Entity = value;
    3644           if ((value != null))
    3645           {
    3646             value.ResourcePermissions.Add(this);
    3647             this._ResourceId = value.ResourceId;
    3648           }
    3649           else
    3650           {
    3651             this._ResourceId = default(System.Guid);
    3652           }
    3653           this.SendPropertyChanged("Resource");
    3654         }
    3655       }
    3656     }
    3657    
    3658     public event PropertyChangingEventHandler PropertyChanging;
    3659    
    3660     public event PropertyChangedEventHandler PropertyChanged;
    3661    
    3662     protected virtual void SendPropertyChanging()
    3663     {
    3664       if ((this.PropertyChanging != null))
    3665       {
    3666         this.PropertyChanging(this, emptyChangingEventArgs);
    3667       }
    3668     }
    3669    
    3670     protected virtual void SendPropertyChanged(String propertyName)
    3671     {
    3672       if ((this.PropertyChanged != null))
    3673       {
    3674         this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    3675       }
    3676     }
    3677   }
    3678  
    36793631  [global::System.Data.Linq.Mapping.TableAttribute(Name="")]
    36803632  public partial class UserPriority : INotifyPropertyChanging, INotifyPropertyChanged
     
    37753727    private System.Guid _ResourceId;
    37763728   
    3777     private System.Nullable<System.DateTime> _ExpirationTime;
    3778    
    3779     private System.Nullable<System.Guid> _ResourceGroupId;
    3780    
    3781     private System.Nullable<System.Guid> _ResourceGroup2Id;
    3782    
    3783     private string _GroupName;
    3784    
    3785     private string _GroupName2;
     3729    private System.Nullable<System.Guid> _ParentResourceId;
     3730   
     3731    private string _ResourceType;
     3732   
     3733    private System.DateTime _DateCreated;
     3734   
     3735    private System.Nullable<System.DateTime> _DateExpired;
    37863736   
    37873737    private EntitySet<FactTask> _FactTasks;
     
    37993749    partial void OnResourceIdChanging(System.Guid value);
    38003750    partial void OnResourceIdChanged();
    3801     partial void OnExpirationTimeChanging(System.Nullable<System.DateTime> value);
    3802     partial void OnExpirationTimeChanged();
    3803     partial void OnResourceGroupIdChanging(System.Nullable<System.Guid> value);
    3804     partial void OnResourceGroupIdChanged();
    3805     partial void OnResourceGroup2IdChanging(System.Nullable<System.Guid> value);
    3806     partial void OnResourceGroup2IdChanged();
    3807     partial void OnGroupNameChanging(string value);
    3808     partial void OnGroupNameChanged();
    3809     partial void OnGroupName2Changing(string value);
    3810     partial void OnGroupName2Changed();
     3751    partial void OnParentResourceIdChanging(System.Nullable<System.Guid> value);
     3752    partial void OnParentResourceIdChanged();
     3753    partial void OnResourceTypeChanging(string value);
     3754    partial void OnResourceTypeChanged();
     3755    partial void OnDateCreatedChanging(System.DateTime value);
     3756    partial void OnDateCreatedChanged();
     3757    partial void OnDateExpiredChanging(System.Nullable<System.DateTime> value);
     3758    partial void OnDateExpiredChanged();
    38113759    #endregion
    38123760   
     
    38783826    }
    38793827   
    3880     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExpirationTime", DbType="DateTime")]
    3881     public System.Nullable<System.DateTime> ExpirationTime
    3882     {
    3883       get
    3884       {
    3885         return this._ExpirationTime;
    3886       }
    3887       set
    3888       {
    3889         if ((this._ExpirationTime != value))
    3890         {
    3891           this.OnExpirationTimeChanging(value);
    3892           this.SendPropertyChanging();
    3893           this._ExpirationTime = value;
    3894           this.SendPropertyChanged("ExpirationTime");
    3895           this.OnExpirationTimeChanged();
    3896         }
    3897       }
    3898     }
    3899    
    3900     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceGroupId", DbType="UniqueIdentifier")]
    3901     public System.Nullable<System.Guid> ResourceGroupId
    3902     {
    3903       get
    3904       {
    3905         return this._ResourceGroupId;
    3906       }
    3907       set
    3908       {
    3909         if ((this._ResourceGroupId != value))
    3910         {
    3911           this.OnResourceGroupIdChanging(value);
    3912           this.SendPropertyChanging();
    3913           this._ResourceGroupId = value;
    3914           this.SendPropertyChanged("ResourceGroupId");
    3915           this.OnResourceGroupIdChanged();
    3916         }
    3917       }
    3918     }
    3919    
    3920     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceGroup2Id", DbType="UniqueIdentifier")]
    3921     public System.Nullable<System.Guid> ResourceGroup2Id
    3922     {
    3923       get
    3924       {
    3925         return this._ResourceGroup2Id;
    3926       }
    3927       set
    3928       {
    3929         if ((this._ResourceGroup2Id != value))
    3930         {
    3931           this.OnResourceGroup2IdChanging(value);
    3932           this.SendPropertyChanging();
    3933           this._ResourceGroup2Id = value;
    3934           this.SendPropertyChanged("ResourceGroup2Id");
    3935           this.OnResourceGroup2IdChanged();
    3936         }
    3937       }
    3938     }
    3939    
    3940     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GroupName")]
    3941     public string GroupName
    3942     {
    3943       get
    3944       {
    3945         return this._GroupName;
    3946       }
    3947       set
    3948       {
    3949         if ((this._GroupName != value))
    3950         {
    3951           this.OnGroupNameChanging(value);
    3952           this.SendPropertyChanging();
    3953           this._GroupName = value;
    3954           this.SendPropertyChanged("GroupName");
    3955           this.OnGroupNameChanged();
    3956         }
    3957       }
    3958     }
    3959    
    3960     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GroupName2")]
    3961     public string GroupName2
    3962     {
    3963       get
    3964       {
    3965         return this._GroupName2;
    3966       }
    3967       set
    3968       {
    3969         if ((this._GroupName2 != value))
    3970         {
    3971           this.OnGroupName2Changing(value);
    3972           this.SendPropertyChanging();
    3973           this._GroupName2 = value;
    3974           this.SendPropertyChanged("GroupName2");
    3975           this.OnGroupName2Changed();
     3828    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentResourceId", DbType="UniqueIdentifier")]
     3829    public System.Nullable<System.Guid> ParentResourceId
     3830    {
     3831      get
     3832      {
     3833        return this._ParentResourceId;
     3834      }
     3835      set
     3836      {
     3837        if ((this._ParentResourceId != value))
     3838        {
     3839          this.OnParentResourceIdChanging(value);
     3840          this.SendPropertyChanging();
     3841          this._ParentResourceId = value;
     3842          this.SendPropertyChanged("ParentResourceId");
     3843          this.OnParentResourceIdChanged();
     3844        }
     3845      }
     3846    }
     3847   
     3848    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceType", CanBeNull=false)]
     3849    public string ResourceType
     3850    {
     3851      get
     3852      {
     3853        return this._ResourceType;
     3854      }
     3855      set
     3856      {
     3857        if ((this._ResourceType != value))
     3858        {
     3859          this.OnResourceTypeChanging(value);
     3860          this.SendPropertyChanging();
     3861          this._ResourceType = value;
     3862          this.SendPropertyChanged("ResourceType");
     3863          this.OnResourceTypeChanged();
     3864        }
     3865      }
     3866    }
     3867   
     3868    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime NOT NULL")]
     3869    public System.DateTime DateCreated
     3870    {
     3871      get
     3872      {
     3873        return this._DateCreated;
     3874      }
     3875      set
     3876      {
     3877        if ((this._DateCreated != value))
     3878        {
     3879          this.OnDateCreatedChanging(value);
     3880          this.SendPropertyChanging();
     3881          this._DateCreated = value;
     3882          this.SendPropertyChanged("DateCreated");
     3883          this.OnDateCreatedChanged();
     3884        }
     3885      }
     3886    }
     3887   
     3888    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateExpired", DbType="DateTime")]
     3889    public System.Nullable<System.DateTime> DateExpired
     3890    {
     3891      get
     3892      {
     3893        return this._DateExpired;
     3894      }
     3895      set
     3896      {
     3897        if ((this._DateExpired != value))
     3898        {
     3899          this.OnDateExpiredChanging(value);
     3900          this.SendPropertyChanging();
     3901          this._DateExpired = value;
     3902          this.SendPropertyChanged("DateExpired");
     3903          this.OnDateExpiredChanged();
    39763904        }
    39773905      }
     
    45754503    private System.Nullable<System.DateTime> _DateCompleted;
    45764504   
     4505    private System.Guid _ProjectId;
     4506   
    45774507    private EntitySet<FactTask> _FactTasks;
     4508   
     4509    private EntityRef<DimProject> _DimProject;
    45784510   
    45794511    #region Extensibility Method Definitions
     
    45974529    partial void OnDateCompletedChanging(System.Nullable<System.DateTime> value);
    45984530    partial void OnDateCompletedChanged();
     4531    partial void OnProjectIdChanging(System.Guid value);
     4532    partial void OnProjectIdChanged();
    45994533    #endregion
    46004534   
     
    46024536    {
    46034537      this._FactTasks = new EntitySet<FactTask>(new Action<FactTask>(this.attach_FactTasks), new Action<FactTask>(this.detach_FactTasks));
     4538      this._DimProject = default(EntityRef<DimProject>);
    46044539      OnCreated();
    46054540    }
     
    47654700    }
    47664701   
     4702    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL")]
     4703    public System.Guid ProjectId
     4704    {
     4705      get
     4706      {
     4707        return this._ProjectId;
     4708      }
     4709      set
     4710      {
     4711        if ((this._ProjectId != value))
     4712        {
     4713          if (this._DimProject.HasLoadedOrAssignedValue)
     4714          {
     4715            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     4716          }
     4717          this.OnProjectIdChanging(value);
     4718          this.SendPropertyChanging();
     4719          this._ProjectId = value;
     4720          this.SendPropertyChanged("ProjectId");
     4721          this.OnProjectIdChanged();
     4722        }
     4723      }
     4724    }
     4725   
    47674726    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimJob_FactTask", Storage="_FactTasks", ThisKey="JobId", OtherKey="JobId")]
    47684727    public EntitySet<FactTask> FactTasks
     
    47754734      {
    47764735        this._FactTasks.Assign(value);
     4736      }
     4737    }
     4738   
     4739    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimProject_DimJob", Storage="_DimProject", ThisKey="ProjectId", OtherKey="Id", IsForeignKey=true)]
     4740    public DimProject DimProject
     4741    {
     4742      get
     4743      {
     4744        return this._DimProject.Entity;
     4745      }
     4746      set
     4747      {
     4748        DimProject previousValue = this._DimProject.Entity;
     4749        if (((previousValue != value)
     4750              || (this._DimProject.HasLoadedOrAssignedValue == false)))
     4751        {
     4752          this.SendPropertyChanging();
     4753          if ((previousValue != null))
     4754          {
     4755            this._DimProject.Entity = null;
     4756            previousValue.DimJobs.Remove(this);
     4757          }
     4758          this._DimProject.Entity = value;
     4759          if ((value != null))
     4760          {
     4761            value.DimJobs.Add(this);
     4762            this._ProjectId = value.Id;
     4763          }
     4764          else
     4765          {
     4766            this._ProjectId = default(System.Guid);
     4767          }
     4768          this.SendPropertyChanged("DimProject");
     4769        }
    47774770      }
    47784771    }
     
    48304823   
    48314824    private EntitySet<FactClientInfo> _FactClientInfos;
     4825   
     4826    private EntitySet<FactProjectInfo> _FactProjectInfos;
    48324827   
    48334828    #region Extensibility Method Definitions
     
    48524847    {
    48534848      this._FactClientInfos = new EntitySet<FactClientInfo>(new Action<FactClientInfo>(this.attach_FactClientInfos), new Action<FactClientInfo>(this.detach_FactClientInfos));
     4849      this._FactProjectInfos = new EntitySet<FactProjectInfo>(new Action<FactProjectInfo>(this.attach_FactProjectInfos), new Action<FactProjectInfo>(this.detach_FactProjectInfos));
    48544850      OnCreated();
    48554851    }
     
    49884984    }
    49894985   
     4986    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimTime_FactProjectInfo", Storage="_FactProjectInfos", ThisKey="Time", OtherKey="Time")]
     4987    public EntitySet<FactProjectInfo> FactProjectInfos
     4988    {
     4989      get
     4990      {
     4991        return this._FactProjectInfos;
     4992      }
     4993      set
     4994      {
     4995        this._FactProjectInfos.Assign(value);
     4996      }
     4997    }
     4998   
    49904999    public event PropertyChangingEventHandler PropertyChanging;
    49915000   
     
    50155024   
    50165025    private void detach_FactClientInfos(FactClientInfo entity)
     5026    {
     5027      this.SendPropertyChanging();
     5028      entity.DimTime = null;
     5029    }
     5030   
     5031    private void attach_FactProjectInfos(FactProjectInfo entity)
     5032    {
     5033      this.SendPropertyChanging();
     5034      entity.DimTime = this;
     5035    }
     5036   
     5037    private void detach_FactProjectInfos(FactProjectInfo entity)
    50175038    {
    50185039      this.SendPropertyChanging();
     
    52615282    }
    52625283   
    5263     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier NULL", IsPrimaryKey=true)]
     5284    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
    52645285    public System.Guid UserId
    52655286    {
     
    56075628    }
    56085629  }
     5630 
     5631  [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Project")]
     5632  public partial class Project : INotifyPropertyChanging, INotifyPropertyChanged
     5633  {
     5634   
     5635    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
     5636   
     5637    private System.Guid _ProjectId;
     5638   
     5639    private System.Nullable<System.Guid> _ParentProjectId;
     5640   
     5641    private System.DateTime _DateCreated;
     5642   
     5643    private string _Name;
     5644   
     5645    private string _Description;
     5646   
     5647    private System.Guid _OwnerUserId;
     5648   
     5649    private System.DateTime _StartDate;
     5650   
     5651    private System.Nullable<System.DateTime> _EndDate;
     5652   
     5653    private EntitySet<AssignedProjectResource> _AssignedProjectResources;
     5654   
     5655    private EntitySet<Job> _Jobs;
     5656   
     5657    private EntitySet<Project> _Projects;
     5658   
     5659    private EntitySet<ProjectPermission> _ProjectPermissions;
     5660   
     5661    private EntityRef<Project> _Project1;
     5662   
     5663    #region Extensibility Method Definitions
     5664    partial void OnLoaded();
     5665    partial void OnValidate(System.Data.Linq.ChangeAction action);
     5666    partial void OnCreated();
     5667    partial void OnProjectIdChanging(System.Guid value);
     5668    partial void OnProjectIdChanged();
     5669    partial void OnParentProjectIdChanging(System.Nullable<System.Guid> value);
     5670    partial void OnParentProjectIdChanged();
     5671    partial void OnDateCreatedChanging(System.DateTime value);
     5672    partial void OnDateCreatedChanged();
     5673    partial void OnNameChanging(string value);
     5674    partial void OnNameChanged();
     5675    partial void OnDescriptionChanging(string value);
     5676    partial void OnDescriptionChanged();
     5677    partial void OnOwnerUserIdChanging(System.Guid value);
     5678    partial void OnOwnerUserIdChanged();
     5679    partial void OnStartDateChanging(System.DateTime value);
     5680    partial void OnStartDateChanged();
     5681    partial void OnEndDateChanging(System.Nullable<System.DateTime> value);
     5682    partial void OnEndDateChanged();
     5683    #endregion
     5684   
     5685    public Project()
     5686    {
     5687      this._AssignedProjectResources = new EntitySet<AssignedProjectResource>(new Action<AssignedProjectResource>(this.attach_AssignedProjectResources), new Action<AssignedProjectResource>(this.detach_AssignedProjectResources));
     5688      this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
     5689      this._Projects = new EntitySet<Project>(new Action<Project>(this.attach_Projects), new Action<Project>(this.detach_Projects));
     5690      this._ProjectPermissions = new EntitySet<ProjectPermission>(new Action<ProjectPermission>(this.attach_ProjectPermissions), new Action<ProjectPermission>(this.detach_ProjectPermissions));
     5691      this._Project1 = default(EntityRef<Project>);
     5692      OnCreated();
     5693    }
     5694   
     5695    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
     5696    public System.Guid ProjectId
     5697    {
     5698      get
     5699      {
     5700        return this._ProjectId;
     5701      }
     5702      set
     5703      {
     5704        if ((this._ProjectId != value))
     5705        {
     5706          this.OnProjectIdChanging(value);
     5707          this.SendPropertyChanging();
     5708          this._ProjectId = value;
     5709          this.SendPropertyChanged("ProjectId");
     5710          this.OnProjectIdChanged();
     5711        }
     5712      }
     5713    }
     5714   
     5715    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentProjectId", DbType="UniqueIdentifier")]
     5716    public System.Nullable<System.Guid> ParentProjectId
     5717    {
     5718      get
     5719      {
     5720        return this._ParentProjectId;
     5721      }
     5722      set
     5723      {
     5724        if ((this._ParentProjectId != value))
     5725        {
     5726          if (this._Project1.HasLoadedOrAssignedValue)
     5727          {
     5728            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     5729          }
     5730          this.OnParentProjectIdChanging(value);
     5731          this.SendPropertyChanging();
     5732          this._ParentProjectId = value;
     5733          this.SendPropertyChanged("ParentProjectId");
     5734          this.OnParentProjectIdChanged();
     5735        }
     5736      }
     5737    }
     5738   
     5739    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime NOT NULL")]
     5740    public System.DateTime DateCreated
     5741    {
     5742      get
     5743      {
     5744        return this._DateCreated;
     5745      }
     5746      set
     5747      {
     5748        if ((this._DateCreated != value))
     5749        {
     5750          this.OnDateCreatedChanging(value);
     5751          this.SendPropertyChanging();
     5752          this._DateCreated = value;
     5753          this.SendPropertyChanged("DateCreated");
     5754          this.OnDateCreatedChanged();
     5755        }
     5756      }
     5757    }
     5758   
     5759    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(MAX) NOT NULL", CanBeNull=false)]
     5760    public string Name
     5761    {
     5762      get
     5763      {
     5764        return this._Name;
     5765      }
     5766      set
     5767      {
     5768        if ((this._Name != value))
     5769        {
     5770          this.OnNameChanging(value);
     5771          this.SendPropertyChanging();
     5772          this._Name = value;
     5773          this.SendPropertyChanged("Name");
     5774          this.OnNameChanged();
     5775        }
     5776      }
     5777    }
     5778   
     5779    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="VarChar(MAX)")]
     5780    public string Description
     5781    {
     5782      get
     5783      {
     5784        return this._Description;
     5785      }
     5786      set
     5787      {
     5788        if ((this._Description != value))
     5789        {
     5790          this.OnDescriptionChanging(value);
     5791          this.SendPropertyChanging();
     5792          this._Description = value;
     5793          this.SendPropertyChanged("Description");
     5794          this.OnDescriptionChanged();
     5795        }
     5796      }
     5797    }
     5798   
     5799    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OwnerUserId", DbType="UniqueIdentifier NOT NULL")]
     5800    public System.Guid OwnerUserId
     5801    {
     5802      get
     5803      {
     5804        return this._OwnerUserId;
     5805      }
     5806      set
     5807      {
     5808        if ((this._OwnerUserId != value))
     5809        {
     5810          this.OnOwnerUserIdChanging(value);
     5811          this.SendPropertyChanging();
     5812          this._OwnerUserId = value;
     5813          this.SendPropertyChanged("OwnerUserId");
     5814          this.OnOwnerUserIdChanged();
     5815        }
     5816      }
     5817    }
     5818   
     5819    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime NOT NULL")]
     5820    public System.DateTime StartDate
     5821    {
     5822      get
     5823      {
     5824        return this._StartDate;
     5825      }
     5826      set
     5827      {
     5828        if ((this._StartDate != value))
     5829        {
     5830          this.OnStartDateChanging(value);
     5831          this.SendPropertyChanging();
     5832          this._StartDate = value;
     5833          this.SendPropertyChanged("StartDate");
     5834          this.OnStartDateChanged();
     5835        }
     5836      }
     5837    }
     5838   
     5839    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime")]
     5840    public System.Nullable<System.DateTime> EndDate
     5841    {
     5842      get
     5843      {
     5844        return this._EndDate;
     5845      }
     5846      set
     5847      {
     5848        if ((this._EndDate != value))
     5849        {
     5850          this.OnEndDateChanging(value);
     5851          this.SendPropertyChanging();
     5852          this._EndDate = value;
     5853          this.SendPropertyChanged("EndDate");
     5854          this.OnEndDateChanged();
     5855        }
     5856      }
     5857    }
     5858   
     5859    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedProjectResource", Storage="_AssignedProjectResources", ThisKey="ProjectId", OtherKey="ProjectId")]
     5860    public EntitySet<AssignedProjectResource> AssignedProjectResources
     5861    {
     5862      get
     5863      {
     5864        return this._AssignedProjectResources;
     5865      }
     5866      set
     5867      {
     5868        this._AssignedProjectResources.Assign(value);
     5869      }
     5870    }
     5871   
     5872    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Job", Storage="_Jobs", ThisKey="ProjectId", OtherKey="ProjectId")]
     5873    public EntitySet<Job> Jobs
     5874    {
     5875      get
     5876      {
     5877        return this._Jobs;
     5878      }
     5879      set
     5880      {
     5881        this._Jobs.Assign(value);
     5882      }
     5883    }
     5884   
     5885    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Project", Storage="_Projects", ThisKey="ProjectId", OtherKey="ParentProjectId")]
     5886    public EntitySet<Project> ChildProjects
     5887    {
     5888      get
     5889      {
     5890        return this._Projects;
     5891      }
     5892      set
     5893      {
     5894        this._Projects.Assign(value);
     5895      }
     5896    }
     5897   
     5898    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_ProjectPermissions", ThisKey="ProjectId", OtherKey="ProjectId")]
     5899    public EntitySet<ProjectPermission> ProjectPermissions
     5900    {
     5901      get
     5902      {
     5903        return this._ProjectPermissions;
     5904      }
     5905      set
     5906      {
     5907        this._ProjectPermissions.Assign(value);
     5908      }
     5909    }
     5910   
     5911    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Project", Storage="_Project1", ThisKey="ParentProjectId", OtherKey="ProjectId", IsForeignKey=true)]
     5912    public Project ParentProject
     5913    {
     5914      get
     5915      {
     5916        return this._Project1.Entity;
     5917      }
     5918      set
     5919      {
     5920        Project previousValue = this._Project1.Entity;
     5921        if (((previousValue != value)
     5922              || (this._Project1.HasLoadedOrAssignedValue == false)))
     5923        {
     5924          this.SendPropertyChanging();
     5925          if ((previousValue != null))
     5926          {
     5927            this._Project1.Entity = null;
     5928            previousValue.ChildProjects.Remove(this);
     5929          }
     5930          this._Project1.Entity = value;
     5931          if ((value != null))
     5932          {
     5933            value.ChildProjects.Add(this);
     5934            this._ParentProjectId = value.ProjectId;
     5935          }
     5936          else
     5937          {
     5938            this._ParentProjectId = default(Nullable<System.Guid>);
     5939          }
     5940          this.SendPropertyChanged("ParentProject");
     5941        }
     5942      }
     5943    }
     5944   
     5945    public event PropertyChangingEventHandler PropertyChanging;
     5946   
     5947    public event PropertyChangedEventHandler PropertyChanged;
     5948   
     5949    protected virtual void SendPropertyChanging()
     5950    {
     5951      if ((this.PropertyChanging != null))
     5952      {
     5953        this.PropertyChanging(this, emptyChangingEventArgs);
     5954      }
     5955    }
     5956   
     5957    protected virtual void SendPropertyChanged(String propertyName)
     5958    {
     5959      if ((this.PropertyChanged != null))
     5960      {
     5961        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
     5962      }
     5963    }
     5964   
     5965    private void attach_AssignedProjectResources(AssignedProjectResource entity)
     5966    {
     5967      this.SendPropertyChanging();
     5968      entity.Project = this;
     5969    }
     5970   
     5971    private void detach_AssignedProjectResources(AssignedProjectResource entity)
     5972    {
     5973      this.SendPropertyChanging();
     5974      entity.Project = null;
     5975    }
     5976   
     5977    private void attach_Jobs(Job entity)
     5978    {
     5979      this.SendPropertyChanging();
     5980      entity.Project = this;
     5981    }
     5982   
     5983    private void detach_Jobs(Job entity)
     5984    {
     5985      this.SendPropertyChanging();
     5986      entity.Project = null;
     5987    }
     5988   
     5989    private void attach_Projects(Project entity)
     5990    {
     5991      this.SendPropertyChanging();
     5992      entity.ParentProject = this;
     5993    }
     5994   
     5995    private void detach_Projects(Project entity)
     5996    {
     5997      this.SendPropertyChanging();
     5998      entity.ParentProject = null;
     5999    }
     6000   
     6001    private void attach_ProjectPermissions(ProjectPermission entity)
     6002    {
     6003      this.SendPropertyChanging();
     6004      entity.Project = this;
     6005    }
     6006   
     6007    private void detach_ProjectPermissions(ProjectPermission entity)
     6008    {
     6009      this.SendPropertyChanging();
     6010      entity.Project = null;
     6011    }
     6012  }
     6013 
     6014  [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ProjectPermission")]
     6015  public partial class ProjectPermission : INotifyPropertyChanging, INotifyPropertyChanged
     6016  {
     6017   
     6018    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
     6019   
     6020    private System.Guid _ProjectId;
     6021   
     6022    private System.Guid _GrantedUserId;
     6023   
     6024    private System.Guid _GrantedByUserId;
     6025   
     6026    private EntityRef<Project> _Project;
     6027   
     6028    #region Extensibility Method Definitions
     6029    partial void OnLoaded();
     6030    partial void OnValidate(System.Data.Linq.ChangeAction action);
     6031    partial void OnCreated();
     6032    partial void OnProjectIdChanging(System.Guid value);
     6033    partial void OnProjectIdChanged();
     6034    partial void OnGrantedUserIdChanging(System.Guid value);
     6035    partial void OnGrantedUserIdChanged();
     6036    partial void OnGrantedByUserIdChanging(System.Guid value);
     6037    partial void OnGrantedByUserIdChanged();
     6038    #endregion
     6039   
     6040    public ProjectPermission()
     6041    {
     6042      this._Project = default(EntityRef<Project>);
     6043      OnCreated();
     6044    }
     6045   
     6046    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
     6047    public System.Guid ProjectId
     6048    {
     6049      get
     6050      {
     6051        return this._ProjectId;
     6052      }
     6053      set
     6054      {
     6055        if ((this._ProjectId != value))
     6056        {
     6057          if (this._Project.HasLoadedOrAssignedValue)
     6058          {
     6059            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     6060          }
     6061          this.OnProjectIdChanging(value);
     6062          this.SendPropertyChanging();
     6063          this._ProjectId = value;
     6064          this.SendPropertyChanged("ProjectId");
     6065          this.OnProjectIdChanged();
     6066        }
     6067      }
     6068    }
     6069   
     6070    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedUserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
     6071    public System.Guid GrantedUserId
     6072    {
     6073      get
     6074      {
     6075        return this._GrantedUserId;
     6076      }
     6077      set
     6078      {
     6079        if ((this._GrantedUserId != value))
     6080        {
     6081          this.OnGrantedUserIdChanging(value);
     6082          this.SendPropertyChanging();
     6083          this._GrantedUserId = value;
     6084          this.SendPropertyChanged("GrantedUserId");
     6085          this.OnGrantedUserIdChanged();
     6086        }
     6087      }
     6088    }
     6089   
     6090    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedByUserId", DbType="UniqueIdentifier NOT NULL")]
     6091    public System.Guid GrantedByUserId
     6092    {
     6093      get
     6094      {
     6095        return this._GrantedByUserId;
     6096      }
     6097      set
     6098      {
     6099        if ((this._GrantedByUserId != value))
     6100        {
     6101          this.OnGrantedByUserIdChanging(value);
     6102          this.SendPropertyChanging();
     6103          this._GrantedByUserId = value;
     6104          this.SendPropertyChanged("GrantedByUserId");
     6105          this.OnGrantedByUserIdChanged();
     6106        }
     6107      }
     6108    }
     6109   
     6110    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteOnNull=true)]
     6111    public Project Project
     6112    {
     6113      get
     6114      {
     6115        return this._Project.Entity;
     6116      }
     6117      set
     6118      {
     6119        Project previousValue = this._Project.Entity;
     6120        if (((previousValue != value)
     6121              || (this._Project.HasLoadedOrAssignedValue == false)))
     6122        {
     6123          this.SendPropertyChanging();
     6124          if ((previousValue != null))
     6125          {
     6126            this._Project.Entity = null;
     6127            previousValue.ProjectPermissions.Remove(this);
     6128          }
     6129          this._Project.Entity = value;
     6130          if ((value != null))
     6131          {
     6132            value.ProjectPermissions.Add(this);
     6133            this._ProjectId = value.ProjectId;
     6134          }
     6135          else
     6136          {
     6137            this._ProjectId = default(System.Guid);
     6138          }
     6139          this.SendPropertyChanged("Project");
     6140        }
     6141      }
     6142    }
     6143   
     6144    public event PropertyChangingEventHandler PropertyChanging;
     6145   
     6146    public event PropertyChangedEventHandler PropertyChanged;
     6147   
     6148    protected virtual void SendPropertyChanging()
     6149    {
     6150      if ((this.PropertyChanging != null))
     6151      {
     6152        this.PropertyChanging(this, emptyChangingEventArgs);
     6153      }
     6154    }
     6155   
     6156    protected virtual void SendPropertyChanged(String propertyName)
     6157    {
     6158      if ((this.PropertyChanged != null))
     6159      {
     6160        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
     6161      }
     6162    }
     6163  }
     6164 
     6165  [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.AssignedJobResource")]
     6166  public partial class AssignedJobResource : INotifyPropertyChanging, INotifyPropertyChanged
     6167  {
     6168   
     6169    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
     6170   
     6171    private System.Guid _ResourceId;
     6172   
     6173    private System.Guid _JobId;
     6174   
     6175    private EntityRef<Resource> _Resource;
     6176   
     6177    private EntityRef<Job> _Job;
     6178   
     6179    #region Extensibility Method Definitions
     6180    partial void OnLoaded();
     6181    partial void OnValidate(System.Data.Linq.ChangeAction action);
     6182    partial void OnCreated();
     6183    partial void OnResourceIdChanging(System.Guid value);
     6184    partial void OnResourceIdChanged();
     6185    partial void OnJobIdChanging(System.Guid value);
     6186    partial void OnJobIdChanged();
     6187    #endregion
     6188   
     6189    public AssignedJobResource()
     6190    {
     6191      this._Resource = default(EntityRef<Resource>);
     6192      this._Job = default(EntityRef<Job>);
     6193      OnCreated();
     6194    }
     6195   
     6196    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
     6197    public System.Guid ResourceId
     6198    {
     6199      get
     6200      {
     6201        return this._ResourceId;
     6202      }
     6203      set
     6204      {
     6205        if ((this._ResourceId != value))
     6206        {
     6207          if (this._Resource.HasLoadedOrAssignedValue)
     6208          {
     6209            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     6210          }
     6211          this.OnResourceIdChanging(value);
     6212          this.SendPropertyChanging();
     6213          this._ResourceId = value;
     6214          this.SendPropertyChanged("ResourceId");
     6215          this.OnResourceIdChanged();
     6216        }
     6217      }
     6218    }
     6219   
     6220    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
     6221    public System.Guid JobId
     6222    {
     6223      get
     6224      {
     6225        return this._JobId;
     6226      }
     6227      set
     6228      {
     6229        if ((this._JobId != value))
     6230        {
     6231          if (this._Job.HasLoadedOrAssignedValue)
     6232          {
     6233            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     6234          }
     6235          this.OnJobIdChanging(value);
     6236          this.SendPropertyChanging();
     6237          this._JobId = value;
     6238          this.SendPropertyChanged("JobId");
     6239          this.OnJobIdChanged();
     6240        }
     6241      }
     6242    }
     6243   
     6244    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedJobResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteOnNull=true)]
     6245    public Resource Resource
     6246    {
     6247      get
     6248      {
     6249        return this._Resource.Entity;
     6250      }
     6251      set
     6252      {
     6253        Resource previousValue = this._Resource.Entity;
     6254        if (((previousValue != value)
     6255              || (this._Resource.HasLoadedOrAssignedValue == false)))
     6256        {
     6257          this.SendPropertyChanging();
     6258          if ((previousValue != null))
     6259          {
     6260            this._Resource.Entity = null;
     6261            previousValue.AssignedJobResources.Remove(this);
     6262          }
     6263          this._Resource.Entity = value;
     6264          if ((value != null))
     6265          {
     6266            value.AssignedJobResources.Add(this);
     6267            this._ResourceId = value.ResourceId;
     6268          }
     6269          else
     6270          {
     6271            this._ResourceId = default(System.Guid);
     6272          }
     6273          this.SendPropertyChanged("Resource");
     6274        }
     6275      }
     6276    }
     6277   
     6278    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_AssignedJobResource", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true, DeleteOnNull=true)]
     6279    public Job Job
     6280    {
     6281      get
     6282      {
     6283        return this._Job.Entity;
     6284      }
     6285      set
     6286      {
     6287        Job previousValue = this._Job.Entity;
     6288        if (((previousValue != value)
     6289              || (this._Job.HasLoadedOrAssignedValue == false)))
     6290        {
     6291          this.SendPropertyChanging();
     6292          if ((previousValue != null))
     6293          {
     6294            this._Job.Entity = null;
     6295            previousValue.AssignedJobResources.Remove(this);
     6296          }
     6297          this._Job.Entity = value;
     6298          if ((value != null))
     6299          {
     6300            value.AssignedJobResources.Add(this);
     6301            this._JobId = value.JobId;
     6302          }
     6303          else
     6304          {
     6305            this._JobId = default(System.Guid);
     6306          }
     6307          this.SendPropertyChanged("Job");
     6308        }
     6309      }
     6310    }
     6311   
     6312    public event PropertyChangingEventHandler PropertyChanging;
     6313   
     6314    public event PropertyChangedEventHandler PropertyChanged;
     6315   
     6316    protected virtual void SendPropertyChanging()
     6317    {
     6318      if ((this.PropertyChanging != null))
     6319      {
     6320        this.PropertyChanging(this, emptyChangingEventArgs);
     6321      }
     6322    }
     6323   
     6324    protected virtual void SendPropertyChanged(String propertyName)
     6325    {
     6326      if ((this.PropertyChanged != null))
     6327      {
     6328        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
     6329      }
     6330    }
     6331  }
     6332 
     6333  [global::System.Data.Linq.Mapping.TableAttribute(Name="[statistics].FactProjectInfo")]
     6334  public partial class FactProjectInfo : INotifyPropertyChanging, INotifyPropertyChanged
     6335  {
     6336   
     6337    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
     6338   
     6339    private System.Guid _ProjectId;
     6340   
     6341    private System.DateTime _Time;
     6342   
     6343    private int _NumTotalCores;
     6344   
     6345    private int _NumUsedCores;
     6346   
     6347    private int _TotalMemory;
     6348   
     6349    private int _UsedMemory;
     6350   
     6351    private EntityRef<DimProject> _DimProject;
     6352   
     6353    private EntityRef<DimTime> _DimTime;
     6354   
     6355    #region Extensibility Method Definitions
     6356    partial void OnLoaded();
     6357    partial void OnValidate(System.Data.Linq.ChangeAction action);
     6358    partial void OnCreated();
     6359    partial void OnProjectIdChanging(System.Guid value);
     6360    partial void OnProjectIdChanged();
     6361    partial void OnTimeChanging(System.DateTime value);
     6362    partial void OnTimeChanged();
     6363    partial void OnNumTotalCoresChanging(int value);
     6364    partial void OnNumTotalCoresChanged();
     6365    partial void OnNumUsedCoresChanging(int value);
     6366    partial void OnNumUsedCoresChanged();
     6367    partial void OnTotalMemoryChanging(int value);
     6368    partial void OnTotalMemoryChanged();
     6369    partial void OnUsedMemoryChanging(int value);
     6370    partial void OnUsedMemoryChanged();
     6371    #endregion
     6372   
     6373    public FactProjectInfo()
     6374    {
     6375      this._DimProject = default(EntityRef<DimProject>);
     6376      this._DimTime = default(EntityRef<DimTime>);
     6377      OnCreated();
     6378    }
     6379   
     6380    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
     6381    public System.Guid ProjectId
     6382    {
     6383      get
     6384      {
     6385        return this._ProjectId;
     6386      }
     6387      set
     6388      {
     6389        if ((this._ProjectId != value))
     6390        {
     6391          if (this._DimProject.HasLoadedOrAssignedValue)
     6392          {
     6393            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     6394          }
     6395          this.OnProjectIdChanging(value);
     6396          this.SendPropertyChanging();
     6397          this._ProjectId = value;
     6398          this.SendPropertyChanged("ProjectId");
     6399          this.OnProjectIdChanged();
     6400        }
     6401      }
     6402    }
     6403   
     6404    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Time", DbType="DateTime NOT NULL", IsPrimaryKey=true)]
     6405    public System.DateTime Time
     6406    {
     6407      get
     6408      {
     6409        return this._Time;
     6410      }
     6411      set
     6412      {
     6413        if ((this._Time != value))
     6414        {
     6415          if (this._DimTime.HasLoadedOrAssignedValue)
     6416          {
     6417            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     6418          }
     6419          this.OnTimeChanging(value);
     6420          this.SendPropertyChanging();
     6421          this._Time = value;
     6422          this.SendPropertyChanged("Time");
     6423          this.OnTimeChanged();
     6424        }
     6425      }
     6426    }
     6427   
     6428    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumTotalCores", DbType="Int NOT NULL")]
     6429    public int NumTotalCores
     6430    {
     6431      get
     6432      {
     6433        return this._NumTotalCores;
     6434      }
     6435      set
     6436      {
     6437        if ((this._NumTotalCores != value))
     6438        {
     6439          this.OnNumTotalCoresChanging(value);
     6440          this.SendPropertyChanging();
     6441          this._NumTotalCores = value;
     6442          this.SendPropertyChanged("NumTotalCores");
     6443          this.OnNumTotalCoresChanged();
     6444        }
     6445      }
     6446    }
     6447   
     6448    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumUsedCores", DbType="Int NOT NULL")]
     6449    public int NumUsedCores
     6450    {
     6451      get
     6452      {
     6453        return this._NumUsedCores;
     6454      }
     6455      set
     6456      {
     6457        if ((this._NumUsedCores != value))
     6458        {
     6459          this.OnNumUsedCoresChanging(value);
     6460          this.SendPropertyChanging();
     6461          this._NumUsedCores = value;
     6462          this.SendPropertyChanged("NumUsedCores");
     6463          this.OnNumUsedCoresChanged();
     6464        }
     6465      }
     6466    }
     6467   
     6468    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalMemory", DbType="Int NOT NULL")]
     6469    public int TotalMemory
     6470    {
     6471      get
     6472      {
     6473        return this._TotalMemory;
     6474      }
     6475      set
     6476      {
     6477        if ((this._TotalMemory != value))
     6478        {
     6479          this.OnTotalMemoryChanging(value);
     6480          this.SendPropertyChanging();
     6481          this._TotalMemory = value;
     6482          this.SendPropertyChanged("TotalMemory");
     6483          this.OnTotalMemoryChanged();
     6484        }
     6485      }
     6486    }
     6487   
     6488    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UsedMemory", DbType="Int NOT NULL")]
     6489    public int UsedMemory
     6490    {
     6491      get
     6492      {
     6493        return this._UsedMemory;
     6494      }
     6495      set
     6496      {
     6497        if ((this._UsedMemory != value))
     6498        {
     6499          this.OnUsedMemoryChanging(value);
     6500          this.SendPropertyChanging();
     6501          this._UsedMemory = value;
     6502          this.SendPropertyChanged("UsedMemory");
     6503          this.OnUsedMemoryChanged();
     6504        }
     6505      }
     6506    }
     6507   
     6508    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimProject_FactProjectInfo", Storage="_DimProject", ThisKey="ProjectId", OtherKey="Id", IsForeignKey=true)]
     6509    public DimProject DimProject
     6510    {
     6511      get
     6512      {
     6513        return this._DimProject.Entity;
     6514      }
     6515      set
     6516      {
     6517        DimProject previousValue = this._DimProject.Entity;
     6518        if (((previousValue != value)
     6519              || (this._DimProject.HasLoadedOrAssignedValue == false)))
     6520        {
     6521          this.SendPropertyChanging();
     6522          if ((previousValue != null))
     6523          {
     6524            this._DimProject.Entity = null;
     6525            previousValue.FactProjectInfos.Remove(this);
     6526          }
     6527          this._DimProject.Entity = value;
     6528          if ((value != null))
     6529          {
     6530            value.FactProjectInfos.Add(this);
     6531            this._ProjectId = value.Id;
     6532          }
     6533          else
     6534          {
     6535            this._ProjectId = default(System.Guid);
     6536          }
     6537          this.SendPropertyChanged("DimProject");
     6538        }
     6539      }
     6540    }
     6541   
     6542    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimTime_FactProjectInfo", Storage="_DimTime", ThisKey="Time", OtherKey="Time", IsForeignKey=true)]
     6543    public DimTime DimTime
     6544    {
     6545      get
     6546      {
     6547        return this._DimTime.Entity;
     6548      }
     6549      set
     6550      {
     6551        DimTime previousValue = this._DimTime.Entity;
     6552        if (((previousValue != value)
     6553              || (this._DimTime.HasLoadedOrAssignedValue == false)))
     6554        {
     6555          this.SendPropertyChanging();
     6556          if ((previousValue != null))
     6557          {
     6558            this._DimTime.Entity = null;
     6559            previousValue.FactProjectInfos.Remove(this);
     6560          }
     6561          this._DimTime.Entity = value;
     6562          if ((value != null))
     6563          {
     6564            value.FactProjectInfos.Add(this);
     6565            this._Time = value.Time;
     6566          }
     6567          else
     6568          {
     6569            this._Time = default(System.DateTime);
     6570          }
     6571          this.SendPropertyChanged("DimTime");
     6572        }
     6573      }
     6574    }
     6575   
     6576    public event PropertyChangingEventHandler PropertyChanging;
     6577   
     6578    public event PropertyChangedEventHandler PropertyChanged;
     6579   
     6580    protected virtual void SendPropertyChanging()
     6581    {
     6582      if ((this.PropertyChanging != null))
     6583      {
     6584        this.PropertyChanging(this, emptyChangingEventArgs);
     6585      }
     6586    }
     6587   
     6588    protected virtual void SendPropertyChanged(String propertyName)
     6589    {
     6590      if ((this.PropertyChanged != null))
     6591      {
     6592        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
     6593      }
     6594    }
     6595  }
     6596 
     6597  [global::System.Data.Linq.Mapping.TableAttribute(Name="[statistics].DimProject")]
     6598  public partial class DimProject : INotifyPropertyChanging, INotifyPropertyChanged
     6599  {
     6600   
     6601    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
     6602   
     6603    private System.Guid _Id;
     6604   
     6605    private System.Guid _ProjectId;
     6606   
     6607    private System.Nullable<System.Guid> _ParentId;
     6608   
     6609    private string _Name;
     6610   
     6611    private string _Description;
     6612   
     6613    private System.Guid _OwnerUserId;
     6614   
     6615    private System.DateTime _StartDate;
     6616   
     6617    private System.Nullable<System.DateTime> _EndDate;
     6618   
     6619    private System.DateTime _DateCreated;
     6620   
     6621    private System.Nullable<System.DateTime> _DateExpired;
     6622   
     6623    private EntitySet<DimJob> _DimJobs;
     6624   
     6625    private EntitySet<FactProjectInfo> _FactProjectInfos;
     6626   
     6627    #region Extensibility Method Definitions
     6628    partial void OnLoaded();
     6629    partial void OnValidate(System.Data.Linq.ChangeAction action);
     6630    partial void OnCreated();
     6631    partial void OnIdChanging(System.Guid value);
     6632    partial void OnIdChanged();
     6633    partial void OnProjectIdChanging(System.Guid value);
     6634    partial void OnProjectIdChanged();
     6635    partial void OnParentProjectIdChanging(System.Nullable<System.Guid> value);
     6636    partial void OnParentProjectIdChanged();
     6637    partial void OnNameChanging(string value);
     6638    partial void OnNameChanged();
     6639    partial void OnDescriptionChanging(string value);
     6640    partial void OnDescriptionChanged();
     6641    partial void OnOwnerUserIdChanging(System.Guid value);
     6642    partial void OnOwnerUserIdChanged();
     6643    partial void OnStartDateChanging(System.DateTime value);
     6644    partial void OnStartDateChanged();
     6645    partial void OnEndDateChanging(System.Nullable<System.DateTime> value);
     6646    partial void OnEndDateChanged();
     6647    partial void OnDateCreatedChanging(System.DateTime value);
     6648    partial void OnDateCreatedChanged();
     6649    partial void OnDateExpiredChanging(System.Nullable<System.DateTime> value);
     6650    partial void OnDateExpiredChanged();
     6651    #endregion
     6652   
     6653    public DimProject()
     6654    {
     6655      this._DimJobs = new EntitySet<DimJob>(new Action<DimJob>(this.attach_DimJobs), new Action<DimJob>(this.detach_DimJobs));
     6656      this._FactProjectInfos = new EntitySet<FactProjectInfo>(new Action<FactProjectInfo>(this.attach_FactProjectInfos), new Action<FactProjectInfo>(this.detach_FactProjectInfos));
     6657      OnCreated();
     6658    }
     6659   
     6660    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
     6661    public System.Guid Id
     6662    {
     6663      get
     6664      {
     6665        return this._Id;
     6666      }
     6667      set
     6668      {
     6669        if ((this._Id != value))
     6670        {
     6671          this.OnIdChanging(value);
     6672          this.SendPropertyChanging();
     6673          this._Id = value;
     6674          this.SendPropertyChanged("Id");
     6675          this.OnIdChanged();
     6676        }
     6677      }
     6678    }
     6679   
     6680    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL")]
     6681    public System.Guid ProjectId
     6682    {
     6683      get
     6684      {
     6685        return this._ProjectId;
     6686      }
     6687      set
     6688      {
     6689        if ((this._ProjectId != value))
     6690        {
     6691          this.OnProjectIdChanging(value);
     6692          this.SendPropertyChanging();
     6693          this._ProjectId = value;
     6694          this.SendPropertyChanged("ProjectId");
     6695          this.OnProjectIdChanged();
     6696        }
     6697      }
     6698    }
     6699   
     6700    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentId", DbType="UniqueIdentifier")]
     6701    public System.Nullable<System.Guid> ParentProjectId
     6702    {
     6703      get
     6704      {
     6705        return this._ParentId;
     6706      }
     6707      set
     6708      {
     6709        if ((this._ParentId != value))
     6710        {
     6711          this.OnParentProjectIdChanging(value);
     6712          this.SendPropertyChanging();
     6713          this._ParentId = value;
     6714          this.SendPropertyChanged("ParentProjectId");
     6715          this.OnParentProjectIdChanged();
     6716        }
     6717      }
     6718    }
     6719   
     6720    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", CanBeNull=false)]
     6721    public string Name
     6722    {
     6723      get
     6724      {
     6725        return this._Name;
     6726      }
     6727      set
     6728      {
     6729        if ((this._Name != value))
     6730        {
     6731          this.OnNameChanging(value);
     6732          this.SendPropertyChanging();
     6733          this._Name = value;
     6734          this.SendPropertyChanged("Name");
     6735          this.OnNameChanged();
     6736        }
     6737      }
     6738    }
     6739   
     6740    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description")]
     6741    public string Description
     6742    {
     6743      get
     6744      {
     6745        return this._Description;
     6746      }
     6747      set
     6748      {
     6749        if ((this._Description != value))
     6750        {
     6751          this.OnDescriptionChanging(value);
     6752          this.SendPropertyChanging();
     6753          this._Description = value;
     6754          this.SendPropertyChanged("Description");
     6755          this.OnDescriptionChanged();
     6756        }
     6757      }
     6758    }
     6759   
     6760    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OwnerUserId", DbType="UniqueIdentifier NOT NULL")]
     6761    public System.Guid OwnerUserId
     6762    {
     6763      get
     6764      {
     6765        return this._OwnerUserId;
     6766      }
     6767      set
     6768      {
     6769        if ((this._OwnerUserId != value))
     6770        {
     6771          this.OnOwnerUserIdChanging(value);
     6772          this.SendPropertyChanging();
     6773          this._OwnerUserId = value;
     6774          this.SendPropertyChanged("OwnerUserId");
     6775          this.OnOwnerUserIdChanged();
     6776        }
     6777      }
     6778    }
     6779   
     6780    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime NOT NULL")]
     6781    public System.DateTime StartDate
     6782    {
     6783      get
     6784      {
     6785        return this._StartDate;
     6786      }
     6787      set
     6788      {
     6789        if ((this._StartDate != value))
     6790        {
     6791          this.OnStartDateChanging(value);
     6792          this.SendPropertyChanging();
     6793          this._StartDate = value;
     6794          this.SendPropertyChanged("StartDate");
     6795          this.OnStartDateChanged();
     6796        }
     6797      }
     6798    }
     6799   
     6800    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime")]
     6801    public System.Nullable<System.DateTime> EndDate
     6802    {
     6803      get
     6804      {
     6805        return this._EndDate;
     6806      }
     6807      set
     6808      {
     6809        if ((this._EndDate != value))
     6810        {
     6811          this.OnEndDateChanging(value);
     6812          this.SendPropertyChanging();
     6813          this._EndDate = value;
     6814          this.SendPropertyChanged("EndDate");
     6815          this.OnEndDateChanged();
     6816        }
     6817      }
     6818    }
     6819   
     6820    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime NOT NULL")]
     6821    public System.DateTime DateCreated
     6822    {
     6823      get
     6824      {
     6825        return this._DateCreated;
     6826      }
     6827      set
     6828      {
     6829        if ((this._DateCreated != value))
     6830        {
     6831          this.OnDateCreatedChanging(value);
     6832          this.SendPropertyChanging();
     6833          this._DateCreated = value;
     6834          this.SendPropertyChanged("DateCreated");
     6835          this.OnDateCreatedChanged();
     6836        }
     6837      }
     6838    }
     6839   
     6840    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateExpired", DbType="DateTime")]
     6841    public System.Nullable<System.DateTime> DateExpired
     6842    {
     6843      get
     6844      {
     6845        return this._DateExpired;
     6846      }
     6847      set
     6848      {
     6849        if ((this._DateExpired != value))
     6850        {
     6851          this.OnDateExpiredChanging(value);
     6852          this.SendPropertyChanging();
     6853          this._DateExpired = value;
     6854          this.SendPropertyChanged("DateExpired");
     6855          this.OnDateExpiredChanged();
     6856        }
     6857      }
     6858    }
     6859   
     6860    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimProject_DimJob", Storage="_DimJobs", ThisKey="Id", OtherKey="ProjectId")]
     6861    public EntitySet<DimJob> DimJobs
     6862    {
     6863      get
     6864      {
     6865        return this._DimJobs;
     6866      }
     6867      set
     6868      {
     6869        this._DimJobs.Assign(value);
     6870      }
     6871    }
     6872   
     6873    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimProject_FactProjectInfo", Storage="_FactProjectInfos", ThisKey="Id", OtherKey="ProjectId")]
     6874    public EntitySet<FactProjectInfo> FactProjectInfos
     6875    {
     6876      get
     6877      {
     6878        return this._FactProjectInfos;
     6879      }
     6880      set
     6881      {
     6882        this._FactProjectInfos.Assign(value);
     6883      }
     6884    }
     6885   
     6886    public event PropertyChangingEventHandler PropertyChanging;
     6887   
     6888    public event PropertyChangedEventHandler PropertyChanged;
     6889   
     6890    protected virtual void SendPropertyChanging()
     6891    {
     6892      if ((this.PropertyChanging != null))
     6893      {
     6894        this.PropertyChanging(this, emptyChangingEventArgs);
     6895      }
     6896    }
     6897   
     6898    protected virtual void SendPropertyChanged(String propertyName)
     6899    {
     6900      if ((this.PropertyChanged != null))
     6901      {
     6902        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
     6903      }
     6904    }
     6905   
     6906    private void attach_DimJobs(DimJob entity)
     6907    {
     6908      this.SendPropertyChanging();
     6909      entity.DimProject = this;
     6910    }
     6911   
     6912    private void detach_DimJobs(DimJob entity)
     6913    {
     6914      this.SendPropertyChanging();
     6915      entity.DimProject = null;
     6916    }
     6917   
     6918    private void attach_FactProjectInfos(FactProjectInfo entity)
     6919    {
     6920      this.SendPropertyChanging();
     6921      entity.DimProject = this;
     6922    }
     6923   
     6924    private void detach_FactProjectInfos(FactProjectInfo entity)
     6925    {
     6926      this.SendPropertyChanging();
     6927      entity.DimProject = null;
     6928    }
     6929  }
    56096930}
    56106931#pragma warning restore 1591
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IPersistenceManager.cs

    r15583 r16117  
    3131
    3232    #region Hive daos
    33     AssignedResourceDao AssignedResourceDao { get; }
     33    AssignedJobResourceDao AssignedJobResourceDao { get; }
     34    AssignedProjectResourceDao AssignedProjectResourceDao { get; }
    3435    DowntimeDao DowntimeDao { get; }
    3536    JobDao JobDao { get; }
     
    3839    PluginDao PluginDao { get; }
    3940    PluginDataDao PluginDataDao { get; }
     41    ProjectDao ProjectDao { get; }
     42    ProjectPermissionDao ProjectPermissionDao { get; }
    4043    RequiredPluginDao RequiredPluginDao { get; }
    4144    ResourceDao ResourceDao { get; }
    42     ResourcePermissionDao ResourcePermissionDao { get; }
    4345    SlaveDao SlaveDao { get; }
    4446    SlaveGroupDao SlaveGroupDao { get; }
     
    5658    FactClientInfoDao FactClientInfoDao { get; }
    5759    FactTaskDao FactTaskDao { get; }
     60    DimProjectDao DimProjectDao { get; }
     61    FactProjectInfoDao FactProjectInfoDao { get; }
    5862    #endregion
    5963
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Manager/PersistenceManager.cs

    r15583 r16117  
    3838    #region Hive daos
    3939
    40     private AssignedResourceDao assignedResourceDao;
    41     public AssignedResourceDao AssignedResourceDao {
    42       get { return assignedResourceDao ?? (assignedResourceDao = new AssignedResourceDao(dataContext)); }
     40    private AssignedJobResourceDao assignedJobResourceDao;
     41    public AssignedJobResourceDao AssignedJobResourceDao {
     42      get { return assignedJobResourceDao ?? (assignedJobResourceDao = new AssignedJobResourceDao(dataContext)); }
     43    }
     44
     45    private AssignedProjectResourceDao assignedProjectResourceDao;
     46    public AssignedProjectResourceDao AssignedProjectResourceDao {
     47      get { return assignedProjectResourceDao ?? (assignedProjectResourceDao = new AssignedProjectResourceDao(dataContext)); }
    4348    }
    4449
     
    7378    }
    7479
     80    private ProjectDao projectDao;
     81    public ProjectDao ProjectDao {
     82      get { return projectDao ?? (projectDao = new ProjectDao(dataContext)); }
     83    }
     84
     85    private ProjectPermissionDao projectPermissionDao;
     86    public ProjectPermissionDao ProjectPermissionDao {
     87      get { return projectPermissionDao ?? (projectPermissionDao = new ProjectPermissionDao(dataContext)); }
     88    }
     89
    7590    private RequiredPluginDao requiredPluginDao;
    7691    public RequiredPluginDao RequiredPluginDao {
     
    8398    }
    8499
    85     private ResourcePermissionDao resourcePermissionDao;
    86     public ResourcePermissionDao ResourcePermissionDao {
    87       get { return resourcePermissionDao ?? (resourcePermissionDao = new ResourcePermissionDao(dataContext)); }
    88     }
    89 
    90100    private SlaveDao slaveDao;
    91101    public SlaveDao SlaveDao {
     
    149159    public FactTaskDao FactTaskDao {
    150160      get { return factTaskDao ?? (factTaskDao = new FactTaskDao(dataContext)); }
     161    }
     162
     163    private DimProjectDao dimProjectDao;
     164    public DimProjectDao DimProjectDao {
     165      get { return dimProjectDao ?? (dimProjectDao = new DimProjectDao(dataContext)); }
     166    }
     167
     168    private FactProjectInfoDao factProjectInfoDao;
     169    public FactProjectInfoDao FactProjectInfoDao {
     170      get { return factProjectInfoDao ?? (factProjectInfoDao = new FactProjectInfoDao(dataContext)); }
    151171    }
    152172    #endregion
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql

    r14185 r16117  
    1717 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
    1818 */
    19 USE [HeuristicLab.Hive-3.3]
     19USE [HeuristicLab.Hive-3.4]
    2020
    2121EXEC sp_configure filestream_access_level, 2
     
    2525
    2626SET ARITHABORT ON
    27 CREATE TABLE [dbo].[AssignedResources](
     27
     28CREATE TABLE [dbo].[AssignedProjectResource](
    2829  [ResourceId] UniqueIdentifier NOT NULL,
    29   [TaskId] UniqueIdentifier NOT NULL,
    30   CONSTRAINT [PK_dbo.ResourceIdTaskId] PRIMARY KEY ([ResourceId], [TaskId])
     30  [ProjectId] UniqueIdentifier NOT NULL,
     31  CONSTRAINT [PK_dbo.ResourceIdProjectId] PRIMARY KEY ([ResourceId], [ProjectId])
     32  )
     33CREATE TABLE [dbo].[AssignedJobResource](
     34  [ResourceId] UniqueIdentifier NOT NULL,
     35  [JobId] UniqueIdentifier NOT NULL,
     36  CONSTRAINT [PK_dbo.ResourceIdJobId] PRIMARY KEY ([ResourceId], [JobId])
    3137  )
    3238CREATE TABLE [dbo].[Plugin](
     
    6773  CONSTRAINT [PK_dbo.Resource] PRIMARY KEY ([ResourceId])
    6874  )
    69 CREATE TABLE [dbo].[ResourcePermission](
    70   [ResourceId] UniqueIdentifier NOT NULL,
    71   [GrantedUserId] UniqueIdentifier NOT NULL,
    72   [GrantedByUserId] UniqueIdentifier NOT NULL,
    73   CONSTRAINT [PK_dbo.ResourcePermission] PRIMARY KEY ([ResourceId], [GrantedUserId])
    74   )
    7575CREATE TABLE [dbo].[Task](
    7676  [TaskId] UniqueIdentifier NOT NULL,
     
    103103  [Name] VarChar(MAX) NOT NULL,
    104104  [Description] VarChar(MAX),
    105   [ResourceIds] VarChar(MAX),
    106105  [OwnerUserId] UniqueIdentifier NOT NULL,
    107106  [DateCreated] DateTime NOT NULL,
     107  [ProjectId] UniqueIdentifier NOT NULL,
     108  [JobState] VarChar(30) NOT NULL,
    108109  CONSTRAINT [PK_dbo.Job] PRIMARY KEY ([JobId])
    109110  )
     
    148149  CONSTRAINT [PK_UserPriority] PRIMARY KEY ([UserId])
    149150  )
    150 ALTER TABLE [dbo].[AssignedResources]
    151   ADD CONSTRAINT [Resource_AssignedResource] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId])
    152 ALTER TABLE [dbo].[AssignedResources]
    153   ADD CONSTRAINT [Task_AssignedResource] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId])
     151CREATE TABLE [dbo].[Project](
     152  [ProjectId] UniqueIdentifier NOT NULL,
     153  [ParentProjectId] UniqueIdentifier,
     154  [DateCreated] DateTime NOT NULL,
     155  [Name] VarChar(MAX) NOT NULL,
     156  [Description] VarChar(MAX),
     157  [OwnerUserId] UniqueIdentifier NOT NULL,
     158  [StartDate] DateTime NOT NULL,
     159  [EndDate] DateTime,
     160  CONSTRAINT [PK_dbo.Project] PRIMARY KEY ([ProjectId])
     161  )
     162CREATE TABLE [dbo].[ProjectPermission](
     163  [ProjectId] UniqueIdentifier NOT NULL,
     164  [GrantedUserId] UniqueIdentifier NOT NULL,
     165  [GrantedByUserId] UniqueIdentifier NOT NULL,
     166  CONSTRAINT [PK_dbo.ProjectPermission] PRIMARY KEY ([ProjectId], [GrantedUserId])
     167  )
     168
     169ALTER TABLE [dbo].[AssignedProjectResource]
     170  ADD CONSTRAINT [Resource_AssignedProjectResource] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId]) ON UPDATE CASCADE ON DELETE CASCADE;
     171ALTER TABLE [dbo].[AssignedProjectResource]
     172  ADD CONSTRAINT [Project_AssignedProjectResource] FOREIGN KEY ([ProjectId]) REFERENCES [dbo].[Project]([ProjectId]) ON UPDATE CASCADE ON DELETE CASCADE;
     173ALTER TABLE [dbo].[AssignedJobResource]
     174  ADD CONSTRAINT [Resource_AssignedJobResource] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId]) ON UPDATE CASCADE ON DELETE CASCADE;
     175ALTER TABLE [dbo].[AssignedJobResource]
     176  ADD CONSTRAINT [Job_AssignedJobResource] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId]) ON UPDATE CASCADE ON DELETE CASCADE;
    154177ALTER TABLE [dbo].[RequiredPlugins]
    155   ADD CONSTRAINT [Plugin_RequiredPlugin] FOREIGN KEY ([PluginId]) REFERENCES [dbo].[Plugin]([PluginId])
     178  ADD CONSTRAINT [Plugin_RequiredPlugin] FOREIGN KEY ([PluginId]) REFERENCES [dbo].[Plugin]([PluginId]) ON UPDATE CASCADE ON DELETE CASCADE;
    156179ALTER TABLE [dbo].[RequiredPlugins]
    157   ADD CONSTRAINT [Task_RequiredPlugin] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId])
     180  ADD CONSTRAINT [Task_RequiredPlugin] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId]) ON UPDATE CASCADE ON DELETE CASCADE;
    158181ALTER TABLE [dbo].[Resource]
    159   ADD CONSTRAINT [Resource_Resource] FOREIGN KEY ([ParentResourceId]) REFERENCES [dbo].[Resource]([ResourceId])
    160 ALTER TABLE [dbo].[ResourcePermission]
    161   ADD CONSTRAINT [Resource_ResourcePermission] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId])
     182  ADD CONSTRAINT [Resource_Resource] FOREIGN KEY ([ParentResourceId]) REFERENCES [dbo].[Resource]([ResourceId]);
    162183ALTER TABLE [dbo].[Task]
    163   ADD CONSTRAINT [Task_Task] FOREIGN KEY ([ParentTaskId]) REFERENCES [dbo].[Task]([TaskId])
     184  ADD CONSTRAINT [Task_Task] FOREIGN KEY ([ParentTaskId]) REFERENCES [dbo].[Task]([TaskId]);
    164185ALTER TABLE [dbo].[Task]
    165   ADD CONSTRAINT [Job_Job] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId])
     186  ADD CONSTRAINT [Job_Task] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId]) ON UPDATE CASCADE ON DELETE CASCADE;
    166187ALTER TABLE [dbo].[Downtime]
    167   ADD CONSTRAINT [Resource_Downtime] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId])
     188  ADD CONSTRAINT [Resource_Downtime] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId]) ON UPDATE CASCADE ON DELETE CASCADE;
     189ALTER TABLE [dbo].[Job]
     190  ADD CONSTRAINT [Project_Job] FOREIGN KEY ([ProjectId]) REFERENCES [dbo].[Project]([ProjectId]);
    168191ALTER TABLE [dbo].[TaskData]
    169   ADD CONSTRAINT [Task_TaskData] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId])
     192  ADD CONSTRAINT [Task_TaskData] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId]) ON UPDATE CASCADE ON DELETE CASCADE;
    170193ALTER TABLE [dbo].[PluginData]
    171   ADD CONSTRAINT [Plugin_PluginData] FOREIGN KEY ([PluginId]) REFERENCES [dbo].[Plugin]([PluginId])
     194  ADD CONSTRAINT [Plugin_PluginData] FOREIGN KEY ([PluginId]) REFERENCES [dbo].[Plugin]([PluginId]) ON UPDATE CASCADE ON DELETE CASCADE;
    172195ALTER TABLE [dbo].[StateLog]
    173   ADD CONSTRAINT [Task_StateLog] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId])
     196  ADD CONSTRAINT [Task_StateLog] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId]) ON UPDATE CASCADE ON DELETE CASCADE;
    174197ALTER TABLE [dbo].[StateLog]
    175   ADD CONSTRAINT [Resource_StateLog] FOREIGN KEY ([SlaveId]) REFERENCES [dbo].[Resource]([ResourceId])
     198  ADD CONSTRAINT [Resource_StateLog] FOREIGN KEY ([SlaveId]) REFERENCES [dbo].[Resource]([ResourceId]) ON UPDATE CASCADE ON DELETE CASCADE;
    176199ALTER TABLE [dbo].[JobPermission]
    177   ADD CONSTRAINT [Job_JobPermission] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId])
     200  ADD CONSTRAINT [Job_JobPermission] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId]) ON UPDATE CASCADE ON DELETE CASCADE;
     201ALTER TABLE [dbo].[Project]
     202  ADD CONSTRAINT [Project_Project] FOREIGN KEY ([ParentProjectId]) REFERENCES [dbo].[Project]([ProjectId]);
     203ALTER TABLE [dbo].[ProjectPermission]
     204  ADD CONSTRAINT [Project_ProjectPermission] FOREIGN KEY ([ProjectId]) REFERENCES [dbo].[Project]([ProjectId]) ON UPDATE CASCADE ON DELETE CASCADE;
    178205
    179206GO
     
    192219CREATE TABLE [statistics].[DimClient] (
    193220    [Id]               UNIQUEIDENTIFIER CONSTRAINT [DF_DimClient_Id] DEFAULT (newsequentialid()) NOT NULL,
    194     [Name]             VARCHAR (MAX)    NOT NULL,
    195221    [ResourceId]       UNIQUEIDENTIFIER NOT NULL,
    196     [ExpirationTime]   DATETIME        NULL,
    197     [ResourceGroupId]  UNIQUEIDENTIFIER NULL,
    198     [ResourceGroup2Id] UNIQUEIDENTIFIER NULL,
    199     [GroupName]        VARCHAR (MAX)    NULL,
    200     [GroupName2]       VARCHAR (MAX)    NULL,
     222  [ParentResourceId] UNIQUEIDENTIFIER NULL,
     223  [Name]             VARCHAR (MAX)    NOT NULL,
     224  [ResourceType]     VARCHAR (MAX)    NULL,
     225  [DateCreated]      DATETIME         NOT NULL,
     226    [DateExpired]      DATETIME         NULL
    201227    CONSTRAINT [PK_DimClient] PRIMARY KEY CLUSTERED ([Id] ASC)
    202228);
     
    204230    [JobId]          UNIQUEIDENTIFIER NOT NULL,
    205231    [UserId]         UNIQUEIDENTIFIER NOT NULL,
     232  [ProjectId]      UNIQUEIDENTIFIER NOT NULL,
    206233    [JobName]        VARCHAR (MAX)    NOT NULL,
    207234    [UserName]       VARCHAR (MAX)    NOT NULL,
     
    212239    CONSTRAINT [PK_DimJob] PRIMARY KEY CLUSTERED ([JobId] ASC)
    213240);
     241CREATE TABLE [statistics].[DimProject] (
     242    [Id]               UNIQUEIDENTIFIER CONSTRAINT [DF_DimProject_Id] DEFAULT (newsequentialid()) NOT NULL,
     243    [ProjectId]        UNIQUEIDENTIFIER NOT NULL,
     244  [ParentProjectId]  UNIQUEIDENTIFIER NULL,
     245  [Name]             VARCHAR (MAX)    NOT NULL,
     246  [Description]      VARCHAR (MAX)    NULL,
     247  [OwnerUserId]      UNIQUEIDENTIFIER NOT NULL,
     248  [StartDate]        DATETIME         NOT NULL,
     249    [EndDate]          DATETIME         NULL,
     250  [DateCreated]      DATETIME         NOT NULL,
     251    [DateExpired]      DATETIME         NULL
     252  CONSTRAINT [PK_DimProject] PRIMARY KEY CLUSTERED ([Id] ASC)
     253);
    214254CREATE TABLE [statistics].[DimUser] (
    215255    [UserId] UNIQUEIDENTIFIER NOT NULL,
    216256    [Name]   VARCHAR (MAX)    NOT NULL,
    217257    CONSTRAINT [PK_DimUser] PRIMARY KEY CLUSTERED ([UserId] ASC)
     258);
     259
     260
     261
     262CREATE TABLE [statistics].[FactProjectInfo] (
     263  [ProjectId]   UNIQUEIDENTIFIER NOT NULL,
     264  [Time]      DATETIME     NOT NULL,
     265  [NumTotalCores] INT        NOT NULL,
     266  [NumUsedCores]  INT        NOT NULL,
     267  [TotalMemory] INT        NOT NULL,
     268  [UsedMemory]  INT        NOT NULL
     269  CONSTRAINT [PK_FactProjectInfo] PRIMARY KEY CLUSTERED ([ProjectId] ASC, [Time] ASC),
     270  CONSTRAINT [FK_FactProjectInfo_DimTime] FOREIGN KEY ([Time]) REFERENCES [statistics].[DimTime] ([Time]),
     271  CONSTRAINT [FK_FactProjectInfo_DimProject] FOREIGN KEY ([ProjectId]) REFERENCES [statistics].[DimProject] ([Id])
    218272);
    219273CREATE TABLE [statistics].[FactClientInfo] (
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Prepare Hive Database.sql

    r14185 r16117  
    1919
    2020/* this script is supposed to be executed after the plain DB is generated by the linq-to-sql schema */
    21 USE [HeuristicLab.Hive-3.3]
    22 
    23 ALTER TABLE [dbo].[AssignedResources]  DROP  CONSTRAINT [Task_AssignedResource]
    24 ALTER TABLE [dbo].[AssignedResources]  WITH CHECK ADD  CONSTRAINT [Task_AssignedResource] FOREIGN KEY([TaskId])
    25 REFERENCES [dbo].[Task] ([TaskId])
    26 ON UPDATE CASCADE
    27 ON DELETE CASCADE
    28 GO
    29 ALTER TABLE [dbo].[AssignedResources]  DROP  CONSTRAINT [Resource_AssignedResource]
    30 ALTER TABLE [dbo].[AssignedResources]  WITH CHECK ADD  CONSTRAINT [Resource_AssignedResource] FOREIGN KEY([ResourceId])
     21USE [HeuristicLab.Hive-3.4]
     22
     23ALTER TABLE [dbo].[AssignedProjectResource]  DROP  CONSTRAINT [Project_AssignedProjectResource]
     24ALTER TABLE [dbo].[AssignedProjectResource]  WITH CHECK ADD  CONSTRAINT [Project_AssignedProjectResource] FOREIGN KEY([ProjectId])
     25REFERENCES [dbo].[Project] ([ProjectId])
     26ON UPDATE CASCADE
     27ON DELETE CASCADE
     28GO
     29ALTER TABLE [dbo].[AssignedProjectResource]  DROP  CONSTRAINT [Resource_AssignedProjectResource]
     30ALTER TABLE [dbo].[AssignedProjectResource]  WITH CHECK ADD  CONSTRAINT [Resource_AssignedProjectResource] FOREIGN KEY([ResourceId])
     31REFERENCES [dbo].[Resource] ([ResourceId])
     32ON UPDATE CASCADE
     33ON DELETE CASCADE
     34GO
     35ALTER TABLE [dbo].[AssignedJobResource]  DROP  CONSTRAINT [Job_AssignedJobResource]
     36ALTER TABLE [dbo].[AssignedJobResource]  WITH CHECK ADD  CONSTRAINT [Job_AssignedJobResource] FOREIGN KEY([JobId])
     37REFERENCES [dbo].[Job] ([JobId])
     38ON UPDATE CASCADE
     39ON DELETE CASCADE
     40GO
     41ALTER TABLE [dbo].[AssignedJobResource]  DROP  CONSTRAINT [Resource_AssignedJobResource]
     42ALTER TABLE [dbo].[AssignedJobResource]  WITH CHECK ADD  CONSTRAINT [Resource_AssignedJobResource] FOREIGN KEY([ResourceId])
    3143REFERENCES [dbo].[Resource] ([ResourceId])
    3244ON UPDATE CASCADE
     
    88100ALTER TABLE dbo.Job ALTER COLUMN JobId ADD ROWGUIDCOL;
    89101ALTER TABLE dbo.Job WITH NOCHECK ADD CONSTRAINT [DF_Job_JobId] DEFAULT (NEWSEQUENTIALID()) FOR JobId;
     102ALTER TABLE [dbo].[Job]  DROP  CONSTRAINT [Project_Job]
     103ALTER TABLE [dbo].[Job]  WITH CHECK ADD  CONSTRAINT [Project_Job] FOREIGN KEY([ProjectId])
     104REFERENCES [dbo].[Project] ([ProjectId])
     105ON UPDATE CASCADE
     106GO
    90107
    91108ALTER TABLE dbo.StateLog ALTER COLUMN StateLogId ADD ROWGUIDCOL;
     
    99116GO
    100117
    101 ALTER TABLE [dbo].[ResourcePermission]  DROP  CONSTRAINT [Resource_ResourcePermission]
    102 ALTER TABLE [dbo].[ResourcePermission]  WITH CHECK ADD CONSTRAINT [Resource_ResourcePermission] FOREIGN KEY([ResourceId])
    103 REFERENCES [dbo].[Resource] ([ResourceId])
     118ALTER TABLE dbo.Project ALTER COLUMN ProjectId ADD ROWGUIDCOL;
     119ALTER TABLE dbo.Project WITH NOCHECK ADD CONSTRAINT [DF_Project_ProjectId] DEFAULT (NEWSEQUENTIALID()) FOR ProjectId;
     120
     121ALTER TABLE [dbo].[ProjectPermission]  DROP  CONSTRAINT [Project_ProjectPermission]
     122ALTER TABLE [dbo].[ProjectPermission]  WITH CHECK ADD CONSTRAINT [Project_ProjectPermission] FOREIGN KEY([ProjectId])
     123REFERENCES [dbo].[Project] ([ProjectId])
    104124ON UPDATE CASCADE
    105125ON DELETE CASCADE
     
    123143
    124144
     145
     146-- OBSOLETE - DO NOT PERFORM (start)
    125147/****** Object:  Trigger [dbo].[tr_JobDeleteCascade]    Script Date: 04/19/2011 16:31:53 ******/
    126148SET ANSI_NULLS ON
     
    175197END
    176198GO
    177 
    178 
     199-- OBSOLETE (end)
     200
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.Designer.cs

    r14748 r16117  
    1313   
    1414    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    15     [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
     15    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]
    1616    public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
    1717       
     
    2121            get {
    2222                return defaultInstance;
    23             }
    24         }
    25        
    26         [global::System.Configuration.ApplicationScopedSettingAttribute()]
    27         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    28         [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
    29         [global::System.Configuration.DefaultSettingValueAttribute("Data Source=.\\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hi" +
    30             "ve-3.3")]
    31         public string HeuristicLab_Hive_LinqConnectionString {
    32             get {
    33                 return ((string)(this["HeuristicLab_Hive_LinqConnectionString"]));
    3423            }
    3524        }
     
    5241            }
    5342        }
     43       
     44        [global::System.Configuration.ApplicationScopedSettingAttribute()]
     45        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     46        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
     47        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=localhost;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-" +
     48            "3.4")]
     49        public string HeuristicLab_Hive_LinqConnectionString {
     50            get {
     51                return ((string)(this["HeuristicLab_Hive_LinqConnectionString"]));
     52            }
     53        }
    5454    }
    5555}
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.settings

    r14748 r16117  
    33  <Profiles />
    44  <Settings>
    5     <Setting Name="HeuristicLab_Hive_LinqConnectionString" Type="(Connection string)" Scope="Application">
    6       <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
    7 &lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
    8   &lt;ConnectionString&gt;Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.3&lt;/ConnectionString&gt;
    9   &lt;ProviderName&gt;System.Data.SqlClient&lt;/ProviderName&gt;
    10 &lt;/SerializableConnectionString&gt;</DesignTimeValue>
    11       <Value Profile="(Default)">Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.3</Value>
    12     </Setting>
    135    <Setting Name="LongRunningDatabaseCommandTimeout" Type="System.TimeSpan" Scope="Application">
    146      <Value Profile="(Default)">00:05:00</Value>
     
    179      <Value Profile="(Default)">HL.Hive</Value>
    1810    </Setting>
     11    <Setting Name="HeuristicLab_Hive_LinqConnectionString" Type="(Connection string)" Scope="Application">
     12      <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
     13&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
     14  &lt;ConnectionString&gt;Data Source=localhost;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.4&lt;/ConnectionString&gt;
     15&lt;/SerializableConnectionString&gt;</DesignTimeValue>
     16      <Value Profile="(Default)">Data Source=localhost;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.4</Value>
     17    </Setting>
    1918  </Settings>
    2019</SettingsFile>
  • trunk/HeuristicLab.Services.Hive.DataAccess/3.3/app.config

    r14748 r16117  
    11<?xml version="1.0" encoding="utf-8"?>
    22<configuration>
     3  <configSections>
     4  </configSections>
    35  <connectionStrings>
    4     <add name="HeuristicLab.Services.Hive.DataAccess.Settings.HeuristicLab_Hive_LinqConnectionString" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.4" />
     6    <add name="HeuristicLab.Services.Hive.DataAccess.Settings.HeuristicLab_Hive_LinqConnectionString"
     7      connectionString="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.4" />
    58  </connectionStrings>
    69
Note: See TracChangeset for help on using the changeset viewer.