- Timestamp:
- 01/25/11 17:34:47 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs
r5266 r5375 126 126 public static DT.PluginData ToDto(PluginData source) { 127 127 if (source == null) return null; 128 return new DT.PluginData { PluginId = source.PluginId, Data = source.Data.ToArray(), FileName = source.FileName };128 return new DT.PluginData { PluginId = source.PluginId, Data = source.Data.ToArray(), FileName = source.FileName, PluginDataId = source.PluginDataId }; 129 129 } 130 130 public static PluginData ToEntity(DT.PluginData source) { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs
r5156 r5375 90 90 orderby ar.Job.Priority descending 91 91 select Convert.ToDto(ar.Job); 92 return query ;92 return query.ToArray(); 93 93 } 94 94 } … … 100 100 orderby j.Priority descending 101 101 select Convert.ToDto(j); 102 return query.Union(GetWaitingParentJobs(slave.Id)).OrderByDescending(x => x.Priority).ToArray(); 102 var waitingJobs = query.ToArray(); 103 var waitingParentJobs = GetWaitingParentJobs(slave.Id); 104 return waitingJobs.Union(waitingParentJobs).OrderByDescending(x => x.Priority); 103 105 } 104 106 } … … 322 324 public Guid AddSlaveGroup(DT.SlaveGroup dto) { 323 325 using (var db = CreateContext()) { 326 if (dto.Id == Guid.Empty) 327 dto.Id = Guid.NewGuid(); 324 328 var entity = Convert.ToEntity(dto); 325 329 db.Resources.InsertOnSubmit(entity); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml
r5266 r5375 15 15 <Column Name="Version" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" /> 16 16 <Association Name="Plugin_RequiredPlugin" Member="RequiredPlugins" ThisKey="PluginId" OtherKey="PluginId" Type="RequiredPlugin" /> 17 <Association Name="Plugin_PluginData" Member="PluginData" ThisKey="PluginId" OtherKey="PluginId" Type="PluginData" Cardinality="One"/>17 <Association Name="Plugin_PluginData" Member="PluginData" ThisKey="PluginId" OtherKey="PluginId" Type="PluginData" /> 18 18 </Type> 19 19 </Table> … … 29 29 <Table Name="dbo.Resource" Member="Resources"> 30 30 <Type Name="Resource" InheritanceCode="RESOURCE"> 31 <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />31 <Column Name="ResourceId" AutoSync="OnInsert" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" /> 32 32 <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" /> 33 33 <Column Name="ResourceType" Type="System.String" CanBeNull="false" IsDiscriminator="true" /> … … 112 112 <Column Name="Data" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX) NOT NULL" CanBeNull="false" UpdateCheck="Never" /> 113 113 <Column Name="FileName" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" /> 114 <Column Name="PluginDataId" Type="System.Int32" DbType="Int IDENTITY(1,1)" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> 114 115 <Association Name="Plugin_PluginData" Member="Plugin" ThisKey="PluginId" OtherKey="PluginId" Type="Plugin" IsForeignKey="true" /> 115 116 </Type> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout
r5266 r5375 124 124 </nestedChildShapes> 125 125 </classShape> 126 <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11. 375, 5.5, 2, 1.3862939453124996">126 <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11.625, 5.5, 2, 1.5785953776041666"> 127 127 <DataClassMoniker Name="/HiveDataContext/PluginData" /> 128 128 <nestedChildShapes> 129 <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11. 39, 5.9600000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />129 <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11.64, 5.9600000000000009, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 130 130 </nestedChildShapes> 131 131 </classShape> 132 <associationConnector edgePoints="[(11 : 6.19314697265625); (11. 375 : 6.19314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">132 <associationConnector edgePoints="[(11 : 6.19314697265625); (11.625 : 6.19314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 133 133 <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" /> 134 134 <nodes> … … 137 137 </nodes> 138 138 </associationConnector> 139 <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom=" Algorithm" fixedTo="Algorithm">139 <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 140 140 <AssociationMoniker Name="/HiveDataContext/Job/Job_JobData" /> 141 141 <nodes> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs
r5266 r5375 55 55 partial void UpdateJobData(JobData instance); 56 56 partial void DeleteJobData(JobData instance); 57 partial void InsertPluginData(PluginData instance); 58 partial void UpdatePluginData(PluginData instance); 59 partial void DeletePluginData(PluginData instance); 57 60 #endregion 58 61 … … 360 363 private EntitySet<RequiredPlugin> _RequiredPlugins; 361 364 365 private EntitySet<PluginData> _PluginData; 366 362 367 #region Extensibility Method Definitions 363 368 partial void OnLoaded(); … … 375 380 { 376 381 this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins)); 382 this._PluginData = new EntitySet<PluginData>(new Action<PluginData>(this.attach_PluginData), new Action<PluginData>(this.detach_PluginData)); 377 383 OnCreated(); 378 384 } … … 451 457 } 452 458 459 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_PluginData", Storage="_PluginData", ThisKey="PluginId", OtherKey="PluginId")] 460 public EntitySet<PluginData> PluginData 461 { 462 get 463 { 464 return this._PluginData; 465 } 466 set 467 { 468 this._PluginData.Assign(value); 469 } 470 } 471 453 472 public event PropertyChangingEventHandler PropertyChanging; 454 473 … … 478 497 479 498 private void detach_RequiredPlugins(RequiredPlugin entity) 499 { 500 this.SendPropertyChanging(); 501 entity.Plugin = null; 502 } 503 504 private void attach_PluginData(PluginData entity) 505 { 506 this.SendPropertyChanging(); 507 entity.Plugin = this; 508 } 509 510 private void detach_PluginData(PluginData entity) 480 511 { 481 512 this.SendPropertyChanging(); … … 724 755 } 725 756 726 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true , IsDbGenerated=true)]757 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)] 727 758 public System.Guid ResourceId 728 759 { … … 2386 2417 2387 2418 [global::System.Data.Linq.Mapping.TableAttribute(Name="")] 2388 public partial class PluginData 2419 public partial class PluginData : INotifyPropertyChanging, INotifyPropertyChanged 2389 2420 { 2390 2421 2422 private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); 2423 2391 2424 private System.Guid _PluginId; 2392 2425 … … 2395 2428 private string _FileName; 2396 2429 2430 private int _PluginDataId; 2431 2432 private EntityRef<Plugin> _Plugin; 2433 2434 #region Extensibility Method Definitions 2435 partial void OnLoaded(); 2436 partial void OnValidate(System.Data.Linq.ChangeAction action); 2437 partial void OnCreated(); 2438 partial void OnPluginIdChanging(System.Guid value); 2439 partial void OnPluginIdChanged(); 2440 partial void OnDataChanging(System.Data.Linq.Binary value); 2441 partial void OnDataChanged(); 2442 partial void OnFileNameChanging(string value); 2443 partial void OnFileNameChanged(); 2444 partial void OnPluginDataIdChanging(int value); 2445 partial void OnPluginDataIdChanged(); 2446 #endregion 2447 2397 2448 public PluginData() 2398 2449 { 2450 this._Plugin = default(EntityRef<Plugin>); 2451 OnCreated(); 2399 2452 } 2400 2453 … … 2410 2463 if ((this._PluginId != value)) 2411 2464 { 2465 if (this._Plugin.HasLoadedOrAssignedValue) 2466 { 2467 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); 2468 } 2469 this.OnPluginIdChanging(value); 2470 this.SendPropertyChanging(); 2412 2471 this._PluginId = value; 2472 this.SendPropertyChanged("PluginId"); 2473 this.OnPluginIdChanged(); 2413 2474 } 2414 2475 } … … 2426 2487 if ((this._Data != value)) 2427 2488 { 2489 this.OnDataChanging(value); 2490 this.SendPropertyChanging(); 2428 2491 this._Data = value; 2492 this.SendPropertyChanged("Data"); 2493 this.OnDataChanged(); 2429 2494 } 2430 2495 } … … 2442 2507 if ((this._FileName != value)) 2443 2508 { 2509 this.OnFileNameChanging(value); 2510 this.SendPropertyChanging(); 2444 2511 this._FileName = value; 2445 } 2512 this.SendPropertyChanged("FileName"); 2513 this.OnFileNameChanged(); 2514 } 2515 } 2516 } 2517 2518 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginDataId", AutoSync=AutoSync.OnInsert, DbType="Int IDENTITY(1,1)", IsPrimaryKey=true, IsDbGenerated=true)] 2519 public int PluginDataId 2520 { 2521 get 2522 { 2523 return this._PluginDataId; 2524 } 2525 set 2526 { 2527 if ((this._PluginDataId != value)) 2528 { 2529 this.OnPluginDataIdChanging(value); 2530 this.SendPropertyChanging(); 2531 this._PluginDataId = value; 2532 this.SendPropertyChanged("PluginDataId"); 2533 this.OnPluginDataIdChanged(); 2534 } 2535 } 2536 } 2537 2538 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_PluginData", Storage="_Plugin", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true)] 2539 public Plugin Plugin 2540 { 2541 get 2542 { 2543 return this._Plugin.Entity; 2544 } 2545 set 2546 { 2547 Plugin previousValue = this._Plugin.Entity; 2548 if (((previousValue != value) 2549 || (this._Plugin.HasLoadedOrAssignedValue == false))) 2550 { 2551 this.SendPropertyChanging(); 2552 if ((previousValue != null)) 2553 { 2554 this._Plugin.Entity = null; 2555 previousValue.PluginData.Remove(this); 2556 } 2557 this._Plugin.Entity = value; 2558 if ((value != null)) 2559 { 2560 value.PluginData.Add(this); 2561 this._PluginId = value.PluginId; 2562 } 2563 else 2564 { 2565 this._PluginId = default(System.Guid); 2566 } 2567 this.SendPropertyChanged("Plugin"); 2568 } 2569 } 2570 } 2571 2572 public event PropertyChangingEventHandler PropertyChanging; 2573 2574 public event PropertyChangedEventHandler PropertyChanged; 2575 2576 protected virtual void SendPropertyChanging() 2577 { 2578 if ((this.PropertyChanging != null)) 2579 { 2580 this.PropertyChanging(this, emptyChangingEventArgs); 2581 } 2582 } 2583 2584 protected virtual void SendPropertyChanged(String propertyName) 2585 { 2586 if ((this.PropertyChanged != null)) 2587 { 2588 this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 2446 2589 } 2447 2590 }
Note: See TracChangeset
for help on using the changeset viewer.