Changeset 5026


Ignore:
Timestamp:
Jul 28, 2009, 11:06:46 AM (13 years ago)
Author:
Nicklas Nordborg
Message:

References #1350: Update to Hibernate 3.3.2

Location:
trunk
Files:
10 edited

Legend:

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

    r4889 r5026  
    13091309      if (progress != null) progress.display(10, "Loading raw data from raw bioassay...");
    13101310      DataQuery<RawData> rawQuery = getRawData();
    1311       // NOTE!! Due to an issue in Hibernate we must join all three
    1312       // tables or we will get an AssertionFailure: possible non-threadsafe access to the session
    1313       // The query also works if don't join at all, but that will generate a lot
    1314       // of extra queries for each iteration
    13151311      rawQuery.join(Hql.leftJoin(null, "reporter", "rep", null, true));
    13161312      rawQuery.join(Hql.leftJoin(null, "feature", "feat", null, true));
    1317       rawQuery.join(Hql.leftJoin("feat", "arrayDesignBlock", "bl", null, true));
    13181313
    13191314      DataResultIterator<RawData> result = rawQuery.iterate(dc);
     
    13271322        // Get the feature identifier for the current raw data
    13281323        FeatureData oldFeature = raw.getFeature();
    1329         String externalFeatureId = oldFeature == null ? null : oldFeature.getExternalId();;
     1324        String externalFeatureId = oldFeature == null ? null : oldFeature.getExternalId();
    13301325        Object rawFeatureId = fiMethod.getIdentifier(raw, externalFeatureId);
    13311326       
  • trunk/src/core/net/sf/basedb/core/data/ArrayDesignBlockData.java

    r4889 r5026  
    3434  @see <a href="../../../../../../html/developerdoc/api/data_api.arrays.html">Array LIMS - arrays overview</a>
    3535  @base.modified $Date$
    36   @hibernate.class table="`ArrayDesignBlocks`" lazy="false"
     36  @hibernate.class table="`ArrayDesignBlocks`" lazy="true"
    3737*/
    3838public class ArrayDesignBlockData
  • trunk/src/core/net/sf/basedb/core/data/FeatureData.java

    r4889 r5026  
    3131  @see <a href="../../../../../../html/developerdoc/api/data_api.arrays.html">Array LIMS - arrays overview</a>
    3232  @base.modified $Date$
    33   @hibernate.class table="`Features`" lazy="false"
     33  @hibernate.class table="`Features`" lazy="true"
    3434 */
    3535public class FeatureData
  • trunk/src/core/net/sf/basedb/core/data/ReporterData.java

    r4889 r5026  
    4747  @see net.sf.basedb.core.ExtendedProperties
    4848  @see <a href="../../../../../../html/developerdoc/api/data_api.reporters.html">Reporter overview</a>
    49   @hibernate.class table="`Reporters`" lazy="false"
     49  @hibernate.class table="`Reporters`" lazy="true"
    5050*/
    5151public class ReporterData
  • trunk/src/core/net/sf/basedb/core/templates/hibernate-properties-RawData.xml

    r4889 r5026  
    3737    dynamic-update="false"
    3838    dynamic-insert="false"
    39     lazy="false"
     39    lazy="true"
    4040    >
    4141    <id
  • trunk/src/core/net/sf/basedb/util/IntensityCalculatorUtil.java

    r4915 r5026  
    2525import net.sf.basedb.core.DataQuery;
    2626import net.sf.basedb.core.DbControl;
    27 import net.sf.basedb.core.Item;
    2827import net.sf.basedb.core.RawDataType;
    2928import net.sf.basedb.core.ArrayDesign;
     
    4847import net.sf.basedb.core.data.RawData;
    4948import net.sf.basedb.core.data.ReporterData;
    50 import net.sf.basedb.core.query.Hql;
    5149import net.sf.basedb.core.query.Selects;
    5250import net.sf.basedb.core.query.Select;
     
    348346      // Load raw data for current raw bioassay
    349347      DataQuery<RawData> rawQuery = rba.getRawData();
    350       rawQuery.join(Hql.leftJoin(null, "reporter", Item.REPORTER.getAlias(), null, true));
    351       if (rba.getArrayDesign() != null)
    352       {
    353         rawQuery.join(Hql.leftJoin(null, "feature", Item.FEATURE.getAlias(), null, true));
    354         // The joins below are needed to avoid extra SELECT statements for each spot
    355         // that is loaded
    356         rawQuery.join(Hql.leftJoin(Item.FEATURE.getAlias(), "reporter", "ftrep", null, true));
    357         rawQuery.join(Hql.leftJoin(Item.FEATURE.getAlias(), "arrayDesignBlock", "ftrbl", null, true));
    358       }
    359      
    360348      DataResultIterator<RawData> rawData = rawQuery.iterate(dc);
    361349      ThreadSignalHandler.checkInterrupted();
  • trunk/src/test/TestArrayDesign.java

    r4889 r5026  
    2626import net.sf.basedb.core.BaseException;
    2727import net.sf.basedb.core.BlockInfo;
     28import net.sf.basedb.core.DataQuery;
    2829import net.sf.basedb.core.DbControl;
    2930import net.sf.basedb.core.Feature;
     
    4748import net.sf.basedb.core.data.FeatureData;
    4849import net.sf.basedb.core.data.ReporterData;
     50import net.sf.basedb.core.query.Hql;
    4951import net.sf.basedb.util.FileUtil;
    5052import net.sf.basedb.util.parser.FlatFileParser;
     
    512514      ArrayDesign ad = ArrayDesign.getById(dc, arrayDesignId);
    513515     
    514       DataResultIterator<FeatureData> it = ad.getFeatures().iterate(dc);
     516      DataQuery<FeatureData> query = ad.getFeatures();
     517      query.join(Hql.innerJoin(null, "arrayDesignBlock", "blk", null, true));
     518      query.join(Hql.leftJoin(null, "reporter", "rpt", null, true));
     519      DataResultIterator<FeatureData> it = query.iterate(dc);
    515520      int counter = 0;
    516521      while (it.hasNext())
  • trunk/src/test/TestRawBioAssay.java

    r4889 r5026  
    2424import net.sf.basedb.core.*;
    2525import net.sf.basedb.core.data.RawData;
     26import net.sf.basedb.core.query.Hql;
     27import net.sf.basedb.util.ConsoleProgressReporter;
    2628import net.sf.basedb.util.FileUtil;
    2729import net.sf.basedb.util.Values;
     
    5456    int scanId = TestScan.test_create(hybridizationId, 0, 0, false);
    5557    int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, false);
     58    int arrayDesignId2 = TestArrayDesign.test_create(Platform.GENERIC, false);
     59   
    5660    TestReporter.test_import_from_file("data/test.rawdata.import.txt",
    5761      "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", "\\t", 4, 3);
    5862    TestArrayDesign.test_import_from_file(arrayDesignId, "data/test.rawdata.import.txt",
    5963      "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", null, 0, 2, 1, 4);
     64    TestArrayDesign.test_import_from_file(arrayDesignId2, "data/test.rawdata.import.txt",
     65        "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", null, 0, 2, 1, 4);
     66   
    6067    int softwareId = TestSoftware.test_create(SystemItems.getId(SoftwareType.FEATURE_EXTRACTION), null, false);
    6168    int protocolId = TestProtocol.test_create(SystemItems.getId(ProtocolType.FEATURE_EXTRACTION), null, false);
     
    7683    test_list_raw_data(id, 10, 5, 0, true);
    7784   
     85    // Test switch array design
     86    test_change_arraydesign(id, arrayDesignId2);
     87   
    7888    // Test adding raw data -- stored in files
    7989    int celId = TestFile.test_create("data/test.affymetrix.cel", false, false);
     
    94104    TestHybridization.test_delete(hybridizationId);
    95105    TestArrayDesign.test_delete(arrayDesignId);
     106    TestArrayDesign.test_delete(arrayDesignId2);
    96107    TestSoftware.test_delete(softwareId);
    97108    TestProtocol.test_delete(protocolId);
     
    413424      RawBioAssay rba = RawBioAssay.getById(dc, rawBioAssayId);
    414425      DataQuery<RawData> query = rba.getRawData();
     426      query.join(Hql.leftJoin(null, "feature", "ft", null, true));
     427      query.join(Hql.leftJoin(null, "reporter", "rep", null, true));
    415428      query.setMaxResults(limit);
    416429      query.setFirstResult(offset);
     
    647660      if (dc != null) dc.close();
    648661    }
    649   }
     662  }
     663 
     664  static void test_change_arraydesign(int id, int arrayDesignId)
     665  {
     666    if (id == 0 || arrayDesignId == 0) return;
     667    DbControl dc = null;
     668    try
     669    {
     670      dc = TestUtil.getDbControl();
     671      RawBioAssay rba = RawBioAssay.getById(dc, id);
     672      ArrayDesign ad = ArrayDesign.getById(dc, arrayDesignId);
     673      ProgressReporter progress = TestUtil.getSilent() ?
     674          null : new ConsoleProgressReporter();
     675      rba.updateArrayDesign(ad, null, progress);
     676      dc.commit();
     677      write("--Change array design OK");
     678    }
     679    catch (Throwable ex)
     680    {
     681      write("--Change array design FAILED");
     682      ex.printStackTrace();
     683      ok = false;
     684    }
     685    finally
     686    {
     687      if (dc != null) dc.close();
     688    }
     689  }
     690
    650691}
  • trunk/www/lims/arraydesigns/features/list_features.jsp

    r4889 r5026  
    126126  try
    127127  {
    128     query.join(Hql.leftJoin(null, "reporter", "rpt", null, false));
     128    query.join(Hql.leftJoin(null, "reporter", "rpt", null, true));
    129129    cc.configureQuery(dc, query, true);
    130130    if (!"row".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("row")));
     
    135135  {
    136136    cc.setMessage(t.getMessage());
     137    t.printStackTrace();
    137138  }
    138139  int numListed = 0;
  • trunk/www/views/rawbioassays/rawdata/list_rawdata.jsp

    r4889 r5026  
    104104  query.join(Hql.leftJoin(null, "reporter", "r", null, true));
    105105  query.join(Hql.leftJoin(null, "feature", "f", null, true));
    106   query.join(Hql.leftJoin("f", "arrayDesignBlock", "b", null, true));
    107106  cc.configureQuery(dc, query, true);
    108107  if (!"row".equals(cc.getSortProperty())) query.order(Orders.asc(Hql.property("row")));
     
    135134  {
    136135    cc.setMessage(t.getMessage());
     136    t.printStackTrace();
    137137  }
    138138  int numListed = 0;
Note: See TracChangeset for help on using the changeset viewer.