Changeset 5523


Ignore:
Timestamp:
Dec 2, 2010, 2:35:04 PM (11 years ago)
Author:
Nicklas Nordborg
Message:

References #1536: Bioplate events (take 2)

Implemented in the core and data layer as in version 2 of the UML diagram. A test case has been provided. Next step is adding things in the web gui to make it possible to see information about events.

Location:
trunk
Files:
7 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/config/dist/ehcache.xml

    r5452 r5523  
    6363  />
    6464  <cache
     65    name="net.sf.basedb.core.data.BioPlateEventTypeData"
     66    maxElementsInMemory="100"
     67    eternal="false"
     68    timeToIdleSeconds="3600"
     69    timeToLiveSeconds="3600"
     70    overflowToDisk="false"
     71  />
     72  <cache
    6573    name="net.sf.basedb.core.data.BioPlateTypeData"
    6674    maxElementsInMemory="100"
  • trunk/config/dist/hibernate.cfg.xml

    r5476 r5523  
    6363    />
    6464    <class-cache
     65      class="net.sf.basedb.core.data.BioPlateEventTypeData"
     66      usage="nonstrict-read-write"
     67    />
     68    <class-cache
    6569      class="net.sf.basedb.core.data.BioPlateTypeData"
    6670      usage="nonstrict-read-write"
  • trunk/src/clients/web/net/sf/basedb/clients/web/PermissionUtil.java

    r5452 r5523  
    197197        {
    198198          Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT, Item.LABELEDEXTRACT, Item.LABEL,
    199           Item.BIOMATERIALLIST, Item.BIOPLATE, Item.BIOPLATETYPE,
     199          Item.BIOMATERIALLIST, Item.BIOPLATE, Item.BIOPLATETYPE, Item.BIOPLATEEVENT, Item.BIOPLATEEVENTTYPE,
    200200          Item.HYBRIDIZATION, Item.SCAN, Item.RAWBIOASSAY, Item.EXPERIMENT, Item.FORMULA
    201201        })
  • trunk/src/core/common-queries.xml

    r5518 r5523  
    38333833  </query>
    38343834
     3835  <query id="CLEAR_PARTICIPANT_ON_BIOMATERIALEVENTS_FOR_BIOPLATEEVENT" type="HQL">
     3836    <sql>
     3837      UPDATE BioMaterialEventData bme
     3838      SET bme.bioPlateEventParticipant = null
     3839      WHERE bme.bioPlateEventParticipant =ANY (
     3840        SELECT bep FROM BioPlateEventParticipantData bep
     3841        WHERE bep.event = :event
     3842      )
     3843    </sql>
     3844    <description>
     3845      An HQL update-query that clears the references to a given
     3846      bioplate event on all biomaterial events that links to it
     3847      (via the bioplate event participant table).
     3848    </description>
     3849  </query>
     3850
     3851
     3852  <query id="CLEAR_PARTICIPANT_ON_BIOMATERIALEVENTS_FOR_PARTICIPANT" type="HQL">
     3853    <sql>
     3854      UPDATE BioMaterialEventData bme
     3855      SET bme.bioPlateEventParticipant = null
     3856      WHERE bme.bioPlateEventParticipant = :participant
     3857    </sql>
     3858    <description>
     3859      An HQL update-query that clears the references to a given bioplate
     3860      event participant on all related biomaterial events.
     3861    </description>
     3862  </query>
     3863
    38353864</predefined-queries>
  • trunk/src/core/net/sf/basedb/core/BioMaterialEvent.java

    r5452 r5523  
    7575    throws BaseException
    7676  {
     77    return getNew(dc, bioMaterial, null);
     78  }
     79 
     80  /**
     81    Create a new <code>BioMaterialEvent</code> of the {@link Type#OTHER} type
     82    that is linked with a master {@link BioPlateEventParticipant}. If a master
     83    bioplate event is used it must be a new event that has not yet been saved to the
     84    database.
     85 
     86    @param dc The <code>DbControl</code> which will be used for
     87      permission checking and database access
     88    @param bioMaterial The affected biomaterial
     89    @param master The master bioplate event or null
     90    @return The new <code>BioMaterialEvent</code> item
     91    @throws BaseException If there is an error
     92    @since 2.17
     93  */
     94  public static BioMaterialEvent getNew(DbControl dc, MeasuredBioMaterial bioMaterial, BioPlateEventParticipant master)
     95    throws BaseException
     96  {
    7797    BioMaterialEvent bme = dc.newItem(BioMaterialEvent.class);
    7898    bme.setBioMaterial(bioMaterial);
    79     bme.getData().setEntryDate(new Date());
    80     bme.getData().setEventDate(new Date());
    8199    bme.getData().setEventType(Type.OTHER.getValue());
    82     org.hibernate.Session session = dc.getHibernateSession();
    83     SessionControl sc = dc.getSessionControl();
    84     bme.getData().setUser(HibernateUtil.loadData(session, UserData.class, sc.getLoggedInUserId()));
     100    if (master != null)
     101    {
     102      if (master.isInDatabase())
     103      {
     104        throw new PermissionDeniedException("Must use a new bioplate event: "+master);
     105      }
     106      master.getEvent().synchronizeProperties(bme.getData(), master.getData());
     107    }
     108    else
     109    {
     110      bme.getData().setEntryDate(new Date());
     111      bme.getData().setEventDate(new Date());
     112      org.hibernate.Session session = dc.getHibernateSession();
     113      SessionControl sc = dc.getSessionControl();
     114      bme.getData().setUser(HibernateUtil.loadData(session, UserData.class, sc.getLoggedInUserId()));
     115    }
    85116    return bme;
    86117  }
     118
    87119 
    88120  /**
     
    92124      permission checking and database access
    93125    @param bioMaterial The biomaterial that was created.
     126    @param master The master bioplate event or null
    94127    @return The new <code>BioMaterialEvent</code> item
    95128    @throws BaseException If there is an error
    96   */
    97   static BioMaterialEvent getNewCreationEvent(DbControl dc, MeasuredBioMaterial bioMaterial)
     129    @since 2.17
     130  */
     131  static BioMaterialEvent getNewCreationEvent(DbControl dc, MeasuredBioMaterial bioMaterial, BioPlateEventParticipant master)
    98132    throws BaseException
    99133  {
    100134    BioMaterialEvent bme = dc.newItem(BioMaterialEvent.class);
    101135    bme.setBioMaterial(bioMaterial);
    102     bme.getData().setEntryDate(new Date());
    103     bme.getData().setEventDate(new Date());
    104136    bme.getData().setEventType(Type.CREATION.getValue());
    105     org.hibernate.Session session = dc.getHibernateSession();
    106     SessionControl sc = dc.getSessionControl();
    107     bme.getData().setUser(HibernateUtil.loadData(session, UserData.class, sc.getLoggedInUserId()));
     137    if (master != null)
     138    {
     139      if (master.isInDatabase())
     140      {
     141        throw new PermissionDeniedException("Must use a new bioplate event: "+master);
     142      }
     143      master.getEvent().synchronizeProperties(bme.getData(), master.getData());
     144    }
     145    else
     146    {
     147      bme.getData().setEntryDate(new Date());
     148      bme.getData().setEventDate(new Date());
     149      org.hibernate.Session session = dc.getHibernateSession();
     150      SessionControl sc = dc.getSessionControl();
     151      bme.getData().setUser(HibernateUtil.loadData(session, UserData.class, sc.getLoggedInUserId()));
     152    }
    108153    return bme;
    109154  }
     
    121166    throws BaseException
    122167  {
     168    return getNewHybridizationEvent(dc, hybridization, null);
     169  }
     170
     171 
     172  /**
     173    Create a new <code>BioMaterialEvent</code> of the {@link Type#HYBRIDIZATION}
     174    type.
     175    @param dc The <code>DbControl</code> which will be used for
     176      permission checking and database access
     177    @param hybridization The hybridization that was created.
     178    @param master The master bioplate event or null
     179    @return The new <code>BioMaterialEvent</code> item
     180    @throws BaseException If there is an error
     181  */
     182  static BioMaterialEvent getNewHybridizationEvent(DbControl dc, Hybridization hybridization, BioPlateEventParticipant master)
     183    throws BaseException
     184  {
    123185    BioMaterialEvent bme = dc.newItem(BioMaterialEvent.class);
    124186    bme.setHybridization(hybridization);
    125     bme.getData().setEntryDate(new Date());
    126     bme.getData().setEventDate(new Date());
    127187    bme.getData().setEventType(Type.HYBRIDIZATION.getValue());
    128     org.hibernate.Session session = dc.getHibernateSession();
    129     SessionControl sc = dc.getSessionControl();
    130     bme.getData().setUser(HibernateUtil.loadData(session, UserData.class, sc.getLoggedInUserId()));
     188    if (master != null)
     189    {
     190      if (master.isInDatabase())
     191      {
     192        throw new PermissionDeniedException("Must use a new bioplate event: "+master);
     193      }
     194      master.getEvent().synchronizeProperties(bme.getData(), master.getData());
     195    }
     196    else
     197    {
     198      bme.getData().setEntryDate(new Date());
     199      bme.getData().setEventDate(new Date());
     200      org.hibernate.Session session = dc.getHibernateSession();
     201      SessionControl sc = dc.getSessionControl();
     202      bme.getData().setUser(HibernateUtil.loadData(session, UserData.class, sc.getLoggedInUserId()));
     203    }
    131204    return bme;
    132205  }
     
    253326      }
    254327    }
     328    // Deny write permission if there is a master bioplate event
     329    if (getData().getBioPlateEventParticipant() != null)
     330    {
     331      denied |= Permission.deny(Permission.WRITE);
     332    }
    255333    super.initPermissions(granted, denied);
    256334  }
     
    264342  {
    265343    super.setProjectDefaults(activeProject);
    266     if (getEventType() == Type.OTHER) return;
     344    if (getEventType() == Type.OTHER || !hasPermission(Permission.WRITE)) return;
    267345   
    268346    Project.Default defaultProtocolType = null;
     
    401479    getData().setHybridization(hybridization.getData());
    402480  }
     481
     482  /**
     483    Get the bioplate event participant that is the master of this event.
     484    If this event has a master event, many properties such as event date,
     485    protocol, etc. must be set on the master event.
     486   
     487    @return A bioplate event participant or null
     488    @since 2.17
     489  */
     490  public BioPlateEventParticipant getBioPlateEventParticipant()
     491  {
     492    return getDbControl().getItem(BioPlateEventParticipant.class, getData().getBioPlateEventParticipant());
     493  }
     494
    403495
    404496  /**
     
    834926    throws PermissionDeniedException, InvalidDataException
    835927  {
    836     checkPermission(Permission.WRITE);
     928    checkPermission(Permission.RESTRICTED_WRITE);
    837929    getData().setComment(StringUtil.setNullableString(comment, "comment", MAX_COMMENT_LENGTH));
    838930  }
  • trunk/src/core/net/sf/basedb/core/BioPlate.java

    r5456 r5523  
    398398  }
    399399 
     400  /**
     401    Get a query returning events that this plate has been a part of.
     402  */
     403  public ItemQuery<BioPlateEvent> getEvents()
     404  {
     405    ItemQuery<BioPlateEvent> query = BioPlateEvent.getQuery();
     406    query.joinPermanent(Hql.innerJoin("participants", Item.BIOPLATEEVENTPARTICIPANT.getAlias()));
     407    query.restrictPermanent(
     408        Restrictions.eq(
     409          Hql.property(Item.BIOPLATEEVENTPARTICIPANT.getAlias(), "bioPlate"),
     410          Hql.entity(this)
     411        )
     412      );
     413   
     414    return query;
     415  }
    400416
    401417}
  • trunk/src/core/net/sf/basedb/core/Extract.java

    r5357 r5523  
    6363    throws BaseException
    6464  {
     65    return getNew(dc, null);
     66  }
     67
     68  /**
     69    Create a new <code>Extract</code> item as part
     70    of a master bioplate event.
     71 
     72    @param dc The <code>DbControl</code> which will be used for
     73      permission checking and database access
     74    @param master The master bioplate event participant or null
     75    @return The new <code>Extract</code> item
     76    @throws BaseException If there is an error
     77    @since 2.17
     78  */
     79  public static Extract getNew(DbControl dc, BioPlateEventParticipant master)
     80    throws BaseException
     81  {
    6582    Extract e = dc.newItem(Extract.class);
    6683    e.setName("New extract");
     84    e.setBioPlateEventParticipant(master);
    6785    return e;
    6886  }
    6987
     88 
    7089  /**
    7190    Get an <code>Extract</code> item when you know the id.
     
    235254    throws PermissionDeniedException, BaseException
    236255  {
    237     LabeledExtract le = LabeledExtract.getNew(getDbControl(), label);
     256    return newLabeledExtract(label, usedQuantity, null);
     257  }
     258
     259  /**
     260    Create a new {@link LabeledExtract} from this extract as
     261    part of a master bioplate event.
     262    @param label The labeling compound used to label the extract
     263    @param usedQuantity The quantity used from this extract or null
     264      if not known
     265    @param master The master bioplate event participant or null
     266    @return The new <code>LabeledExtract</code> item
     267    @throws PermissionDeniedException If the logged in user doesn't have
     268      use permission for this extract or use permission for the label
     269    @throws BaseException If there is another error
     270    @since 2.17
     271  */
     272  public LabeledExtract newLabeledExtract(Label label, Float usedQuantity, BioPlateEventParticipant master)
     273    throws PermissionDeniedException, BaseException
     274  {
     275    LabeledExtract le = LabeledExtract.getNew(getDbControl(), label, master);
    238276    le.setExtract(this, usedQuantity);
    239277    return le;
    240278  }
    241279
     280 
    242281  /**
    243282    Get a query that returns all labeled extracts created from this extract.
  • trunk/src/core/net/sf/basedb/core/Install.java

    r5456 r5523  
    2525package net.sf.basedb.core;
    2626
     27import net.sf.basedb.core.data.BioPlateEventTypeData;
    2728import net.sf.basedb.core.data.BioPlateTypeData;
    2829import net.sf.basedb.core.data.ColoringData;
     
    114115    method.
    115116  */
    116   public static final int NEW_SCHEMA_VERSION = Integer.valueOf(88).intValue();
     117  public static final int NEW_SCHEMA_VERSION = Integer.valueOf(89).intValue();
    117118 
    118119  public static synchronized void createTables(boolean update, final ProgressReporter progress)
     
    346347      createRoleKey(Item.BIOPLATE, "Bio plates", "Gives access to bio plates", users_create);
    347348      createRoleKey(Item.BIOPLATETYPE, "Bio plate types", "Gives access to bio plate types", guests_use_power_users_all);
     349      createRoleKey(Item.BIOPLATEEVENT, "Bio plate events", "Gives access to bio plate events", users_create);
     350      createRoleKey(Item.BIOPLATEEVENTTYPE, "Bio plate event types", "Gives access to bio plate event types", guests_use_administrators_all);
    348351      createRoleKey(Item.BIOMATERIALLIST, "Biomaterial lists", "Gives access to biomaterial lists", users_create);
    349352 
     
    580583        plate1536, 1, plate1536, 1, null, rootUser, keyEveryoneUse);
    581584 
    582       // Bio plate types
     585      // Bio plate types and event types
    583586      progressStep++;
    584587      if (progress != null) progress.display((int)(progressStep*progress_factor), "--Creating bioplate types...");
     
    592595        createBioPlateType("Labeled extract reaction plate", "A generic reaction plate for labeled extracts.",
    593596            Item.LABELEDEXTRACT, BioWell.LockMode.LOCKED_AFTER_ADD);
     597     
     598      BioPlateEventTypeData genericEvent = createBioPlateEventType("Generic", BioPlateEventType.GENERIC,
     599          "An event that does something unspecified to the participating bioplates. Use the " +
     600          "description to provide more information. It is recommended that 'other'-type " +
     601          "biomaterial events are created for each biomaterial that is affected.");
     602      BioPlateEventTypeData placeOnPlateEvent = createBioPlateEventType("Place on plate", BioPlateEventType.PLACE_ON_PLATE,
     603          "An event that places biomaterial on one or more bioplates but doens't otherwise manipulate it. " +
     604          "It is recommended that 'other'-type biomaterial events are created for each biomaterial that " +
     605          "is placed.");
     606      BioPlateEventTypeData moveEvent = createBioPlateEventType("Move", BioPlateEventType.MOVE,
     607          "An event that moves biomaterial from one plate to another plate but doesn't otherwise " +
     608          "manipulate it. It is recommended that 'other'-type biomaterial events are created for " +
     609          "each biomaterial that is moved. The biomaterial events should be linked with the destination " +
     610          "plate.");
     611      BioPlateEventTypeData createEvent = createBioPlateEventType("Create", BioPlateEventType.CREATE_BIOMATERIAL,
     612          "An event that creates child biomaterial. It is recommended that the creation event is " +
     613          "linked with the destination plate.");
    594614     
    595615      // Labels
     
    18321852    }
    18331853    return pt;
     1854  }
     1855
     1856  /**
     1857    Create a {@link BioPlateEventType}.
     1858  */
     1859  private static BioPlateEventTypeData createBioPlateEventType(String name, String systemId,
     1860    String description)
     1861    throws BaseException
     1862  {
     1863   
     1864    int id = SystemItems.getId(systemId);
     1865    org.hibernate.Transaction tx = null;
     1866    BioPlateEventTypeData eventType = null;
     1867    try
     1868    {
     1869      tx = HibernateUtil.newTransaction(session);
     1870      if (id != 0)
     1871      {
     1872        eventType = HibernateUtil.loadData(session, BioPlateEventTypeData.class, id);
     1873      }
     1874      if (eventType != null)
     1875      {
     1876        log.info("createBioPlateEventType: EXISTS [SYSTEM ID="+systemId+"; name="+name+"]");
     1877        HibernateUtil.commit(tx);
     1878      }
     1879      else
     1880      {
     1881        eventType = new BioPlateEventTypeData();
     1882        eventType.setName(name);
     1883        eventType.setDescription(description);
     1884        eventType.setSystemId(systemId);
     1885        HibernateUtil.saveData(session, eventType);
     1886        HibernateUtil.commit(tx);
     1887        SystemItems.add(eventType);
     1888        log.info("createBioPlateEventType: OK [SYSTEM ID="+systemId+"; name="+name+"]");
     1889      }
     1890    }
     1891    catch (BaseException ex)
     1892    {
     1893      if(tx != null) HibernateUtil.rollback(tx);
     1894      log.error("createBioPlateEventType: FAILED [SYSTEM ID="+systemId+"; name="+name+"]", ex);
     1895      throw ex;
     1896    }
     1897    return eventType;
    18341898  }
    18351899
  • trunk/src/core/net/sf/basedb/core/Item.java

    r5452 r5523  
    325325    The item is a {@link BioPlate}
    326326   */
    327   BIOPLATE(207, "Bio plate", "bpl", BioPlate.class, BioPlateData.class, DefinedPermissions.shareable,
     327  BIOPLATE(207, "Bioplate", "bpl", BioPlate.class, BioPlateData.class, DefinedPermissions.shareable,
    328328      460),
    329329
     
    331331    The item is a {@link BioWell}
    332332  */
    333   BIOWELL(208, "Bio well", "bwl", BioWell.class, BioWellData.class, null,
     333  BIOWELL(208, "Biowell", "bwl", BioWell.class, BioWellData.class, null,
    334334      470),
    335335     
     
    344344    @since 2.16
    345345   */
    346   BIOPLATETYPE(210, "Bio plate type", "bpt", BioPlateType.class, BioPlateTypeData.class,
     346  BIOPLATETYPE(210, "Bioplate type", "bpt", BioPlateType.class, BioPlateTypeData.class,
    347347      DefinedPermissions.basic, 490),
    348348
     349  /**
     350    The item is a {@link BioPlateEvent}
     351    @since 2.17
     352  */
     353  BIOPLATEEVENT(211, "Bioplate event", "bpe", BioPlateEvent.class, BioPlateEventData.class,
     354    DefinedPermissions.shareable, 465),
     355
     356  /**
     357    The item is a {@link BioPlateEventParticipant}
     358    @since 2.17
     359  */
     360  BIOPLATEEVENTPARTICIPANT(212, "Bioplate event participant", "bpp", BioPlateEventParticipant.class, BioPlateEventParticipantData.class,
     361    null, 466),
     362 
     363  /**
     364    The item is a {@link BioPlateEventType}
     365    @since 2.17
     366  */
     367  BIOPLATEEVENTTYPE(213, "Bioplate event type", "bet", BioPlateEventType.class, BioPlateEventTypeData.class,
     368    DefinedPermissions.basic, 467),
     369
     370   
    349371  /**
    350372    The item is a {@link PlateGeometry}.
  • trunk/src/core/net/sf/basedb/core/LabeledExtract.java

    r5357 r5523  
    6464    throws BaseException
    6565  {
     66    return getNew(dc, label, null);
     67  }
     68
     69  /**
     70    Create a new <code>LabeledExtract</code> item as part
     71    of a master bioplate event.
     72 
     73    @param dc The <code>DbControl</code> which will be used for
     74      permission checking and database access
     75    @param label The labeling compound used for labeling the extract
     76    @param master The master bioplate event participant or null
     77    @return The new <code>LabeledExtract</code> item
     78    @throws BaseException If there is an error
     79    @since 2.17
     80  */
     81  public static LabeledExtract getNew(DbControl dc, Label label, BioPlateEventParticipant master)
     82    throws BaseException
     83  {
    6684    LabeledExtract le = dc.newItem(LabeledExtract.class);
    6785    le.setName("New labeled extract");
    6886    le.setLabel(label);
     87    le.setBioPlateEventParticipant(master);
    6988    return le;
    7089  }
    71 
     90 
    7291  /**
    7392    Get a <code>LabeledExtract</code> item when you know the id.
  • trunk/src/core/net/sf/basedb/core/MeasuredBioMaterial.java

    r5459 r5523  
    5858{
    5959
     60  private BioPlateEventParticipant bioPlateEventParticipant;
    6061  private BioMaterialEvent creationEvent;
    6162
     
    182183      if (!isInDatabase())
    183184      {
    184         creationEvent = BioMaterialEvent.getNewCreationEvent(dc, this);
     185        creationEvent = BioMaterialEvent.getNewCreationEvent(dc, this, bioPlateEventParticipant);
    185186      }
    186187      else
     
    190191    }
    191192    return creationEvent;
     193  }
     194 
     195  void setBioPlateEventParticipant(BioPlateEventParticipant bioPlateEventParticipant)
     196  {
     197    this.bioPlateEventParticipant = bioPlateEventParticipant;
    192198  }
    193199 
     
    312318  }
    313319
     320  /**
     321    Create a new event for this biomaterial that is part of a
     322    master bioplate event.
     323    @return a {@link net.sf.basedb.core.BioMaterialEvent} object.
     324    @throws PermissionDeniedException If the logged in user doesn't have
     325      use permission for this biomaterial
     326    @throws BaseException If there is another error
     327    @since 2.17
     328  */
     329  public BioMaterialEvent newEvent(BioPlateEventParticipant master)
     330    throws PermissionDeniedException, BaseException
     331  {
     332    return BioMaterialEvent.getNew(getDbControl(), this, master);
     333  }
     334 
    314335  /**
    315336    Get a query that returns all events for this biomaterial.
  • trunk/src/core/net/sf/basedb/core/Sample.java

    r5357 r5523  
    6464    throws BaseException
    6565  {
     66    return getNew(dc, null);
     67  }
     68 
     69  /**
     70    Create a new <code>Sample</code> item as part of a
     71    master bioplate event.
     72 
     73    @param dc The <code>DbControl</code> which will be used for
     74      permission checking and database access
     75    @param master The master bioplate event participant or null
     76    @return The new <code>Sample</code> item
     77    @throws BaseException If there is an error
     78    @since 2.17
     79  */
     80  public static Sample getNew(DbControl dc, BioPlateEventParticipant master)
     81    throws BaseException
     82  {
    6683    Sample s = dc.newItem(Sample.class);
    6784    s.setName("New sample");
     85    s.setBioPlateEventParticipant(master);
    6886    return s;
    69   }
     87}
    7088
    7189  /**
     
    233251    throws PermissionDeniedException, BaseException
    234252  {
    235     Extract e = Extract.getNew(getDbControl());
     253    return newExtract(usedQuantity, null);
     254  }
     255
     256  /**
     257    Create a new {@link Extract} from this sample as part of a
     258    master bioplate event.
     259    @param usedQuantity The quantity used from this sample or null
     260      if not known
     261    @param master The master bioplate event participant or null
     262    @return The new <code>Extract</code> item
     263    @throws PermissionDeniedException If the logged in user doesn't have
     264      use permission for this sample
     265    @throws BaseException If there is another error
     266    @since 2.17
     267  */
     268  public Extract newExtract(Float usedQuantity, BioPlateEventParticipant master)
     269    throws PermissionDeniedException, BaseException
     270  {
     271    Extract e = Extract.getNew(getDbControl(), master);
    236272    e.setSample(this, usedQuantity);
    237273    return e;
    238274  }
    239275
     276 
    240277  /**
    241278    Get a query that returns all extracts created from this sample.
  • trunk/src/core/net/sf/basedb/core/Update.java

    r5475 r5523  
    3939import net.sf.basedb.core.data.AnnotationSetData;
    4040import net.sf.basedb.core.data.ArrayDesignData;
     41import net.sf.basedb.core.data.BioMaterialEventData;
    4142import net.sf.basedb.core.data.BioPlateData;
     43import net.sf.basedb.core.data.BioPlateEventData;
     44import net.sf.basedb.core.data.BioPlateEventParticipantData;
     45import net.sf.basedb.core.data.BioPlateEventTypeData;
    4246import net.sf.basedb.core.data.BioPlateTypeData;
    4347import net.sf.basedb.core.data.BioWellData;
     
    946950    </td>
    947951  </tr>
     952  <tr>
     953    <td>89</td>
     954    <td>
     955      Adds {@link BioPlateEventData}, {@link BioPlateEventTypeData},
     956      {@link BioPlateEventParticipantData} and
     957      {@link BioMaterialEventData#getBioPlateEventParticipant()}.
     958      No special update is needed. Only increase the schema version.
     959    </td>
     960  </tr>
    948961  </table>
    949962
     
    12981311      }
    12991312     
    1300       if (schemaVersion < 88)
    1301       {
    1302         if (progress != null) progress.display((int)(87*progress_factor),
    1303             "--Updating schema version: " + schemaVersion + " -> 88...");
    1304         schemaVersion = setSchemaVersionInTransaction(session, 88);
     1313      if (schemaVersion < 89)
     1314      {
     1315        if (progress != null) progress.display((int)(88*progress_factor),
     1316            "--Updating schema version: " + schemaVersion + " -> 89...");
     1317        schemaVersion = setSchemaVersionInTransaction(session, 89);
    13051318      }
    13061319
  • trunk/src/core/net/sf/basedb/core/data/BioMaterialEventData.java

    r5452 r5523  
    7575  }
    7676
     77  private BioPlateEventParticipantData bioPlateEventParticipant;
     78  /**
     79    Get the bioplate event that is the master event for this event. Null if
     80    no bioplate event exists for this event.
     81    @hibernate.many-to-one column="`bioplateeventparticipant_id`" not-null="false" outer-join="false" update="false"
     82    @since 2.17
     83  */
     84  public BioPlateEventParticipantData getBioPlateEventParticipant()
     85  {
     86    return bioPlateEventParticipant;
     87  }
     88  public void setBioPlateEventParticipant(BioPlateEventParticipantData bioPlateEventParticipant)
     89  {
     90    this.bioPlateEventParticipant = bioPlateEventParticipant;
     91  }
     92 
    7793  private MeasuredBioMaterialData bioMaterial;
    7894  /**
  • trunk/src/core/net/sf/basedb/core/data/BioPlateData.java

    r5454 r5523  
    2424import java.util.HashMap;
    2525import java.util.Map;
     26import java.util.Set;
    2627
    2728/**
     
    178179    this.bioWells = bioWells;
    179180  }
     181 
     182  private Set<BioPlateEventParticipantData> eventParticipants;
     183  /**
     184    This is the inverse end.
     185    @see BioPlateEventParticipantData#getBioPlate()
     186    @hibernate.set lazy="true" inverse="true"
     187    @hibernate.collection-key column="`bioplate_id`"
     188    @hibernate.collection-one-to-many class="net.sf.basedb.core.data.BioPlateEventParticipantData"
     189    @since 2.17
     190  */
     191  Set<BioPlateEventParticipantData> getEventParticipants()
     192  {
     193    return eventParticipants;
     194  }
     195  void setEventParticipants(Set<BioPlateEventParticipantData> eventParticipants)
     196  {
     197    this.eventParticipants = eventParticipants;
     198  }
     199
     200 
    180201}
  • trunk/src/test/TestAll.java

    r5452 r5523  
    8787    results.put("TestBioPlateType", TestBioPlateType.test_all());
    8888    results.put("TestBioPlate", TestBioPlate.test_all());
     89    results.put("TestBioPlateEvent", TestBioPlateEvent.test_all());
    8990
    9091    // Annotation types and annotations
Note: See TracChangeset for help on using the changeset viewer.