Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/29/09 14:35:46 (15 years ago)
Author:
svonolfe
Message:

Updated Job adapter (#372)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/JobAdapter.cs

    r1952 r1955  
    355355
    356356    protected override void doUpdate(Job obj) {
    357       ProjectAdapter.Update(obj.Project);
    358       ClientAdapter.Update(obj.Client);
    359       Update(obj.ParentJob);
    360 
    361       base.doUpdate(obj);
    362 
    363       //update relationships
    364       List<Guid> relationships =
    365         new List<Guid>();
    366       foreach (HivePluginInfo pluginInfo in obj.PluginsNeeded) {
    367         //first check if pluginInfo already exists in the db
    368         HivePluginInfo found = PluginInfoAdapter.GetByNameVersionBuilddate(
    369           pluginInfo.Name, pluginInfo.Version, pluginInfo.BuildDate);
    370         if (found != null) {
    371           pluginInfo.Id = found.Id;
    372         }
    373 
    374         PluginInfoAdapter.Update(pluginInfo);
    375         relationships.Add(pluginInfo.Id);
    376       }
    377 
    378       PluginsManyToManyRelationHelper.UpdateRelationships(
    379         obj.Id, relationships);
    380 
    381       AssignedManyToManyRelationHelper.UpdateRelationships(
    382         obj.Id, obj.AssignedResourceIds);
     357      if (obj != null) {
     358        ProjectAdapter.Update(obj.Project);
     359        ClientAdapter.Update(obj.Client);
     360        Update(obj.ParentJob);
     361
     362        base.doUpdate(obj);
     363
     364        //update relationships
     365        List<Guid> relationships =
     366          new List<Guid>();
     367        foreach (HivePluginInfo pluginInfo in obj.PluginsNeeded) {
     368          //first check if pluginInfo already exists in the db
     369          HivePluginInfo found = PluginInfoAdapter.GetByNameVersionBuilddate(
     370            pluginInfo.Name, pluginInfo.Version, pluginInfo.BuildDate);
     371          if (found != null) {
     372            pluginInfo.Id = found.Id;
     373          }
     374
     375          PluginInfoAdapter.Update(pluginInfo);
     376          relationships.Add(pluginInfo.Id);
     377        }
     378
     379        PluginsManyToManyRelationHelper.UpdateRelationships(
     380          obj.Id, relationships);
     381
     382        AssignedManyToManyRelationHelper.UpdateRelationships(
     383          obj.Id, obj.AssignedResourceIds);
     384      }
    383385    }
    384386
Note: See TracChangeset for help on using the changeset viewer.