Skip to content
Snippets Groups Projects
Commit 32c57944 authored by jakubs's avatar jakubs
Browse files

SOB-114 BIS-373 SP-572 Improve performance of plate view

SVN: 28675
parent 2e1d62a0
No related branches found
No related tags found
No related merge requests found
...@@ -281,6 +281,15 @@ public final class DataSetTable extends AbstractDataSetBusinessObject implements ...@@ -281,6 +281,15 @@ public final class DataSetTable extends AbstractDataSetBusinessObject implements
dataSets.addAll(getDataDAO().listDataSets(sample)); dataSets.addAll(getDataDAO().listDataSets(sample));
} }
@Override
public final void loadBySampleTechIdWithoutRelationships(final TechId sampleId)
{
assert sampleId != null : "Unspecified sample id";
final SamplePE sample = getSampleDAO().getByTechId(sampleId);
dataSets = new ArrayList<DataPE>();
dataSets.addAll(getDataDAO().listDataSetsWithoutRelationships(sample));
}
@Override @Override
public void loadByExperimentTechId(final TechId experimentId) public void loadByExperimentTechId(final TechId experimentId)
{ {
......
...@@ -53,6 +53,12 @@ public interface IDataSetTable ...@@ -53,6 +53,12 @@ public interface IDataSetTable
*/ */
void loadBySampleTechId(final TechId sampleId); void loadBySampleTechId(final TechId sampleId);
/**
* Loads data sets which are linked to the sample with given <var>sampleId</var>. Datasets
* doesn't include relationships or properties.
*/
void loadBySampleTechIdWithoutRelationships(final TechId sampleId);
/** /**
* Loads data sets which are linked to the experiment with given <var>experimentId</var>. * Loads data sets which are linked to the experiment with given <var>experimentId</var>.
*/ */
......
...@@ -63,6 +63,15 @@ public interface IDataDAO extends IGenericDAO<DataPE> ...@@ -63,6 +63,15 @@ public interface IDataDAO extends IGenericDAO<DataPE>
*/ */
public List<DataPE> listDataSets(final SamplePE sample) throws DataAccessException; public List<DataPE> listDataSets(final SamplePE sample) throws DataAccessException;
/**
* List the {@link DataPE} for given <var>sample</var>. The datasets are fetched without the
* additional relationships or properties.
*
* @returns list of {@link DataPE}s that are related to given {@link SamplePE}.
*/
public List<DataPE> listDataSetsWithoutRelationships(final SamplePE sample)
throws DataAccessException;
/** /**
* List the {@link DataPE} for given <var>experiment</var>. * List the {@link DataPE} for given <var>experiment</var>.
* *
......
...@@ -181,6 +181,25 @@ final class DataDAO extends AbstractGenericEntityWithPropertiesDAO<DataPE> imple ...@@ -181,6 +181,25 @@ final class DataDAO extends AbstractGenericEntityWithPropertiesDAO<DataPE> imple
return results; return results;
} }
@Override
public final List<DataPE> listDataSetsWithoutRelationships(final SamplePE sample)
throws DataAccessException
{
assert sample != null : "Unspecified sample.";
final String query = String.format("from %s e where e.sampleInternal = ?", TABLE_NAME);
final List<DataPE> list = cast(getHibernateTemplate().find(query, toArray(sample)));
// distinct does not work properly in HQL for left joins
distinct(list);
if (operationLog.isDebugEnabled())
{
operationLog.debug(String.format("%d external data have been found for [sample=%s].",
list.size(), sample));
}
return list;
}
@Override @Override
public final List<DataPE> listDataSets(final SamplePE sample) throws DataAccessException public final List<DataPE> listDataSets(final SamplePE sample) throws DataAccessException
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment