Changeset 3018 for trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess
- Timestamp:
- 03/14/10 12:07:47 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ClientGroupDao.cs
r3011 r3018 109 109 foreach (Client client in qClients) { 110 110 parentClientGroup.Resources.Add(cd.EntityToDto(client, null)); 111 } 112 } 113 114 public IEnumerable<Guid> FindAllGroupAndParentGroupIdsForClient(Guid clientId) { 115 List<Guid> guids = new List<Guid>(); 116 Client c = Context.Clients.SingleOrDefault(client => client.ResourceId.Equals(clientId)); 117 FindAllGroupAndParentGroupIdsForClientRecursive(c.Resource, guids); 118 return guids; 119 } 120 121 private void FindAllGroupAndParentGroupIdsForClientRecursive(Resource resource, List<Guid> guids) { 122 foreach (ClientGroup_Resource cgr in resource.ClientGroup_Resources) { 123 guids.Add(cgr.ClientGroupId); 124 FindAllGroupAndParentGroupIdsForClientRecursive(cgr.ClientGroup.Resource, guids); 111 125 } 112 113 126 } 114 127 -
trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml
r3011 r3018 7 7 <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" /> 8 8 <Column Name="AssignedRessourcesId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> 9 <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" /> 9 10 <Association Name="Job_AssignedResource" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" /> 10 <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" />11 11 </Type> 12 12 </Table> … … 44 44 </Type> 45 45 </Table> 46 <Table Name="dbo.Job" Member="Jobs">47 <Type Name="Job">48 <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />49 <Column Name="ParentJobId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />50 <Column Name="JobState" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />51 <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />52 <Column Name="Percentage" Type="System.Double" DbType="Float" CanBeNull="true" />53 <Column Name="SerializedJob" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX)" CanBeNull="true" UpdateCheck="Never" IsDelayLoaded="true" />54 <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />55 <Column Name="DateCalculated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />56 <Column Name="DateFinished" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />57 <Column Name="Priority" Type="System.Int32" DbType="Int" CanBeNull="true" />58 <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />59 <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />60 <Column Name="CoresNeeded" Type="System.Int32" DbType="Int" CanBeNull="false" />61 <Column Name="MemoryNeeded" Type="System.Int32" DbType="Int" CanBeNull="false" />62 <Association Name="Job_AssignedResource" Member="AssignedResources" ThisKey="JobId" OtherKey="JobId" Type="AssignedResource" />63 <Association Name="Job_Job" Member="Jobs" ThisKey="JobId" OtherKey="ParentJobId" Type="Job" />64 <Association Name="Job_RequiredPlugin" Member="RequiredPlugins" ThisKey="JobId" OtherKey="JobId" Type="RequiredPlugin" />65 <Association Name="Job_Job" Member="Job1" ThisKey="ParentJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />66 <Association Name="Project_Job" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" DeleteRule="SET NULL" />67 <Association Name="Client_Job" Member="Client" ThisKey="ResourceId" OtherKey="ResourceId" Type="Client" IsForeignKey="true" DeleteRule="SET NULL" />68 </Type>69 </Table>70 46 <Table Name="dbo.PluginInfo" Member="PluginInfos"> 71 47 <Type Name="PluginInfo"> … … 89 65 <Column Name="PluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" /> 90 66 <Column Name="RequiredPluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" UpdateCheck="Never" /> 67 <Association Name="PluginInfo_RequiredPlugin" Member="PluginInfo" ThisKey="PluginId" OtherKey="PluginId" Type="PluginInfo" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" /> 91 68 <Association Name="Job_RequiredPlugin" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" /> 92 <Association Name="PluginInfo_RequiredPlugin" Member="PluginInfo" ThisKey="PluginId" OtherKey="PluginId" Type="PluginInfo" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" />93 69 </Type> 94 70 </Table> … … 120 96 </Type> 121 97 </Table> 98 <Table Name="dbo.Job" Member="Jobs"> 99 <Type Name="Job"> 100 <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> 101 <Column Name="ParentJobId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" /> 102 <Column Name="JobState" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" /> 103 <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" /> 104 <Column Name="Percentage" Type="System.Double" DbType="Float" CanBeNull="true" /> 105 <Column Name="SerializedJob" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX)" CanBeNull="true" UpdateCheck="Never" /> 106 <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" /> 107 <Column Name="DateCalculated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" /> 108 <Column Name="DateFinished" Type="System.DateTime" DbType="DateTime" CanBeNull="true" /> 109 <Column Name="Priority" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" /> 110 <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" /> 111 <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" /> 112 <Column Name="CoresNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" /> 113 <Column Name="MemoryNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" /> 114 <Association Name="Job_AssignedResource" Member="AssignedResources" ThisKey="JobId" OtherKey="JobId" Type="AssignedResource" /> 115 <Association Name="Job_RequiredPlugin" Member="RequiredPlugins" ThisKey="JobId" OtherKey="JobId" Type="RequiredPlugin" /> 116 <Association Name="Job_Job" Member="Jobs" ThisKey="JobId" OtherKey="ParentJobId" Type="Job" /> 117 <Association Name="Client_Job" Member="Client" ThisKey="ResourceId" OtherKey="ResourceId" Type="Client" IsForeignKey="true" DeleteRule="SET NULL" /> 118 <Association Name="Job_Job" Member="Job1" ThisKey="ParentJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" /> 119 <Association Name="Project_Job" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" DeleteRule="SET NULL" /> 120 </Type> 121 </Table> 122 122 </Database> -
trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml.layout
r3011 r3018 33 33 </nestedChildShapes> 34 34 </classShape> 35 <classShape Id="63840838-dba2-4615-b10b-b812f68ec9a1" absoluteBounds="9, 6.25, 2, 3.5016097005208318">36 <DataClassMoniker Name="/HiveDataContext/Job" />37 <nestedChildShapes>38 <elementListCompartment Id="3758a5b7-d1ea-4673-b0e6-db5da665526e" absoluteBounds="9.015, 6.7100000000000009, 1.9700000000000002, 2.941609700520833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />39 </nestedChildShapes>40 </classShape>41 35 <classShape Id="a054f27a-f931-4019-b8a0-500bbd926986" absoluteBounds="12, 6.375, 2, 1.5785953776041666"> 42 36 <DataClassMoniker Name="/HiveDataContext/PluginInfo" /> … … 68 62 <classShapeMoniker Id="fdda4acc-8a1b-47c8-95ae-5e366f019c84" /> 69 63 <classShapeMoniker Id="0535d2ec-d743-4b65-a1d6-70f7af1eead3" /> 70 </nodes>71 </associationConnector>72 <associationConnector edgePoints="[(10 : 6.25); (10 : 4.34375); (5.5 : 4.34375)]" fixedFrom="NotFixed" fixedTo="NotFixed">73 <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" />74 <nodes>75 <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />76 <classShapeMoniker Id="3bbfffd4-3ad8-4ff9-b0ff-bdddca70b322" />77 </nodes>78 </associationConnector>79 <associationConnector edgePoints="[(9.70923076923077 : 9.75160970052083); (9.70923076923077 : 10.0016097005208); (10.3046153846154 : 10.0016097005208); (10.3046153846154 : 9.75160970052083)]" fixedFrom="NotFixed" fixedTo="NotFixed">80 <AssociationMoniker Name="/HiveDataContext/Job/Job_Job" />81 <nodes>82 <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />83 <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />84 </nodes>85 </associationConnector>86 <associationConnector edgePoints="[(8.25 : 11.0969962565104); (9.32336288461538 : 11.0969962565104); (9.32336288461538 : 9.75160970052083)]" fixedFrom="NotFixed" fixedTo="NotFixed">87 <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" />88 <nodes>89 <classShapeMoniker Id="401c6a1e-69dc-43e4-a4c6-bfc7c2130170" />90 <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />91 </nodes>92 </associationConnector>93 <associationConnector edgePoints="[(11 : 9.25080485026042); (12 : 9.25080485026042)]" fixedFrom="NotFixed" fixedTo="NotFixed">94 <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" />95 <nodes>96 <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />97 <classShapeMoniker Id="59a84aec-bc57-49b5-a709-71cdf7612b31" />98 64 </nodes> 99 65 </associationConnector> … … 139 105 </nodes> 140 106 </associationConnector> 141 <associationConnector edgePoints="[(5.625 : 8.78770182291667); (9 : 8.78770182291667)]" fixedFrom="NotFixed" fixedTo="NotFixed">142 <AssociationMoniker Name="/HiveDataContext/Client/Client_Job" />143 <nodes>144 <classShapeMoniker Id="a2f0b500-6e5f-4de0-b608-64e4b55a73c4" />145 <classShapeMoniker Id="63840838-dba2-4615-b10b-b812f68ec9a1" />146 </nodes>147 </associationConnector>148 107 <associationConnector edgePoints="[(4.5 : 6.94399251302083); (4.5 : 7.625)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 149 108 <AssociationMoniker Name="/HiveDataContext/Resource/Resource_Client" /> … … 160 119 </nodes> 161 120 </associationConnector> 121 <classShape Id="9af04358-a545-4e37-bb13-d249fecfa769" absoluteBounds="9, 6.5, 2, 3.5016097005208326"> 122 <DataClassMoniker Name="/HiveDataContext/Job" /> 123 <nestedChildShapes> 124 <elementListCompartment Id="b55e771e-4639-44c8-9d16-727b309f657d" absoluteBounds="9.015, 6.96, 1.9700000000000002, 2.941609700520833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 125 </nestedChildShapes> 126 </classShape> 127 <associationConnector edgePoints="[(10 : 6.5); (10 : 4.34375); (5.5 : 4.34375)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 128 <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" /> 129 <nodes> 130 <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" /> 131 <classShapeMoniker Id="3bbfffd4-3ad8-4ff9-b0ff-bdddca70b322" /> 132 </nodes> 133 </associationConnector> 134 <associationConnector edgePoints="[(11 : 9.37580485026042); (12 : 9.37580485026042)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 135 <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" /> 136 <nodes> 137 <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" /> 138 <classShapeMoniker Id="59a84aec-bc57-49b5-a709-71cdf7612b31" /> 139 </nodes> 140 </associationConnector> 141 <associationConnector edgePoints="[(5.625 : 8.91270182291667); (9 : 8.91270182291667)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 142 <AssociationMoniker Name="/HiveDataContext/Client/Client_Job" /> 143 <nodes> 144 <classShapeMoniker Id="a2f0b500-6e5f-4de0-b608-64e4b55a73c4" /> 145 <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" /> 146 </nodes> 147 </associationConnector> 148 <associationConnector edgePoints="[(9.70923076923077 : 10.0016097005208); (9.70923076923077 : 10.2516097005208); (10.3046153846154 : 10.2516097005208); (10.3046153846154 : 10.0016097005208)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 149 <AssociationMoniker Name="/HiveDataContext/Job/Job_Job" /> 150 <nodes> 151 <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" /> 152 <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" /> 153 </nodes> 154 </associationConnector> 155 <associationConnector edgePoints="[(8.25 : 11.0969962565104); (9.32336288461538 : 11.0969962565104); (9.32336288461538 : 10.0016097005208)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 156 <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" /> 157 <nodes> 158 <classShapeMoniker Id="401c6a1e-69dc-43e4-a4c6-bfc7c2130170" /> 159 <classShapeMoniker Id="9af04358-a545-4e37-bb13-d249fecfa769" /> 160 </nodes> 161 </associationConnector> 162 162 </nestedChildShapes> 163 163 </ordesignerObjectsDiagram> -
trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.designer.cs
r3011 r3018 46 46 partial void UpdateClientGroup_Resource(ClientGroup_Resource instance); 47 47 partial void DeleteClientGroup_Resource(ClientGroup_Resource instance); 48 partial void InsertJob(Job instance);49 partial void UpdateJob(Job instance);50 partial void DeleteJob(Job instance);51 48 partial void InsertPluginInfo(PluginInfo instance); 52 49 partial void UpdatePluginInfo(PluginInfo instance); … … 64 61 partial void UpdateClient(Client instance); 65 62 partial void DeleteClient(Client instance); 63 partial void InsertJob(Job instance); 64 partial void UpdateJob(Job instance); 65 partial void DeleteJob(Job instance); 66 66 #endregion 67 67 … … 136 136 } 137 137 138 public System.Data.Linq.Table<PluginInfo> PluginInfos 139 { 140 get 141 { 142 return this.GetTable<PluginInfo>(); 143 } 144 } 145 146 public System.Data.Linq.Table<Project> Projects 147 { 148 get 149 { 150 return this.GetTable<Project>(); 151 } 152 } 153 154 public System.Data.Linq.Table<RequiredPlugin> RequiredPlugins 155 { 156 get 157 { 158 return this.GetTable<RequiredPlugin>(); 159 } 160 } 161 162 public System.Data.Linq.Table<Resource> Resources 163 { 164 get 165 { 166 return this.GetTable<Resource>(); 167 } 168 } 169 170 public System.Data.Linq.Table<Client> Clients 171 { 172 get 173 { 174 return this.GetTable<Client>(); 175 } 176 } 177 138 178 public System.Data.Linq.Table<Job> Jobs 139 179 { … … 141 181 { 142 182 return this.GetTable<Job>(); 143 }144 }145 146 public System.Data.Linq.Table<PluginInfo> PluginInfos147 {148 get149 {150 return this.GetTable<PluginInfo>();151 }152 }153 154 public System.Data.Linq.Table<Project> Projects155 {156 get157 {158 return this.GetTable<Project>();159 }160 }161 162 public System.Data.Linq.Table<RequiredPlugin> RequiredPlugins163 {164 get165 {166 return this.GetTable<RequiredPlugin>();167 }168 }169 170 public System.Data.Linq.Table<Resource> Resources171 {172 get173 {174 return this.GetTable<Resource>();175 }176 }177 178 public System.Data.Linq.Table<Client> Clients179 {180 get181 {182 return this.GetTable<Client>();183 183 } 184 184 } … … 197 197 private System.Guid _AssignedRessourcesId; 198 198 199 private EntityRef<Resource> _Resource; 200 199 201 private EntityRef<Job> _Job; 200 201 private EntityRef<Resource> _Resource;202 202 203 203 #region Extensibility Method Definitions … … 215 215 public AssignedResource() 216 216 { 217 this._Resource = default(EntityRef<Resource>); 217 218 this._Job = default(EntityRef<Job>); 218 this._Resource = default(EntityRef<Resource>);219 219 OnCreated(); 220 220 } … … 288 288 } 289 289 290 [Association(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")] 291 public Resource Resource 292 { 293 get 294 { 295 return this._Resource.Entity; 296 } 297 set 298 { 299 Resource previousValue = this._Resource.Entity; 300 if (((previousValue != value) 301 || (this._Resource.HasLoadedOrAssignedValue == false))) 302 { 303 this.SendPropertyChanging(); 304 if ((previousValue != null)) 305 { 306 this._Resource.Entity = null; 307 previousValue.AssignedResources.Remove(this); 308 } 309 this._Resource.Entity = value; 310 if ((value != null)) 311 { 312 value.AssignedResources.Add(this); 313 this._ResourceId = value.ResourceId; 314 } 315 else 316 { 317 this._ResourceId = default(System.Guid); 318 } 319 this.SendPropertyChanged("Resource"); 320 } 321 } 322 } 323 290 324 [Association(Name="Job_AssignedResource", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")] 291 325 public Job Job … … 318 352 } 319 353 this.SendPropertyChanged("Job"); 320 }321 }322 }323 324 [Association(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]325 public Resource Resource326 {327 get328 {329 return this._Resource.Entity;330 }331 set332 {333 Resource previousValue = this._Resource.Entity;334 if (((previousValue != value)335 || (this._Resource.HasLoadedOrAssignedValue == false)))336 {337 this.SendPropertyChanging();338 if ((previousValue != null))339 {340 this._Resource.Entity = null;341 previousValue.AssignedResources.Remove(this);342 }343 this._Resource.Entity = value;344 if ((value != null))345 {346 value.AssignedResources.Add(this);347 this._ResourceId = value.ResourceId;348 }349 else350 {351 this._ResourceId = default(System.Guid);352 }353 this.SendPropertyChanged("Resource");354 354 } 355 355 } … … 1013 1013 } 1014 1014 1015 [Table(Name="dbo.Job")]1016 public partial class Job : INotifyPropertyChanging, INotifyPropertyChanged1017 {1018 1019 private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);1020 1021 private System.Guid _JobId;1022 1023 private System.Nullable<System.Guid> _ParentJobId;1024 1025 private string _JobState;1026 1027 private System.Nullable<System.Guid> _ResourceId;1028 1029 private System.Nullable<double> _Percentage;1030 1031 private System.Data.Linq.Link<System.Data.Linq.Binary> _SerializedJob;1032 1033 private System.Nullable<System.DateTime> _DateCreated;1034 1035 private System.Nullable<System.DateTime> _DateCalculated;1036 1037 private System.Nullable<System.DateTime> _DateFinished;1038 1039 private System.Nullable<int> _Priority;1040 1041 private System.Nullable<System.Guid> _ProjectId;1042 1043 private System.Nullable<System.Guid> _UserId;1044 1045 private int _CoresNeeded;1046 1047 private int _MemoryNeeded;1048 1049 private EntitySet<AssignedResource> _AssignedResources;1050 1051 private EntitySet<Job> _Jobs;1052 1053 private EntitySet<RequiredPlugin> _RequiredPlugins;1054 1055 private EntityRef<Job> _Job1;1056 1057 private EntityRef<Project> _Project;1058 1059 private EntityRef<Client> _Client;1060 1061 #region Extensibility Method Definitions1062 partial void OnLoaded();1063 partial void OnValidate(System.Data.Linq.ChangeAction action);1064 partial void OnCreated();1065 partial void OnJobIdChanging(System.Guid value);1066 partial void OnJobIdChanged();1067 partial void OnParentJobIdChanging(System.Nullable<System.Guid> value);1068 partial void OnParentJobIdChanged();1069 partial void OnJobStateChanging(string value);1070 partial void OnJobStateChanged();1071 partial void OnResourceIdChanging(System.Nullable<System.Guid> value);1072 partial void OnResourceIdChanged();1073 partial void OnPercentageChanging(System.Nullable<double> value);1074 partial void OnPercentageChanged();1075 partial void OnSerializedJobChanging(System.Data.Linq.Binary value);1076 partial void OnSerializedJobChanged();1077 partial void OnDateCreatedChanging(System.Nullable<System.DateTime> value);1078 partial void OnDateCreatedChanged();1079 partial void OnDateCalculatedChanging(System.Nullable<System.DateTime> value);1080 partial void OnDateCalculatedChanged();1081 partial void OnDateFinishedChanging(System.Nullable<System.DateTime> value);1082 partial void OnDateFinishedChanged();1083 partial void OnPriorityChanging(System.Nullable<int> value);1084 partial void OnPriorityChanged();1085 partial void OnProjectIdChanging(System.Nullable<System.Guid> value);1086 partial void OnProjectIdChanged();1087 partial void OnUserIdChanging(System.Nullable<System.Guid> value);1088 partial void OnUserIdChanged();1089 partial void OnCoresNeededChanging(int value);1090 partial void OnCoresNeededChanged();1091 partial void OnMemoryNeededChanging(int value);1092 partial void OnMemoryNeededChanged();1093 #endregion1094 1095 public Job()1096 {1097 this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));1098 this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));1099 this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));1100 this._Job1 = default(EntityRef<Job>);1101 this._Project = default(EntityRef<Project>);1102 this._Client = default(EntityRef<Client>);1103 OnCreated();1104 }1105 1106 [Column(Storage="_JobId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]1107 public System.Guid JobId1108 {1109 get1110 {1111 return this._JobId;1112 }1113 set1114 {1115 if ((this._JobId != value))1116 {1117 this.OnJobIdChanging(value);1118 this.SendPropertyChanging();1119 this._JobId = value;1120 this.SendPropertyChanged("JobId");1121 this.OnJobIdChanged();1122 }1123 }1124 }1125 1126 [Column(Storage="_ParentJobId", DbType="UniqueIdentifier")]1127 public System.Nullable<System.Guid> ParentJobId1128 {1129 get1130 {1131 return this._ParentJobId;1132 }1133 set1134 {1135 if ((this._ParentJobId != value))1136 {1137 if (this._Job1.HasLoadedOrAssignedValue)1138 {1139 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();1140 }1141 this.OnParentJobIdChanging(value);1142 this.SendPropertyChanging();1143 this._ParentJobId = value;1144 this.SendPropertyChanged("ParentJobId");1145 this.OnParentJobIdChanged();1146 }1147 }1148 }1149 1150 [Column(Storage="_JobState", DbType="VarChar(MAX)")]1151 public string JobState1152 {1153 get1154 {1155 return this._JobState;1156 }1157 set1158 {1159 if ((this._JobState != value))1160 {1161 this.OnJobStateChanging(value);1162 this.SendPropertyChanging();1163 this._JobState = value;1164 this.SendPropertyChanged("JobState");1165 this.OnJobStateChanged();1166 }1167 }1168 }1169 1170 [Column(Storage="_ResourceId", DbType="UniqueIdentifier")]1171 public System.Nullable<System.Guid> ResourceId1172 {1173 get1174 {1175 return this._ResourceId;1176 }1177 set1178 {1179 if ((this._ResourceId != value))1180 {1181 if (this._Client.HasLoadedOrAssignedValue)1182 {1183 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();1184 }1185 this.OnResourceIdChanging(value);1186 this.SendPropertyChanging();1187 this._ResourceId = value;1188 this.SendPropertyChanged("ResourceId");1189 this.OnResourceIdChanged();1190 }1191 }1192 }1193 1194 [Column(Storage="_Percentage", DbType="Float")]1195 public System.Nullable<double> Percentage1196 {1197 get1198 {1199 return this._Percentage;1200 }1201 set1202 {1203 if ((this._Percentage != value))1204 {1205 this.OnPercentageChanging(value);1206 this.SendPropertyChanging();1207 this._Percentage = value;1208 this.SendPropertyChanged("Percentage");1209 this.OnPercentageChanged();1210 }1211 }1212 }1213 1214 [Column(Storage="_SerializedJob", DbType="VarBinary(MAX)", CanBeNull=true, UpdateCheck=UpdateCheck.Never)]1215 public System.Data.Linq.Binary SerializedJob1216 {1217 get1218 {1219 return this._SerializedJob.Value;1220 }1221 set1222 {1223 if ((this._SerializedJob.Value != value))1224 {1225 this.OnSerializedJobChanging(value);1226 this.SendPropertyChanging();1227 this._SerializedJob.Value = value;1228 this.SendPropertyChanged("SerializedJob");1229 this.OnSerializedJobChanged();1230 }1231 }1232 }1233 1234 [Column(Storage="_DateCreated", DbType="DateTime")]1235 public System.Nullable<System.DateTime> DateCreated1236 {1237 get1238 {1239 return this._DateCreated;1240 }1241 set1242 {1243 if ((this._DateCreated != value))1244 {1245 this.OnDateCreatedChanging(value);1246 this.SendPropertyChanging();1247 this._DateCreated = value;1248 this.SendPropertyChanged("DateCreated");1249 this.OnDateCreatedChanged();1250 }1251 }1252 }1253 1254 [Column(Storage="_DateCalculated", DbType="DateTime")]1255 public System.Nullable<System.DateTime> DateCalculated1256 {1257 get1258 {1259 return this._DateCalculated;1260 }1261 set1262 {1263 if ((this._DateCalculated != value))1264 {1265 this.OnDateCalculatedChanging(value);1266 this.SendPropertyChanging();1267 this._DateCalculated = value;1268 this.SendPropertyChanged("DateCalculated");1269 this.OnDateCalculatedChanged();1270 }1271 }1272 }1273 1274 [Column(Storage="_DateFinished", DbType="DateTime")]1275 public System.Nullable<System.DateTime> DateFinished1276 {1277 get1278 {1279 return this._DateFinished;1280 }1281 set1282 {1283 if ((this._DateFinished != value))1284 {1285 this.OnDateFinishedChanging(value);1286 this.SendPropertyChanging();1287 this._DateFinished = value;1288 this.SendPropertyChanged("DateFinished");1289 this.OnDateFinishedChanged();1290 }1291 }1292 }1293 1294 [Column(Storage="_Priority", DbType="Int")]1295 public System.Nullable<int> Priority1296 {1297 get1298 {1299 return this._Priority;1300 }1301 set1302 {1303 if ((this._Priority != value))1304 {1305 this.OnPriorityChanging(value);1306 this.SendPropertyChanging();1307 this._Priority = value;1308 this.SendPropertyChanged("Priority");1309 this.OnPriorityChanged();1310 }1311 }1312 }1313 1314 [Column(Storage="_ProjectId", DbType="UniqueIdentifier")]1315 public System.Nullable<System.Guid> ProjectId1316 {1317 get1318 {1319 return this._ProjectId;1320 }1321 set1322 {1323 if ((this._ProjectId != value))1324 {1325 if (this._Project.HasLoadedOrAssignedValue)1326 {1327 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();1328 }1329 this.OnProjectIdChanging(value);1330 this.SendPropertyChanging();1331 this._ProjectId = value;1332 this.SendPropertyChanged("ProjectId");1333 this.OnProjectIdChanged();1334 }1335 }1336 }1337 1338 [Column(Storage="_UserId", DbType="UniqueIdentifier")]1339 public System.Nullable<System.Guid> UserId1340 {1341 get1342 {1343 return this._UserId;1344 }1345 set1346 {1347 if ((this._UserId != value))1348 {1349 this.OnUserIdChanging(value);1350 this.SendPropertyChanging();1351 this._UserId = value;1352 this.SendPropertyChanged("UserId");1353 this.OnUserIdChanged();1354 }1355 }1356 }1357 1358 [Column(Storage="_CoresNeeded", DbType="Int")]1359 public int CoresNeeded1360 {1361 get1362 {1363 return this._CoresNeeded;1364 }1365 set1366 {1367 if ((this._CoresNeeded != value))1368 {1369 this.OnCoresNeededChanging(value);1370 this.SendPropertyChanging();1371 this._CoresNeeded = value;1372 this.SendPropertyChanged("CoresNeeded");1373 this.OnCoresNeededChanged();1374 }1375 }1376 }1377 1378 [Column(Storage="_MemoryNeeded", DbType="Int")]1379 public int MemoryNeeded1380 {1381 get1382 {1383 return this._MemoryNeeded;1384 }1385 set1386 {1387 if ((this._MemoryNeeded != value))1388 {1389 this.OnMemoryNeededChanging(value);1390 this.SendPropertyChanging();1391 this._MemoryNeeded = value;1392 this.SendPropertyChanged("MemoryNeeded");1393 this.OnMemoryNeededChanged();1394 }1395 }1396 }1397 1398 [Association(Name="Job_AssignedResource", Storage="_AssignedResources", ThisKey="JobId", OtherKey="JobId")]1399 public EntitySet<AssignedResource> AssignedResources1400 {1401 get1402 {1403 return this._AssignedResources;1404 }1405 set1406 {1407 this._AssignedResources.Assign(value);1408 }1409 }1410 1411 [Association(Name="Job_Job", Storage="_Jobs", ThisKey="JobId", OtherKey="ParentJobId")]1412 public EntitySet<Job> Jobs1413 {1414 get1415 {1416 return this._Jobs;1417 }1418 set1419 {1420 this._Jobs.Assign(value);1421 }1422 }1423 1424 [Association(Name="Job_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="JobId", OtherKey="JobId")]1425 public EntitySet<RequiredPlugin> RequiredPlugins1426 {1427 get1428 {1429 return this._RequiredPlugins;1430 }1431 set1432 {1433 this._RequiredPlugins.Assign(value);1434 }1435 }1436 1437 [Association(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)]1438 public Job Job11439 {1440 get1441 {1442 return this._Job1.Entity;1443 }1444 set1445 {1446 Job previousValue = this._Job1.Entity;1447 if (((previousValue != value)1448 || (this._Job1.HasLoadedOrAssignedValue == false)))1449 {1450 this.SendPropertyChanging();1451 if ((previousValue != null))1452 {1453 this._Job1.Entity = null;1454 previousValue.Jobs.Remove(this);1455 }1456 this._Job1.Entity = value;1457 if ((value != null))1458 {1459 value.Jobs.Add(this);1460 this._ParentJobId = value.JobId;1461 }1462 else1463 {1464 this._ParentJobId = default(Nullable<System.Guid>);1465 }1466 this.SendPropertyChanged("Job1");1467 }1468 }1469 }1470 1471 [Association(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="SET NULL")]1472 public Project Project1473 {1474 get1475 {1476 return this._Project.Entity;1477 }1478 set1479 {1480 Project previousValue = this._Project.Entity;1481 if (((previousValue != value)1482 || (this._Project.HasLoadedOrAssignedValue == false)))1483 {1484 this.SendPropertyChanging();1485 if ((previousValue != null))1486 {1487 this._Project.Entity = null;1488 previousValue.Jobs.Remove(this);1489 }1490 this._Project.Entity = value;1491 if ((value != null))1492 {1493 value.Jobs.Add(this);1494 this._ProjectId = value.ProjectId;1495 }1496 else1497 {1498 this._ProjectId = default(Nullable<System.Guid>);1499 }1500 this.SendPropertyChanged("Project");1501 }1502 }1503 }1504 1505 [Association(Name="Client_Job", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")]1506 public Client Client1507 {1508 get1509 {1510 return this._Client.Entity;1511 }1512 set1513 {1514 Client previousValue = this._Client.Entity;1515 if (((previousValue != value)1516 || (this._Client.HasLoadedOrAssignedValue == false)))1517 {1518 this.SendPropertyChanging();1519 if ((previousValue != null))1520 {1521 this._Client.Entity = null;1522 previousValue.Jobs.Remove(this);1523 }1524 this._Client.Entity = value;1525 if ((value != null))1526 {1527 value.Jobs.Add(this);1528 this._ResourceId = value.ResourceId;1529 }1530 else1531 {1532 this._ResourceId = default(Nullable<System.Guid>);1533 }1534 this.SendPropertyChanged("Client");1535 }1536 }1537 }1538 1539 public event PropertyChangingEventHandler PropertyChanging;1540 1541 public event PropertyChangedEventHandler PropertyChanged;1542 1543 protected virtual void SendPropertyChanging()1544 {1545 if ((this.PropertyChanging != null))1546 {1547 this.PropertyChanging(this, emptyChangingEventArgs);1548 }1549 }1550 1551 protected virtual void SendPropertyChanged(String propertyName)1552 {1553 if ((this.PropertyChanged != null))1554 {1555 this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));1556 }1557 }1558 1559 private void attach_AssignedResources(AssignedResource entity)1560 {1561 this.SendPropertyChanging();1562 entity.Job = this;1563 }1564 1565 private void detach_AssignedResources(AssignedResource entity)1566 {1567 this.SendPropertyChanging();1568 entity.Job = null;1569 }1570 1571 private void attach_Jobs(Job entity)1572 {1573 this.SendPropertyChanging();1574 entity.Job1 = this;1575 }1576 1577 private void detach_Jobs(Job entity)1578 {1579 this.SendPropertyChanging();1580 entity.Job1 = null;1581 }1582 1583 private void attach_RequiredPlugins(RequiredPlugin entity)1584 {1585 this.SendPropertyChanging();1586 entity.Job = this;1587 }1588 1589 private void detach_RequiredPlugins(RequiredPlugin entity)1590 {1591 this.SendPropertyChanging();1592 entity.Job = null;1593 }1594 }1595 1596 1015 [Table(Name="dbo.PluginInfo")] 1597 1016 public partial class PluginInfo : INotifyPropertyChanging, INotifyPropertyChanged … … 1882 1301 private System.Guid _RequiredPluginId; 1883 1302 1303 private EntityRef<PluginInfo> _PluginInfo; 1304 1884 1305 private EntityRef<Job> _Job; 1885 1886 private EntityRef<PluginInfo> _PluginInfo;1887 1306 1888 1307 #region Extensibility Method Definitions … … 1900 1319 public RequiredPlugin() 1901 1320 { 1321 this._PluginInfo = default(EntityRef<PluginInfo>); 1902 1322 this._Job = default(EntityRef<Job>); 1903 this._PluginInfo = default(EntityRef<PluginInfo>);1904 1323 OnCreated(); 1905 1324 } … … 1973 1392 } 1974 1393 1394 [Association(Name="PluginInfo_RequiredPlugin", Storage="_PluginInfo", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")] 1395 public PluginInfo PluginInfo 1396 { 1397 get 1398 { 1399 return this._PluginInfo.Entity; 1400 } 1401 set 1402 { 1403 PluginInfo previousValue = this._PluginInfo.Entity; 1404 if (((previousValue != value) 1405 || (this._PluginInfo.HasLoadedOrAssignedValue == false))) 1406 { 1407 this.SendPropertyChanging(); 1408 if ((previousValue != null)) 1409 { 1410 this._PluginInfo.Entity = null; 1411 previousValue.RequiredPlugins.Remove(this); 1412 } 1413 this._PluginInfo.Entity = value; 1414 if ((value != null)) 1415 { 1416 value.RequiredPlugins.Add(this); 1417 this._PluginId = value.PluginId; 1418 } 1419 else 1420 { 1421 this._PluginId = default(System.Guid); 1422 } 1423 this.SendPropertyChanged("PluginInfo"); 1424 } 1425 } 1426 } 1427 1975 1428 [Association(Name="Job_RequiredPlugin", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)] 1976 1429 public Job Job … … 2003 1456 } 2004 1457 this.SendPropertyChanged("Job"); 2005 }2006 }2007 }2008 2009 [Association(Name="PluginInfo_RequiredPlugin", Storage="_PluginInfo", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]2010 public PluginInfo PluginInfo2011 {2012 get2013 {2014 return this._PluginInfo.Entity;2015 }2016 set2017 {2018 PluginInfo previousValue = this._PluginInfo.Entity;2019 if (((previousValue != value)2020 || (this._PluginInfo.HasLoadedOrAssignedValue == false)))2021 {2022 this.SendPropertyChanging();2023 if ((previousValue != null))2024 {2025 this._PluginInfo.Entity = null;2026 previousValue.RequiredPlugins.Remove(this);2027 }2028 this._PluginInfo.Entity = value;2029 if ((value != null))2030 {2031 value.RequiredPlugins.Add(this);2032 this._PluginId = value.PluginId;2033 }2034 else2035 {2036 this._PluginId = default(System.Guid);2037 }2038 this.SendPropertyChanged("PluginInfo");2039 1458 } 2040 1459 } … … 2659 2078 } 2660 2079 } 2080 2081 [Table(Name="dbo.Job")] 2082 public partial class Job : INotifyPropertyChanging, INotifyPropertyChanged 2083 { 2084 2085 private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); 2086 2087 private System.Guid _JobId; 2088 2089 private System.Nullable<System.Guid> _ParentJobId; 2090 2091 private string _JobState; 2092 2093 private System.Nullable<System.Guid> _ResourceId; 2094 2095 private System.Nullable<double> _Percentage; 2096 2097 private System.Data.Linq.Binary _SerializedJob; 2098 2099 private System.Nullable<System.DateTime> _DateCreated; 2100 2101 private System.Nullable<System.DateTime> _DateCalculated; 2102 2103 private System.Nullable<System.DateTime> _DateFinished; 2104 2105 private int _Priority; 2106 2107 private System.Nullable<System.Guid> _ProjectId; 2108 2109 private System.Nullable<System.Guid> _UserId; 2110 2111 private int _CoresNeeded; 2112 2113 private int _MemoryNeeded; 2114 2115 private EntitySet<AssignedResource> _AssignedResources; 2116 2117 private EntitySet<RequiredPlugin> _RequiredPlugins; 2118 2119 private EntitySet<Job> _Jobs; 2120 2121 private EntityRef<Client> _Client; 2122 2123 private EntityRef<Job> _Job1; 2124 2125 private EntityRef<Project> _Project; 2126 2127 #region Extensibility Method Definitions 2128 partial void OnLoaded(); 2129 partial void OnValidate(System.Data.Linq.ChangeAction action); 2130 partial void OnCreated(); 2131 partial void OnJobIdChanging(System.Guid value); 2132 partial void OnJobIdChanged(); 2133 partial void OnParentJobIdChanging(System.Nullable<System.Guid> value); 2134 partial void OnParentJobIdChanged(); 2135 partial void OnJobStateChanging(string value); 2136 partial void OnJobStateChanged(); 2137 partial void OnResourceIdChanging(System.Nullable<System.Guid> value); 2138 partial void OnResourceIdChanged(); 2139 partial void OnPercentageChanging(System.Nullable<double> value); 2140 partial void OnPercentageChanged(); 2141 partial void OnSerializedJobChanging(System.Data.Linq.Binary value); 2142 partial void OnSerializedJobChanged(); 2143 partial void OnDateCreatedChanging(System.Nullable<System.DateTime> value); 2144 partial void OnDateCreatedChanged(); 2145 partial void OnDateCalculatedChanging(System.Nullable<System.DateTime> value); 2146 partial void OnDateCalculatedChanged(); 2147 partial void OnDateFinishedChanging(System.Nullable<System.DateTime> value); 2148 partial void OnDateFinishedChanged(); 2149 partial void OnPriorityChanging(int value); 2150 partial void OnPriorityChanged(); 2151 partial void OnProjectIdChanging(System.Nullable<System.Guid> value); 2152 partial void OnProjectIdChanged(); 2153 partial void OnUserIdChanging(System.Nullable<System.Guid> value); 2154 partial void OnUserIdChanged(); 2155 partial void OnCoresNeededChanging(int value); 2156 partial void OnCoresNeededChanged(); 2157 partial void OnMemoryNeededChanging(int value); 2158 partial void OnMemoryNeededChanged(); 2159 #endregion 2160 2161 public Job() 2162 { 2163 this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources)); 2164 this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins)); 2165 this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs)); 2166 this._Client = default(EntityRef<Client>); 2167 this._Job1 = default(EntityRef<Job>); 2168 this._Project = default(EntityRef<Project>); 2169 OnCreated(); 2170 } 2171 2172 [Column(Storage="_JobId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)] 2173 public System.Guid JobId 2174 { 2175 get 2176 { 2177 return this._JobId; 2178 } 2179 set 2180 { 2181 if ((this._JobId != value)) 2182 { 2183 this.OnJobIdChanging(value); 2184 this.SendPropertyChanging(); 2185 this._JobId = value; 2186 this.SendPropertyChanged("JobId"); 2187 this.OnJobIdChanged(); 2188 } 2189 } 2190 } 2191 2192 [Column(Storage="_ParentJobId", DbType="UniqueIdentifier")] 2193 public System.Nullable<System.Guid> ParentJobId 2194 { 2195 get 2196 { 2197 return this._ParentJobId; 2198 } 2199 set 2200 { 2201 if ((this._ParentJobId != value)) 2202 { 2203 if (this._Job1.HasLoadedOrAssignedValue) 2204 { 2205 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); 2206 } 2207 this.OnParentJobIdChanging(value); 2208 this.SendPropertyChanging(); 2209 this._ParentJobId = value; 2210 this.SendPropertyChanged("ParentJobId"); 2211 this.OnParentJobIdChanged(); 2212 } 2213 } 2214 } 2215 2216 [Column(Storage="_JobState", DbType="VarChar(MAX)")] 2217 public string JobState 2218 { 2219 get 2220 { 2221 return this._JobState; 2222 } 2223 set 2224 { 2225 if ((this._JobState != value)) 2226 { 2227 this.OnJobStateChanging(value); 2228 this.SendPropertyChanging(); 2229 this._JobState = value; 2230 this.SendPropertyChanged("JobState"); 2231 this.OnJobStateChanged(); 2232 } 2233 } 2234 } 2235 2236 [Column(Storage="_ResourceId", DbType="UniqueIdentifier")] 2237 public System.Nullable<System.Guid> ResourceId 2238 { 2239 get 2240 { 2241 return this._ResourceId; 2242 } 2243 set 2244 { 2245 if ((this._ResourceId != value)) 2246 { 2247 if (this._Client.HasLoadedOrAssignedValue) 2248 { 2249 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); 2250 } 2251 this.OnResourceIdChanging(value); 2252 this.SendPropertyChanging(); 2253 this._ResourceId = value; 2254 this.SendPropertyChanged("ResourceId"); 2255 this.OnResourceIdChanged(); 2256 } 2257 } 2258 } 2259 2260 [Column(Storage="_Percentage", DbType="Float")] 2261 public System.Nullable<double> Percentage 2262 { 2263 get 2264 { 2265 return this._Percentage; 2266 } 2267 set 2268 { 2269 if ((this._Percentage != value)) 2270 { 2271 this.OnPercentageChanging(value); 2272 this.SendPropertyChanging(); 2273 this._Percentage = value; 2274 this.SendPropertyChanged("Percentage"); 2275 this.OnPercentageChanged(); 2276 } 2277 } 2278 } 2279 2280 [Column(Storage="_SerializedJob", DbType="VarBinary(MAX)", CanBeNull=true, UpdateCheck=UpdateCheck.Never)] 2281 public System.Data.Linq.Binary SerializedJob 2282 { 2283 get 2284 { 2285 return this._SerializedJob; 2286 } 2287 set 2288 { 2289 if ((this._SerializedJob != value)) 2290 { 2291 this.OnSerializedJobChanging(value); 2292 this.SendPropertyChanging(); 2293 this._SerializedJob = value; 2294 this.SendPropertyChanged("SerializedJob"); 2295 this.OnSerializedJobChanged(); 2296 } 2297 } 2298 } 2299 2300 [Column(Storage="_DateCreated", DbType="DateTime")] 2301 public System.Nullable<System.DateTime> DateCreated 2302 { 2303 get 2304 { 2305 return this._DateCreated; 2306 } 2307 set 2308 { 2309 if ((this._DateCreated != value)) 2310 { 2311 this.OnDateCreatedChanging(value); 2312 this.SendPropertyChanging(); 2313 this._DateCreated = value; 2314 this.SendPropertyChanged("DateCreated"); 2315 this.OnDateCreatedChanged(); 2316 } 2317 } 2318 } 2319 2320 [Column(Storage="_DateCalculated", DbType="DateTime")] 2321 public System.Nullable<System.DateTime> DateCalculated 2322 { 2323 get 2324 { 2325 return this._DateCalculated; 2326 } 2327 set 2328 { 2329 if ((this._DateCalculated != value)) 2330 { 2331 this.OnDateCalculatedChanging(value); 2332 this.SendPropertyChanging(); 2333 this._DateCalculated = value; 2334 this.SendPropertyChanged("DateCalculated"); 2335 this.OnDateCalculatedChanged(); 2336 } 2337 } 2338 } 2339 2340 [Column(Storage="_DateFinished", DbType="DateTime")] 2341 public System.Nullable<System.DateTime> DateFinished 2342 { 2343 get 2344 { 2345 return this._DateFinished; 2346 } 2347 set 2348 { 2349 if ((this._DateFinished != value)) 2350 { 2351 this.OnDateFinishedChanging(value); 2352 this.SendPropertyChanging(); 2353 this._DateFinished = value; 2354 this.SendPropertyChanged("DateFinished"); 2355 this.OnDateFinishedChanged(); 2356 } 2357 } 2358 } 2359 2360 [Column(Storage="_Priority", DbType="Int NOT NULL")] 2361 public int Priority 2362 { 2363 get 2364 { 2365 return this._Priority; 2366 } 2367 set 2368 { 2369 if ((this._Priority != value)) 2370 { 2371 this.OnPriorityChanging(value); 2372 this.SendPropertyChanging(); 2373 this._Priority = value; 2374 this.SendPropertyChanged("Priority"); 2375 this.OnPriorityChanged(); 2376 } 2377 } 2378 } 2379 2380 [Column(Storage="_ProjectId", DbType="UniqueIdentifier")] 2381 public System.Nullable<System.Guid> ProjectId 2382 { 2383 get 2384 { 2385 return this._ProjectId; 2386 } 2387 set 2388 { 2389 if ((this._ProjectId != value)) 2390 { 2391 if (this._Project.HasLoadedOrAssignedValue) 2392 { 2393 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); 2394 } 2395 this.OnProjectIdChanging(value); 2396 this.SendPropertyChanging(); 2397 this._ProjectId = value; 2398 this.SendPropertyChanged("ProjectId"); 2399 this.OnProjectIdChanged(); 2400 } 2401 } 2402 } 2403 2404 [Column(Storage="_UserId", DbType="UniqueIdentifier")] 2405 public System.Nullable<System.Guid> UserId 2406 { 2407 get 2408 { 2409 return this._UserId; 2410 } 2411 set 2412 { 2413 if ((this._UserId != value)) 2414 { 2415 this.OnUserIdChanging(value); 2416 this.SendPropertyChanging(); 2417 this._UserId = value; 2418 this.SendPropertyChanged("UserId"); 2419 this.OnUserIdChanged(); 2420 } 2421 } 2422 } 2423 2424 [Column(Storage="_CoresNeeded", DbType="Int NOT NULL")] 2425 public int CoresNeeded 2426 { 2427 get 2428 { 2429 return this._CoresNeeded; 2430 } 2431 set 2432 { 2433 if ((this._CoresNeeded != value)) 2434 { 2435 this.OnCoresNeededChanging(value); 2436 this.SendPropertyChanging(); 2437 this._CoresNeeded = value; 2438 this.SendPropertyChanged("CoresNeeded"); 2439 this.OnCoresNeededChanged(); 2440 } 2441 } 2442 } 2443 2444 [Column(Storage="_MemoryNeeded", DbType="Int NOT NULL")] 2445 public int MemoryNeeded 2446 { 2447 get 2448 { 2449 return this._MemoryNeeded; 2450 } 2451 set 2452 { 2453 if ((this._MemoryNeeded != value)) 2454 { 2455 this.OnMemoryNeededChanging(value); 2456 this.SendPropertyChanging(); 2457 this._MemoryNeeded = value; 2458 this.SendPropertyChanged("MemoryNeeded"); 2459 this.OnMemoryNeededChanged(); 2460 } 2461 } 2462 } 2463 2464 [Association(Name="Job_AssignedResource", Storage="_AssignedResources", ThisKey="JobId", OtherKey="JobId")] 2465 public EntitySet<AssignedResource> AssignedResources 2466 { 2467 get 2468 { 2469 return this._AssignedResources; 2470 } 2471 set 2472 { 2473 this._AssignedResources.Assign(value); 2474 } 2475 } 2476 2477 [Association(Name="Job_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="JobId", OtherKey="JobId")] 2478 public EntitySet<RequiredPlugin> RequiredPlugins 2479 { 2480 get 2481 { 2482 return this._RequiredPlugins; 2483 } 2484 set 2485 { 2486 this._RequiredPlugins.Assign(value); 2487 } 2488 } 2489 2490 [Association(Name="Job_Job", Storage="_Jobs", ThisKey="JobId", OtherKey="ParentJobId")] 2491 public EntitySet<Job> Jobs 2492 { 2493 get 2494 { 2495 return this._Jobs; 2496 } 2497 set 2498 { 2499 this._Jobs.Assign(value); 2500 } 2501 } 2502 2503 [Association(Name="Client_Job", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")] 2504 public Client Client 2505 { 2506 get 2507 { 2508 return this._Client.Entity; 2509 } 2510 set 2511 { 2512 Client previousValue = this._Client.Entity; 2513 if (((previousValue != value) 2514 || (this._Client.HasLoadedOrAssignedValue == false))) 2515 { 2516 this.SendPropertyChanging(); 2517 if ((previousValue != null)) 2518 { 2519 this._Client.Entity = null; 2520 previousValue.Jobs.Remove(this); 2521 } 2522 this._Client.Entity = value; 2523 if ((value != null)) 2524 { 2525 value.Jobs.Add(this); 2526 this._ResourceId = value.ResourceId; 2527 } 2528 else 2529 { 2530 this._ResourceId = default(Nullable<System.Guid>); 2531 } 2532 this.SendPropertyChanged("Client"); 2533 } 2534 } 2535 } 2536 2537 [Association(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)] 2538 public Job Job1 2539 { 2540 get 2541 { 2542 return this._Job1.Entity; 2543 } 2544 set 2545 { 2546 Job previousValue = this._Job1.Entity; 2547 if (((previousValue != value) 2548 || (this._Job1.HasLoadedOrAssignedValue == false))) 2549 { 2550 this.SendPropertyChanging(); 2551 if ((previousValue != null)) 2552 { 2553 this._Job1.Entity = null; 2554 previousValue.Jobs.Remove(this); 2555 } 2556 this._Job1.Entity = value; 2557 if ((value != null)) 2558 { 2559 value.Jobs.Add(this); 2560 this._ParentJobId = value.JobId; 2561 } 2562 else 2563 { 2564 this._ParentJobId = default(Nullable<System.Guid>); 2565 } 2566 this.SendPropertyChanged("Job1"); 2567 } 2568 } 2569 } 2570 2571 [Association(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="SET NULL")] 2572 public Project Project 2573 { 2574 get 2575 { 2576 return this._Project.Entity; 2577 } 2578 set 2579 { 2580 Project previousValue = this._Project.Entity; 2581 if (((previousValue != value) 2582 || (this._Project.HasLoadedOrAssignedValue == false))) 2583 { 2584 this.SendPropertyChanging(); 2585 if ((previousValue != null)) 2586 { 2587 this._Project.Entity = null; 2588 previousValue.Jobs.Remove(this); 2589 } 2590 this._Project.Entity = value; 2591 if ((value != null)) 2592 { 2593 value.Jobs.Add(this); 2594 this._ProjectId = value.ProjectId; 2595 } 2596 else 2597 { 2598 this._ProjectId = default(Nullable<System.Guid>); 2599 } 2600 this.SendPropertyChanged("Project"); 2601 } 2602 } 2603 } 2604 2605 public event PropertyChangingEventHandler PropertyChanging; 2606 2607 public event PropertyChangedEventHandler PropertyChanged; 2608 2609 protected virtual void SendPropertyChanging() 2610 { 2611 if ((this.PropertyChanging != null)) 2612 { 2613 this.PropertyChanging(this, emptyChangingEventArgs); 2614 } 2615 } 2616 2617 protected virtual void SendPropertyChanged(String propertyName) 2618 { 2619 if ((this.PropertyChanged != null)) 2620 { 2621 this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 2622 } 2623 } 2624 2625 private void attach_AssignedResources(AssignedResource entity) 2626 { 2627 this.SendPropertyChanging(); 2628 entity.Job = this; 2629 } 2630 2631 private void detach_AssignedResources(AssignedResource entity) 2632 { 2633 this.SendPropertyChanging(); 2634 entity.Job = null; 2635 } 2636 2637 private void attach_RequiredPlugins(RequiredPlugin entity) 2638 { 2639 this.SendPropertyChanging(); 2640 entity.Job = this; 2641 } 2642 2643 private void detach_RequiredPlugins(RequiredPlugin entity) 2644 { 2645 this.SendPropertyChanging(); 2646 entity.Job = null; 2647 } 2648 2649 private void attach_Jobs(Job entity) 2650 { 2651 this.SendPropertyChanging(); 2652 entity.Job1 = this; 2653 } 2654 2655 private void detach_Jobs(Job entity) 2656 { 2657 this.SendPropertyChanging(); 2658 entity.Job1 = null; 2659 } 2660 } 2661 2661 } 2662 2662 #pragma warning restore 1591 -
trunk/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/JobDao.cs
r3013 r3018 42 42 Job j = DtoToEntity(job.JobInfo, null); 43 43 j.SerializedJob = job.SerializedJobData; 44 foreach (Guid assignRessourceId in job.JobInfo.AssignedResourceIds) 45 j.AssignedResources.Add(new AssignedResource { ResourceId = assignRessourceId}); 44 46 Context.Jobs.InsertOnSubmit(j); 45 47 Context.SubmitChanges(); … … 70 72 select EntityToDto(j, null)).ToList(); 71 73 } 72 public IEnumerable<JobDto> FindFittingJobsForClient(State state, int freeCores, int freeMemory) { 73 return (from j in Context.Jobs 74 where j.JobState == Enum.GetName(typeof (State), State.offline) && 75 j.CoresNeeded <= freeCores && 76 j.MemoryNeeded <= freeMemory 77 select EntityToDto(j, null)).ToList(); 74 public IEnumerable<JobDto> FindFittingJobsForClient(State state, int freeCores, int freeMemory, Guid clientId) { 75 ClientGroupDao cgd = new ClientGroupDao(); 76 77 List<Guid> idList = new List<Guid>(cgd.FindAllGroupAndParentGroupIdsForClient(clientId)); 78 //Add myself too - enables jobs for one specific host! 79 idList.Add(clientId); 80 81 var q = (from ar in Context.AssignedResources 82 where ar.Job.JobState == Enum.GetName(typeof (State), State.offline) && 83 ar.Job.CoresNeeded <= freeCores && 84 ar.Job.MemoryNeeded <= freeMemory && 85 idList.Contains(ar.ResourceId) 86 orderby ar.Job.Priority descending 87 select EntityToDto(ar.Job, null)); 88 return q.ToList(); 78 89 79 90 }
Note: See TracChangeset
for help on using the changeset viewer.