Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15659 for branches


Ignore:
Timestamp:
01/26/18 15:12:14 (6 years ago)
Author:
jzenisek
Message:

#2839

  • added DimProject and FactProjectInfo entities to statistics generation
  • implemented tracking for projects
Location:
branches/HiveProjectManagement
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml

    r15644 r15659  
    208208      <Column Name="CompletedTasks" Type="System.Int32" DbType="INT NOT NULL" CanBeNull="false" />
    209209      <Column Name="DateCompleted" Type="System.DateTime" DbType="DateTime NULL" CanBeNull="true" />
     210      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
    210211      <Association Name="DimJob_FactTask" Member="FactTasks" ThisKey="JobId" OtherKey="JobId" Type="FactTask" />
     212      <Association Name="DimProject_DimJob" Member="DimProject" ThisKey="ProjectId" OtherKey="Id" Type="DimProject" IsForeignKey="true" />
    211213    </Type>
    212214  </Table>
     
    220222      <Column Name="Minute" Type="System.DateTime" CanBeNull="false" />
    221223      <Association Name="DimTime_FactClientInfo" Member="FactClientInfos" ThisKey="Time" OtherKey="Time" Type="FactClientInfo" />
     224      <Association Name="DimTime_FactProjectInfo" Member="FactProjectInfos" ThisKey="Time" OtherKey="Time" Type="FactProjectInfo" />
    222225    </Type>
    223226  </Table>
     
    282285    </Type>
    283286  </Table>
     287  <Table Name="" Member="FactProjectInfos">
     288    <Type Name="FactProjectInfo">
     289      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
     290      <Column Name="Time" Type="System.DateTime" DbType="DateTime NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
     291      <Column Name="NumTotalCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
     292      <Column Name="NumUsedCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
     293      <Column Name="TotalMemory" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
     294      <Column Name="UsedMemory" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
     295      <Association Name="DimProject_FactProjectInfo" Member="DimProject" ThisKey="ProjectId" OtherKey="Id" Type="DimProject" IsForeignKey="true" />
     296      <Association Name="DimTime_FactProjectInfo" Member="DimTime" ThisKey="Time" OtherKey="Time" Type="DimTime" IsForeignKey="true" />
     297    </Type>
     298  </Table>
     299  <Table Name="" Member="DimProjects">
     300    <Type Name="DimProject">
     301      <Column Name="Id" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
     302      <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
     303      <Column Name="ParentProjectId" Storage="_ParentId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="true" />
     304      <Column Name="Name" Type="System.String" CanBeNull="false" />
     305      <Column Name="Description" Type="System.String" CanBeNull="true" />
     306      <Column Name="OwnerUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
     307      <Column Name="StartDate" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
     308      <Column Name="EndDate" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
     309      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
     310      <Column Name="DateExpired" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
     311      <Association Name="DimProject_DimJob" Member="DimJobs" ThisKey="Id" OtherKey="ProjectId" Type="DimJob" />
     312      <Association Name="DimProject_FactProjectInfo" Member="FactProjectInfos" ThisKey="Id" OtherKey="ProjectId" Type="FactProjectInfo" />
     313    </Type>
     314  </Table>
    284315</Database>
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout

    r15644 r15659  
    11<?xml version="1.0" encoding="utf-8"?>
    2 <ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 16.25, 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>
     
    182182      </nestedChildShapes>
    183183    </classShape>
    184     <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.3478011067708344">
    185185      <DataClassMoniker Name="/HiveDataContext/DimClient" />
    186186      <nestedChildShapes>
    187         <elementListCompartment Id="30f62a7b-0b16-404e-b972-fb12bfe978dd" absoluteBounds="4.6400000000000006, 15.71, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    188       </nestedChildShapes>
    189     </classShape>
    190     <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.7878011067708333" 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">
    191191      <DataClassMoniker Name="/HiveDataContext/FactTask" />
    192192      <nestedChildShapes>
    193         <elementListCompartment Id="63e3ddcb-a6fe-48e0-a674-e650a55a9f2c" absoluteBounds="6.8900000000000006, 11.71, 1.9700000000000002, 3.3262125651041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    194       </nestedChildShapes>
    195     </classShape>
    196     <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">
    197197      <DataClassMoniker Name="/HiveDataContext/DimJob" />
    198198      <nestedChildShapes>
    199         <elementListCompartment Id="6b9e8260-7e4b-4357-9c26-eebebfd69504" absoluteBounds="8.14, 8.71, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    200       </nestedChildShapes>
    201     </classShape>
    202     <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">
    203203      <DataClassMoniker Name="/HiveDataContext/DimTime" />
    204204      <nestedChildShapes>
    205         <elementListCompartment Id="694c4a5a-20fb-43a9-bc9a-7b59d794a7fb" absoluteBounds="3.6399999999999997, 8.96, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    206       </nestedChildShapes>
    207     </classShape>
    208     <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">
    209209      <DataClassMoniker Name="/HiveDataContext/DimUser" />
    210210      <nestedChildShapes>
    211         <elementListCompartment Id="6181c560-fc74-4d43-b064-a90032bf17a5" absoluteBounds="0.64000000000000012, 9.335, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    212       </nestedChildShapes>
    213     </classShape>
    214     <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">
    215215      <DataClassMoniker Name="/HiveDataContext/FactClientInfo" />
    216216      <nestedChildShapes>
    217         <elementListCompartment Id="0a1cc913-6636-455c-95b3-302f533527db" absoluteBounds="2.6399999999999997, 11.46, 1.9700000000000002, 2.7493082682291665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    218       </nestedChildShapes>
    219     </classShape>
    220     <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.4239005533854); (8.25 : 13.4239005533854)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    221221      <AssociationMoniker Name="/HiveDataContext/DimClient/DimClient_FactTask" />
    222222      <nodes>
     
    225225      </nodes>
    226226    </associationConnector>
    227     <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">
    228228      <AssociationMoniker Name="/HiveDataContext/DimJob/DimJob_FactTask" />
    229229      <nodes>
     
    232232      </nodes>
    233233    </associationConnector>
    234     <associationConnector edgePoints="[(5.6249975 : 15.25); (5.6249975 : 12.6546541341146); (4.625 : 12.6546541341146)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     234    <associationConnector edgePoints="[(6.5 : 14.5978011067708); (6.5 : 17)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    235235      <AssociationMoniker Name="/HiveDataContext/DimClient/DimClient_FactClientInfo" />
    236236      <nodes>
     
    239239      </nodes>
    240240    </associationConnector>
    241     <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">
    242242      <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactClientInfo" />
    243243      <nodes>
     
    246246      </nodes>
    247247    </associationConnector>
    248     <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">
    249249      <AssociationMoniker Name="/HiveDataContext/DimUser/DimUser_FactClientInfo" />
    250250      <nodes>
     
    279279      </nodes>
    280280    </associationConnector>
    281     <associationConnector edgePoints="[(11.25 : 9.42390055338542); (10.375 : 9.42390055338542); (10.375 : 8); (4 : 8); (4 : 5.15549967447917); (4.80957165625 : 5.15549967447917); (4.80957165625 : 4.78049967447917)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     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">
    282282      <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" />
    283283      <nodes>
     
    306306      </nestedChildShapes>
    307307    </classShape>
    308     <associationConnector edgePoints="[(12.25 : 2.9631982421875); (12.25 : 5.09699625651042); (10.875 : 5.09699625651042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     308    <associationConnector edgePoints="[(12.25 : 2.9631982421875); (12.25 : 5.09699625651042); (10.875 : 5.09699625651042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    309309      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedJobResource" />
    310310      <nodes>
     
    313313      </nodes>
    314314    </associationConnector>
    315     <associationConnector edgePoints="[(5.498537828125 : 4.78049967447917); (5.498537828125 : 5.14024983723958); (7.41666666666667 : 5.14024983723958 : JumpStart); (7.58333333333333 : 5.14024983723958 : JumpEnd); (8.875 : 5.14024983723958)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     315    <associationConnector edgePoints="[(5.125 : 4.78049967447917); (5.125 : 5.14024983723958); (8.875 : 5.14024983723958)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    316316      <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedJobResource" />
    317317      <nodes>
     
    320320      </nodes>
    321321    </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>
    322355  </nestedChildShapes>
    323356</ordesignerObjectsDiagram>
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs

    r15644 r15659  
    9797    partial void UpdateAssignedJobResource(AssignedJobResource instance);
    9898    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);
    99105    #endregion
    100106   
     
    296302      {
    297303        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>();
    298320      }
    299321    }
     
    45054527    private System.Nullable<System.DateTime> _DateCompleted;
    45064528   
     4529    private System.Guid _ProjectId;
     4530   
    45074531    private EntitySet<FactTask> _FactTasks;
     4532   
     4533    private EntityRef<DimProject> _DimProject;
    45084534   
    45094535    #region Extensibility Method Definitions
     
    45274553    partial void OnDateCompletedChanging(System.Nullable<System.DateTime> value);
    45284554    partial void OnDateCompletedChanged();
     4555    partial void OnProjectIdChanging(System.Guid value);
     4556    partial void OnProjectIdChanged();
    45294557    #endregion
    45304558   
     
    45324560    {
    45334561      this._FactTasks = new EntitySet<FactTask>(new Action<FactTask>(this.attach_FactTasks), new Action<FactTask>(this.detach_FactTasks));
     4562      this._DimProject = default(EntityRef<DimProject>);
    45344563      OnCreated();
    45354564    }
     
    46954724    }
    46964725   
     4726    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL")]
     4727    public System.Guid ProjectId
     4728    {
     4729      get
     4730      {
     4731        return this._ProjectId;
     4732      }
     4733      set
     4734      {
     4735        if ((this._ProjectId != value))
     4736        {
     4737          if (this._DimProject.HasLoadedOrAssignedValue)
     4738          {
     4739            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     4740          }
     4741          this.OnProjectIdChanging(value);
     4742          this.SendPropertyChanging();
     4743          this._ProjectId = value;
     4744          this.SendPropertyChanged("ProjectId");
     4745          this.OnProjectIdChanged();
     4746        }
     4747      }
     4748    }
     4749   
    46974750    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimJob_FactTask", Storage="_FactTasks", ThisKey="JobId", OtherKey="JobId")]
    46984751    public EntitySet<FactTask> FactTasks
     
    47054758      {
    47064759        this._FactTasks.Assign(value);
     4760      }
     4761    }
     4762   
     4763    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimProject_DimJob", Storage="_DimProject", ThisKey="ProjectId", OtherKey="Id", IsForeignKey=true)]
     4764    public DimProject DimProject
     4765    {
     4766      get
     4767      {
     4768        return this._DimProject.Entity;
     4769      }
     4770      set
     4771      {
     4772        DimProject previousValue = this._DimProject.Entity;
     4773        if (((previousValue != value)
     4774              || (this._DimProject.HasLoadedOrAssignedValue == false)))
     4775        {
     4776          this.SendPropertyChanging();
     4777          if ((previousValue != null))
     4778          {
     4779            this._DimProject.Entity = null;
     4780            previousValue.DimJobs.Remove(this);
     4781          }
     4782          this._DimProject.Entity = value;
     4783          if ((value != null))
     4784          {
     4785            value.DimJobs.Add(this);
     4786            this._ProjectId = value.Id;
     4787          }
     4788          else
     4789          {
     4790            this._ProjectId = default(System.Guid);
     4791          }
     4792          this.SendPropertyChanged("DimProject");
     4793        }
    47074794      }
    47084795    }
     
    47604847   
    47614848    private EntitySet<FactClientInfo> _FactClientInfos;
     4849   
     4850    private EntitySet<FactProjectInfo> _FactProjectInfos;
    47624851   
    47634852    #region Extensibility Method Definitions
     
    47824871    {
    47834872      this._FactClientInfos = new EntitySet<FactClientInfo>(new Action<FactClientInfo>(this.attach_FactClientInfos), new Action<FactClientInfo>(this.detach_FactClientInfos));
     4873      this._FactProjectInfos = new EntitySet<FactProjectInfo>(new Action<FactProjectInfo>(this.attach_FactProjectInfos), new Action<FactProjectInfo>(this.detach_FactProjectInfos));
    47844874      OnCreated();
    47854875    }
     
    49185008    }
    49195009   
     5010    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimTime_FactProjectInfo", Storage="_FactProjectInfos", ThisKey="Time", OtherKey="Time")]
     5011    public EntitySet<FactProjectInfo> FactProjectInfos
     5012    {
     5013      get
     5014      {
     5015        return this._FactProjectInfos;
     5016      }
     5017      set
     5018      {
     5019        this._FactProjectInfos.Assign(value);
     5020      }
     5021    }
     5022   
    49205023    public event PropertyChangingEventHandler PropertyChanging;
    49215024   
     
    49455048   
    49465049    private void detach_FactClientInfos(FactClientInfo entity)
     5050    {
     5051      this.SendPropertyChanging();
     5052      entity.DimTime = null;
     5053    }
     5054   
     5055    private void attach_FactProjectInfos(FactProjectInfo entity)
     5056    {
     5057      this.SendPropertyChanging();
     5058      entity.DimTime = this;
     5059    }
     5060   
     5061    private void detach_FactProjectInfos(FactProjectInfo entity)
    49475062    {
    49485063      this.SendPropertyChanging();
     
    62396354    }
    62406355  }
     6356 
     6357  [global::System.Data.Linq.Mapping.TableAttribute(Name="")]
     6358  public partial class FactProjectInfo : INotifyPropertyChanging, INotifyPropertyChanged
     6359  {
     6360   
     6361    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
     6362   
     6363    private System.Guid _ProjectId;
     6364   
     6365    private System.DateTime _Time;
     6366   
     6367    private int _NumTotalCores;
     6368   
     6369    private int _NumUsedCores;
     6370   
     6371    private int _TotalMemory;
     6372   
     6373    private int _UsedMemory;
     6374   
     6375    private EntityRef<DimProject> _DimProject;
     6376   
     6377    private EntityRef<DimTime> _DimTime;
     6378   
     6379    #region Extensibility Method Definitions
     6380    partial void OnLoaded();
     6381    partial void OnValidate(System.Data.Linq.ChangeAction action);
     6382    partial void OnCreated();
     6383    partial void OnProjectIdChanging(System.Guid value);
     6384    partial void OnProjectIdChanged();
     6385    partial void OnTimeChanging(System.DateTime value);
     6386    partial void OnTimeChanged();
     6387    partial void OnNumTotalCoresChanging(int value);
     6388    partial void OnNumTotalCoresChanged();
     6389    partial void OnNumUsedCoresChanging(int value);
     6390    partial void OnNumUsedCoresChanged();
     6391    partial void OnTotalMemoryChanging(int value);
     6392    partial void OnTotalMemoryChanged();
     6393    partial void OnUsedMemoryChanging(int value);
     6394    partial void OnUsedMemoryChanged();
     6395    #endregion
     6396   
     6397    public FactProjectInfo()
     6398    {
     6399      this._DimProject = default(EntityRef<DimProject>);
     6400      this._DimTime = default(EntityRef<DimTime>);
     6401      OnCreated();
     6402    }
     6403   
     6404    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
     6405    public System.Guid ProjectId
     6406    {
     6407      get
     6408      {
     6409        return this._ProjectId;
     6410      }
     6411      set
     6412      {
     6413        if ((this._ProjectId != value))
     6414        {
     6415          if (this._DimProject.HasLoadedOrAssignedValue)
     6416          {
     6417            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     6418          }
     6419          this.OnProjectIdChanging(value);
     6420          this.SendPropertyChanging();
     6421          this._ProjectId = value;
     6422          this.SendPropertyChanged("ProjectId");
     6423          this.OnProjectIdChanged();
     6424        }
     6425      }
     6426    }
     6427   
     6428    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Time", DbType="DateTime NOT NULL", IsPrimaryKey=true)]
     6429    public System.DateTime Time
     6430    {
     6431      get
     6432      {
     6433        return this._Time;
     6434      }
     6435      set
     6436      {
     6437        if ((this._Time != value))
     6438        {
     6439          if (this._DimTime.HasLoadedOrAssignedValue)
     6440          {
     6441            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
     6442          }
     6443          this.OnTimeChanging(value);
     6444          this.SendPropertyChanging();
     6445          this._Time = value;
     6446          this.SendPropertyChanged("Time");
     6447          this.OnTimeChanged();
     6448        }
     6449      }
     6450    }
     6451   
     6452    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumTotalCores", DbType="Int NOT NULL")]
     6453    public int NumTotalCores
     6454    {
     6455      get
     6456      {
     6457        return this._NumTotalCores;
     6458      }
     6459      set
     6460      {
     6461        if ((this._NumTotalCores != value))
     6462        {
     6463          this.OnNumTotalCoresChanging(value);
     6464          this.SendPropertyChanging();
     6465          this._NumTotalCores = value;
     6466          this.SendPropertyChanged("NumTotalCores");
     6467          this.OnNumTotalCoresChanged();
     6468        }
     6469      }
     6470    }
     6471   
     6472    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumUsedCores", DbType="Int NOT NULL")]
     6473    public int NumUsedCores
     6474    {
     6475      get
     6476      {
     6477        return this._NumUsedCores;
     6478      }
     6479      set
     6480      {
     6481        if ((this._NumUsedCores != value))
     6482        {
     6483          this.OnNumUsedCoresChanging(value);
     6484          this.SendPropertyChanging();
     6485          this._NumUsedCores = value;
     6486          this.SendPropertyChanged("NumUsedCores");
     6487          this.OnNumUsedCoresChanged();
     6488        }
     6489      }
     6490    }
     6491   
     6492    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalMemory", DbType="Int NOT NULL")]
     6493    public int TotalMemory
     6494    {
     6495      get
     6496      {
     6497        return this._TotalMemory;
     6498      }
     6499      set
     6500      {
     6501        if ((this._TotalMemory != value))
     6502        {
     6503          this.OnTotalMemoryChanging(value);
     6504          this.SendPropertyChanging();
     6505          this._TotalMemory = value;
     6506          this.SendPropertyChanged("TotalMemory");
     6507          this.OnTotalMemoryChanged();
     6508        }
     6509      }
     6510    }
     6511   
     6512    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UsedMemory", DbType="Int NOT NULL")]
     6513    public int UsedMemory
     6514    {
     6515      get
     6516      {
     6517        return this._UsedMemory;
     6518      }
     6519      set
     6520      {
     6521        if ((this._UsedMemory != value))
     6522        {
     6523          this.OnUsedMemoryChanging(value);
     6524          this.SendPropertyChanging();
     6525          this._UsedMemory = value;
     6526          this.SendPropertyChanged("UsedMemory");
     6527          this.OnUsedMemoryChanged();
     6528        }
     6529      }
     6530    }
     6531   
     6532    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimProject_FactProjectInfo", Storage="_DimProject", ThisKey="ProjectId", OtherKey="Id", IsForeignKey=true)]
     6533    public DimProject DimProject
     6534    {
     6535      get
     6536      {
     6537        return this._DimProject.Entity;
     6538      }
     6539      set
     6540      {
     6541        DimProject previousValue = this._DimProject.Entity;
     6542        if (((previousValue != value)
     6543              || (this._DimProject.HasLoadedOrAssignedValue == false)))
     6544        {
     6545          this.SendPropertyChanging();
     6546          if ((previousValue != null))
     6547          {
     6548            this._DimProject.Entity = null;
     6549            previousValue.FactProjectInfos.Remove(this);
     6550          }
     6551          this._DimProject.Entity = value;
     6552          if ((value != null))
     6553          {
     6554            value.FactProjectInfos.Add(this);
     6555            this._ProjectId = value.Id;
     6556          }
     6557          else
     6558          {
     6559            this._ProjectId = default(System.Guid);
     6560          }
     6561          this.SendPropertyChanged("DimProject");
     6562        }
     6563      }
     6564    }
     6565   
     6566    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimTime_FactProjectInfo", Storage="_DimTime", ThisKey="Time", OtherKey="Time", IsForeignKey=true)]
     6567    public DimTime DimTime
     6568    {
     6569      get
     6570      {
     6571        return this._DimTime.Entity;
     6572      }
     6573      set
     6574      {
     6575        DimTime previousValue = this._DimTime.Entity;
     6576        if (((previousValue != value)
     6577              || (this._DimTime.HasLoadedOrAssignedValue == false)))
     6578        {
     6579          this.SendPropertyChanging();
     6580          if ((previousValue != null))
     6581          {
     6582            this._DimTime.Entity = null;
     6583            previousValue.FactProjectInfos.Remove(this);
     6584          }
     6585          this._DimTime.Entity = value;
     6586          if ((value != null))
     6587          {
     6588            value.FactProjectInfos.Add(this);
     6589            this._Time = value.Time;
     6590          }
     6591          else
     6592          {
     6593            this._Time = default(System.DateTime);
     6594          }
     6595          this.SendPropertyChanged("DimTime");
     6596        }
     6597      }
     6598    }
     6599   
     6600    public event PropertyChangingEventHandler PropertyChanging;
     6601   
     6602    public event PropertyChangedEventHandler PropertyChanged;
     6603   
     6604    protected virtual void SendPropertyChanging()
     6605    {
     6606      if ((this.PropertyChanging != null))
     6607      {
     6608        this.PropertyChanging(this, emptyChangingEventArgs);
     6609      }
     6610    }
     6611   
     6612    protected virtual void SendPropertyChanged(String propertyName)
     6613    {
     6614      if ((this.PropertyChanged != null))
     6615      {
     6616        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
     6617      }
     6618    }
     6619  }
     6620 
     6621  [global::System.Data.Linq.Mapping.TableAttribute(Name="")]
     6622  public partial class DimProject : INotifyPropertyChanging, INotifyPropertyChanged
     6623  {
     6624   
     6625    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
     6626   
     6627    private System.Guid _Id;
     6628   
     6629    private System.Guid _ProjectId;
     6630   
     6631    private System.Nullable<System.Guid> _ParentId;
     6632   
     6633    private string _Name;
     6634   
     6635    private string _Description;
     6636   
     6637    private System.Guid _OwnerUserId;
     6638   
     6639    private System.DateTime _StartDate;
     6640   
     6641    private System.Nullable<System.DateTime> _EndDate;
     6642   
     6643    private System.DateTime _DateCreated;
     6644   
     6645    private System.Nullable<System.DateTime> _DateExpired;
     6646   
     6647    private EntitySet<DimJob> _DimJobs;
     6648   
     6649    private EntitySet<FactProjectInfo> _FactProjectInfos;
     6650   
     6651    #region Extensibility Method Definitions
     6652    partial void OnLoaded();
     6653    partial void OnValidate(System.Data.Linq.ChangeAction action);
     6654    partial void OnCreated();
     6655    partial void OnIdChanging(System.Guid value);
     6656    partial void OnIdChanged();
     6657    partial void OnProjectIdChanging(System.Guid value);
     6658    partial void OnProjectIdChanged();
     6659    partial void OnParentProjectIdChanging(System.Nullable<System.Guid> value);
     6660    partial void OnParentProjectIdChanged();
     6661    partial void OnNameChanging(string value);
     6662    partial void OnNameChanged();
     6663    partial void OnDescriptionChanging(string value);
     6664    partial void OnDescriptionChanged();
     6665    partial void OnOwnerUserIdChanging(System.Guid value);
     6666    partial void OnOwnerUserIdChanged();
     6667    partial void OnStartDateChanging(System.DateTime value);
     6668    partial void OnStartDateChanged();
     6669    partial void OnEndDateChanging(System.Nullable<System.DateTime> value);
     6670    partial void OnEndDateChanged();
     6671    partial void OnDateCreatedChanging(System.DateTime value);
     6672    partial void OnDateCreatedChanged();
     6673    partial void OnDateExpiredChanging(System.Nullable<System.DateTime> value);
     6674    partial void OnDateExpiredChanged();
     6675    #endregion
     6676   
     6677    public DimProject()
     6678    {
     6679      this._DimJobs = new EntitySet<DimJob>(new Action<DimJob>(this.attach_DimJobs), new Action<DimJob>(this.detach_DimJobs));
     6680      this._FactProjectInfos = new EntitySet<FactProjectInfo>(new Action<FactProjectInfo>(this.attach_FactProjectInfos), new Action<FactProjectInfo>(this.detach_FactProjectInfos));
     6681      OnCreated();
     6682    }
     6683   
     6684    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
     6685    public System.Guid Id
     6686    {
     6687      get
     6688      {
     6689        return this._Id;
     6690      }
     6691      set
     6692      {
     6693        if ((this._Id != value))
     6694        {
     6695          this.OnIdChanging(value);
     6696          this.SendPropertyChanging();
     6697          this._Id = value;
     6698          this.SendPropertyChanged("Id");
     6699          this.OnIdChanged();
     6700        }
     6701      }
     6702    }
     6703   
     6704    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL")]
     6705    public System.Guid ProjectId
     6706    {
     6707      get
     6708      {
     6709        return this._ProjectId;
     6710      }
     6711      set
     6712      {
     6713        if ((this._ProjectId != value))
     6714        {
     6715          this.OnProjectIdChanging(value);
     6716          this.SendPropertyChanging();
     6717          this._ProjectId = value;
     6718          this.SendPropertyChanged("ProjectId");
     6719          this.OnProjectIdChanged();
     6720        }
     6721      }
     6722    }
     6723   
     6724    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentId", DbType="UniqueIdentifier NOT NULL")]
     6725    public System.Nullable<System.Guid> ParentProjectId
     6726    {
     6727      get
     6728      {
     6729        return this._ParentId;
     6730      }
     6731      set
     6732      {
     6733        if ((this._ParentId != value))
     6734        {
     6735          this.OnParentProjectIdChanging(value);
     6736          this.SendPropertyChanging();
     6737          this._ParentId = value;
     6738          this.SendPropertyChanged("ParentProjectId");
     6739          this.OnParentProjectIdChanged();
     6740        }
     6741      }
     6742    }
     6743   
     6744    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", CanBeNull=false)]
     6745    public string Name
     6746    {
     6747      get
     6748      {
     6749        return this._Name;
     6750      }
     6751      set
     6752      {
     6753        if ((this._Name != value))
     6754        {
     6755          this.OnNameChanging(value);
     6756          this.SendPropertyChanging();
     6757          this._Name = value;
     6758          this.SendPropertyChanged("Name");
     6759          this.OnNameChanged();
     6760        }
     6761      }
     6762    }
     6763   
     6764    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description")]
     6765    public string Description
     6766    {
     6767      get
     6768      {
     6769        return this._Description;
     6770      }
     6771      set
     6772      {
     6773        if ((this._Description != value))
     6774        {
     6775          this.OnDescriptionChanging(value);
     6776          this.SendPropertyChanging();
     6777          this._Description = value;
     6778          this.SendPropertyChanged("Description");
     6779          this.OnDescriptionChanged();
     6780        }
     6781      }
     6782    }
     6783   
     6784    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OwnerUserId", DbType="UniqueIdentifier NOT NULL")]
     6785    public System.Guid OwnerUserId
     6786    {
     6787      get
     6788      {
     6789        return this._OwnerUserId;
     6790      }
     6791      set
     6792      {
     6793        if ((this._OwnerUserId != value))
     6794        {
     6795          this.OnOwnerUserIdChanging(value);
     6796          this.SendPropertyChanging();
     6797          this._OwnerUserId = value;
     6798          this.SendPropertyChanged("OwnerUserId");
     6799          this.OnOwnerUserIdChanged();
     6800        }
     6801      }
     6802    }
     6803   
     6804    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime NOT NULL")]
     6805    public System.DateTime StartDate
     6806    {
     6807      get
     6808      {
     6809        return this._StartDate;
     6810      }
     6811      set
     6812      {
     6813        if ((this._StartDate != value))
     6814        {
     6815          this.OnStartDateChanging(value);
     6816          this.SendPropertyChanging();
     6817          this._StartDate = value;
     6818          this.SendPropertyChanged("StartDate");
     6819          this.OnStartDateChanged();
     6820        }
     6821      }
     6822    }
     6823   
     6824    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime")]
     6825    public System.Nullable<System.DateTime> EndDate
     6826    {
     6827      get
     6828      {
     6829        return this._EndDate;
     6830      }
     6831      set
     6832      {
     6833        if ((this._EndDate != value))
     6834        {
     6835          this.OnEndDateChanging(value);
     6836          this.SendPropertyChanging();
     6837          this._EndDate = value;
     6838          this.SendPropertyChanged("EndDate");
     6839          this.OnEndDateChanged();
     6840        }
     6841      }
     6842    }
     6843   
     6844    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime NOT NULL")]
     6845    public System.DateTime DateCreated
     6846    {
     6847      get
     6848      {
     6849        return this._DateCreated;
     6850      }
     6851      set
     6852      {
     6853        if ((this._DateCreated != value))
     6854        {
     6855          this.OnDateCreatedChanging(value);
     6856          this.SendPropertyChanging();
     6857          this._DateCreated = value;
     6858          this.SendPropertyChanged("DateCreated");
     6859          this.OnDateCreatedChanged();
     6860        }
     6861      }
     6862    }
     6863   
     6864    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateExpired", DbType="DateTime")]
     6865    public System.Nullable<System.DateTime> DateExpired
     6866    {
     6867      get
     6868      {
     6869        return this._DateExpired;
     6870      }
     6871      set
     6872      {
     6873        if ((this._DateExpired != value))
     6874        {
     6875          this.OnDateExpiredChanging(value);
     6876          this.SendPropertyChanging();
     6877          this._DateExpired = value;
     6878          this.SendPropertyChanged("DateExpired");
     6879          this.OnDateExpiredChanged();
     6880        }
     6881      }
     6882    }
     6883   
     6884    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimProject_DimJob", Storage="_DimJobs", ThisKey="Id", OtherKey="ProjectId")]
     6885    public EntitySet<DimJob> DimJobs
     6886    {
     6887      get
     6888      {
     6889        return this._DimJobs;
     6890      }
     6891      set
     6892      {
     6893        this._DimJobs.Assign(value);
     6894      }
     6895    }
     6896   
     6897    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimProject_FactProjectInfo", Storage="_FactProjectInfos", ThisKey="Id", OtherKey="ProjectId")]
     6898    public EntitySet<FactProjectInfo> FactProjectInfos
     6899    {
     6900      get
     6901      {
     6902        return this._FactProjectInfos;
     6903      }
     6904      set
     6905      {
     6906        this._FactProjectInfos.Assign(value);
     6907      }
     6908    }
     6909   
     6910    public event PropertyChangingEventHandler PropertyChanging;
     6911   
     6912    public event PropertyChangedEventHandler PropertyChanged;
     6913   
     6914    protected virtual void SendPropertyChanging()
     6915    {
     6916      if ((this.PropertyChanging != null))
     6917      {
     6918        this.PropertyChanging(this, emptyChangingEventArgs);
     6919      }
     6920    }
     6921   
     6922    protected virtual void SendPropertyChanged(String propertyName)
     6923    {
     6924      if ((this.PropertyChanged != null))
     6925      {
     6926        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
     6927      }
     6928    }
     6929   
     6930    private void attach_DimJobs(DimJob entity)
     6931    {
     6932      this.SendPropertyChanging();
     6933      entity.DimProject = this;
     6934    }
     6935   
     6936    private void detach_DimJobs(DimJob entity)
     6937    {
     6938      this.SendPropertyChanging();
     6939      entity.DimProject = null;
     6940    }
     6941   
     6942    private void attach_FactProjectInfos(FactProjectInfo entity)
     6943    {
     6944      this.SendPropertyChanging();
     6945      entity.DimProject = this;
     6946    }
     6947   
     6948    private void detach_FactProjectInfos(FactProjectInfo entity)
     6949    {
     6950      this.SendPropertyChanging();
     6951      entity.DimProject = null;
     6952    }
     6953  }
    62416954}
    62426955#pragma warning restore 1591
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IPersistenceManager.cs

    r15644 r15659  
    5858    FactClientInfoDao FactClientInfoDao { get; }
    5959    FactTaskDao FactTaskDao { get; }
     60    DimProjectDao DimProjectDao { get; }
     61    FactProjectInfoDao FactProjectInfoDao { get; }
    6062    #endregion
    6163
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Manager/PersistenceManager.cs

    r15644 r15659  
    159159    public FactTaskDao FactTaskDao {
    160160      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)); }
    161171    }
    162172    #endregion
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql

    r15630 r15659  
    3030  [ProjectId] UniqueIdentifier NOT NULL,
    3131  CONSTRAINT [PK_dbo.ResourceIdProjectId] PRIMARY KEY ([ResourceId], [ProjectId])
    32   )
    33 CREATE TABLE [dbo].[AssignedTaskResource](
    34   [ResourceId] UniqueIdentifier NOT NULL,
    35   [TaskId] UniqueIdentifier NOT NULL,
    36   CONSTRAINT [PK_dbo.ResourceIdTaskId] PRIMARY KEY ([ResourceId], [TaskId])
    3732  )
    3833CREATE TABLE [dbo].[AssignedJobResource](
     
    176171ALTER TABLE [dbo].[AssignedProjectResource]
    177172  ADD CONSTRAINT [Project_AssignedProjectResource] FOREIGN KEY ([ProjectId]) REFERENCES [dbo].[Project]([ProjectId]) ON UPDATE CASCADE ON DELETE CASCADE;
    178 ALTER TABLE [dbo].[AssignedTaskResource]
    179   ADD CONSTRAINT [Resource_AssignedTaskResource] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId]) ON UPDATE CASCADE ON DELETE CASCADE;
    180 ALTER TABLE [dbo].[AssignedTaskResource]
    181   ADD CONSTRAINT [Task_AssignedTaskResource] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId]) ON UPDATE CASCADE ON DELETE CASCADE;
    182173ALTER TABLE [dbo].[AssignedJobResource]
    183174  ADD CONSTRAINT [Resource_AssignedJobResource] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId]) ON UPDATE CASCADE ON DELETE CASCADE;
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Prepare Hive Database.sql

    r15630 r15659  
    3333ON DELETE CASCADE
    3434GO
    35 -- OBSOLETE (start)
    36 ALTER TABLE [dbo].[AssignedTaskResource]  DROP  CONSTRAINT [Task_AssignedTaskResource]
    37 ALTER TABLE [dbo].[AssignedTaskResource]  WITH CHECK ADD  CONSTRAINT [Task_AssignedTaskResource] FOREIGN KEY([TaskId])
    38 REFERENCES [dbo].[Task] ([TaskId])
    39 ON UPDATE CASCADE
    40 ON DELETE CASCADE
    41 GO
    42 ALTER TABLE [dbo].[AssignedTaskResource]  DROP  CONSTRAINT [Resource_AssignedTaskResource]
    43 ALTER TABLE [dbo].[AssignedTaskResource]  WITH CHECK ADD  CONSTRAINT [Resource_AssignedTaskResource] FOREIGN KEY([ResourceId])
    44 REFERENCES [dbo].[Resource] ([ResourceId])
    45 ON UPDATE CASCADE
    46 ON DELETE CASCADE
    47 GO
    48 -- OBSOLETE (end)
    4935ALTER TABLE [dbo].[AssignedJobResource]  DROP  CONSTRAINT [Job_AssignedJobResource]
    5036ALTER TABLE [dbo].[AssignedJobResource]  WITH CHECK ADD  CONSTRAINT [Job_AssignedJobResource] FOREIGN KEY([JobId])
     
    118104REFERENCES [dbo].[Project] ([ProjectId])
    119105ON UPDATE CASCADE
    120 -- ON DELETE CASCADE (no "ON DELETE CASCADE" >>> if project is deleted, jobs (actually job-belonging tasks) should be aborted, but not deleted
     106ON DELETE CASCADE
    121107GO
    122108
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs

    r15641 r15659  
    3737    public void GenerateStatistics() {
    3838      using (var pm = new PersistenceManager()) {
     39
     40        pm.UseTransaction(() => {
     41          UpdateDimProjectTable(pm);
     42        });
     43
    3944        pm.UseTransaction(() => {
    4045          UpdateDimUserTable(pm);
     46         
    4147          UpdateDimJobTable(pm);
    4248          UpdateDimClientsTable(pm);
     
    5359          pm.UseTransaction(() => {
    5460            UpdateFactClientInfoTable(time, pm);
     61            UpdateFactProjectInfoTable(time, pm); // in progress
    5562            pm.SubmitChanges();
    5663          });
     
    111118    }
    112119
     120    private void UpdateDimProjectTable(PersistenceManager pm) {
     121      var projectDao = pm.ProjectDao;
     122      var dimProjectDao = pm.DimProjectDao;
     123
     124      var projects = projectDao.GetAll().ToList();
     125      var dimProjects = dimProjectDao.GetAllOnlineProjects().ToList();
     126
     127      var onlineProjects = dimProjects.Where(x => projects.Select(y => y.ProjectId).Contains(x.ProjectId));
     128      var addedProjects = projects.Where(x => !dimProjects.Select(y => y.ProjectId).Contains(x.ProjectId));
     129      var removedProjects = dimProjects.Where(x => !projects.Select(y => y.ProjectId).Contains(x.ProjectId));
     130
     131      // set expiration time of removed projects
     132      foreach (var p in removedProjects) {
     133        p.DateExpired = DateTime.Now;
     134      }
     135
     136      // add new projects
     137      dimProjectDao.Save(addedProjects.Select(x => new DimProject {
     138        ProjectId = x.ProjectId,
     139        ParentProjectId = x.ParentProjectId,
     140        Name = x.Name,
     141        Description = x.Description,
     142        OwnerUserId = x.OwnerUserId,
     143        StartDate = x.StartDate,
     144        EndDate = x.EndDate,
     145        DateCreated = x.DateCreated,
     146        DateExpired = null
     147      }));
     148
     149      // if a project's parent has changed expire entry in DimProject and create a new entry
     150      // else perform "normal" update
     151      foreach (var dimP in onlineProjects) {
     152        var p = projects.Where(x => x.ProjectId == dimP.ProjectId).SingleOrDefault();
     153        if (p != null) {
     154          if (dimP.ParentProjectId != p.ParentProjectId) {
     155            dimP.DateExpired = DateTime.Now;
     156            dimProjectDao.Save(new DimProject {
     157              ProjectId = p.ProjectId,
     158              ParentProjectId = p.ParentProjectId,
     159              Name = p.Name,
     160              Description = p.Description,
     161              OwnerUserId = p.OwnerUserId,
     162              StartDate = p.StartDate,
     163              EndDate = p.EndDate,
     164              DateCreated = p.DateCreated,
     165              DateExpired = null
     166            });
     167          } else {
     168            dimP.Name = p.Name;
     169            dimP.Description = p.Description;
     170            dimP.OwnerUserId = p.OwnerUserId;
     171            dimP.StartDate = p.StartDate;
     172            dimP.EndDate = p.EndDate;
     173          }
     174        }
     175      }
     176    }
     177
    113178    private void UpdateDimJobTable(PersistenceManager pm) {
     179      var dimProjectDao = pm.DimProjectDao;
    114180      var dimJobDao = pm.DimJobDao;
    115181      var jobDao = pm.JobDao;
     
    123189          JobName = x.Name ?? string.Empty,
    124190          DateCreated = x.DateCreated,
     191          ProjectId = dimProjectDao.GetLastValidIdByProjectId(x.ProjectId),
    125192          TotalTasks = taskDao.GetAll().Count(y => y.JobId == x.JobId)
    126193        })
     
    132199        UserName = GetUserName(x.UserId),
    133200        DateCreated = x.DateCreated,
     201        ProjectId = x.ProjectId,
    134202        TotalTasks = x.TotalTasks,
    135203        CompletedTasks = 0,
     
    139207
    140208    private void UpdateExistingDimJobs(PersistenceManager pm) {
     209      var dimProjectDao = pm.DimProjectDao;
    141210      var jobDao = pm.JobDao;
    142211      var dimJobDao = pm.DimJobDao;
     
    156225          }
    157226        }
     227        var job = jobDao.GetById(dimJob.JobId);
    158228        if (totalTasks == completedTasks) {
    159229          var completeDate = factTaskDao.GetLastCompletedTaskFromJob(dimJob.JobId);
    160230          if (completeDate == null) {
    161             if (jobDao.GetById(dimJob.JobId) == null) {
     231            if (job == null) {
    162232              completeDate = DateTime.Now;
    163233            }
     
    165235          dimJob.DateCompleted = completeDate;
    166236        }
     237        if(job != null) {
     238          dimJob.JobName = job.Name;
     239          dimJob.ProjectId = dimProjectDao.GetLastValidIdByProjectId(job.ProjectId);
     240        }
     241
    167242        dimJob.TotalTasks = totalTasks;
    168243        dimJob.CompletedTasks = completedTasks;
     
    178253    }
    179254
     255    // (1) for new slaves (not yet reported in Table DimClients) ...
     256    // and modified slaves (name or parent resource changed) a new DimClient-entry is created
     257    // (2) for already reported removed and modifid clients the expiration date is set
    180258    private void UpdateDimClientsTable(PersistenceManager pm) {
    181259      var dimClientDao = pm.DimClientDao;
     
    274352    }
    275353
     354    private void UpdateFactProjectInfoTable(DimTime newTime, PersistenceManager pm) {
     355      // TODO
     356    }
     357
    276358    private void UpdateTaskFactsTable(PersistenceManager pm) {
    277359      var factTaskDao = pm.FactTaskDao;
  • branches/HiveProjectManagement/HeuristicLab.Services.WebApp/3.3/HeuristicLab.Services.WebApp-3.3.csproj

    r12878 r15659  
    2323    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
    2424    <RestorePackages>true</RestorePackages>
     25    <UseGlobalApplicationHostFile />
    2526  </PropertyGroup>
    2627  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     
    234235    <Content Include="WebApp\libs\bootstrap\fonts\glyphicons-halflings-regular.woff" />
    235236    <Content Include="WebApp\libs\bootstrap\fonts\glyphicons-halflings-regular.woff2" />
    236     <Content Include="WebApp\shared\directives\scrollToTop.js" />
    237237    <Content Include="WebApp\shared\filter\filters.js" />
    238238    <Content Include="WebApp\shared\images\HeuristicLab-Logo.png" />
Note: See TracChangeset for help on using the changeset viewer.