Changeset 4623


Ignore:
Timestamp:
Nov 3, 2008, 9:32:00 AM (15 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1163: Set name of child bioassay when there is only one parent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/BioAssaySet.java

    r4517 r4623  
    749749   
    750750    // Everything is ok, create the new bioassay
    751     BioAssay ba = newBioAssay(parent.getDataCubeColumn(), Collections.singleton(parent));
    752     ba.setName(parent.getName());
    753     return ba;
     751    return newBioAssay(parent.getDataCubeColumn(), Collections.singleton(parent));
    754752  }
    755753 
     
    814812  /**
    815813    Create a new bioassay and link to the parents. Assume that all
    816     neccessary checks has been made by calling code.
     814    neccessary checks has been made by calling code. If the collections contains
     815    only a single parent, the name will be copied to the child.
    817816  */
    818817  private BioAssay newBioAssay(DataCubeColumn column, Collection<BioAssay> parents)
    819818  {
    820819    BioAssay ba = BioAssay.getNew(getDbControl(), this, column);
     820    int numParents = parents.size();
    821821   
    822822    // Add parents and raw parents to the new BioAssay
     
    825825    for (BioAssay parent : parents)
    826826    {
     827      if (numParents == 1) ba.setName(parent.getName());
    827828      baParents.add(parent.getData());
    828829      rawParents.addAll(parent.getData().getRawParents());
Note: See TracChangeset for help on using the changeset viewer.