Skip to content
Snippets Groups Projects
Commit 7e60088b authored by izabel's avatar izabel
Browse files

[LMS-1609] update spot width/height when image dataset registered after analysis dataset

SVN: 16996
parent 21c4fa60
No related branches found
No related tags found
No related merge requests found
...@@ -77,7 +77,7 @@ public class ScreeningContainerDatasetInfoHelper ...@@ -77,7 +77,7 @@ public class ScreeningContainerDatasetInfoHelper
synchronized (IImagingQueryDAO.class) synchronized (IImagingQueryDAO.class)
{ {
CreatedOrFetchedEntity exp = getOrCreateExperiment(dao, info); CreatedOrFetchedEntity exp = getOrCreateExperiment(dao, info);
CreatedOrFetchedEntity cont = getOrCreateContainer(dao, info, exp.getId()); CreatedOrFetchedEntity cont = getOrCreateContainer(dao, info, exp.getId(), true);
if (exp.hasAlreadyExisted() == false || cont.hasAlreadyExisted() == false) if (exp.hasAlreadyExisted() == false || cont.hasAlreadyExisted() == false)
{ {
// without this commit other threads will not see the new experiment/sample when the // without this commit other threads will not see the new experiment/sample when the
...@@ -104,7 +104,7 @@ public class ScreeningContainerDatasetInfoHelper ...@@ -104,7 +104,7 @@ public class ScreeningContainerDatasetInfoHelper
{ {
CreatedOrFetchedEntity exp = getOrCreateExperiment(dao, info); CreatedOrFetchedEntity exp = getOrCreateExperiment(dao, info);
long expId = exp.getId(); long expId = exp.getId();
CreatedOrFetchedEntity cont = getOrCreateContainer(dao, info, expId); CreatedOrFetchedEntity cont = getOrCreateContainer(dao, info, expId, true);
Map<String, Long/* (tech id */> channelsMap = Map<String, Long/* (tech id */> channelsMap =
helper.getOrCreateChannels(expId, channels); helper.getOrCreateChannels(expId, channels);
if (exp.hasAlreadyExisted() == false || cont.hasAlreadyExisted() == false) if (exp.hasAlreadyExisted() == false || cont.hasAlreadyExisted() == false)
...@@ -118,13 +118,18 @@ public class ScreeningContainerDatasetInfoHelper ...@@ -118,13 +118,18 @@ public class ScreeningContainerDatasetInfoHelper
} }
private static CreatedOrFetchedEntity getOrCreateContainer(IImagingQueryDAO dao, private static CreatedOrFetchedEntity getOrCreateContainer(IImagingQueryDAO dao,
ScreeningContainerDatasetInfo info, long expId) ScreeningContainerDatasetInfo info, long expId, boolean updateContainer)
{ {
String containerPermId = info.getContainerPermId(); String containerPermId = info.getContainerPermId();
Long containerId = dao.tryGetContainerIdPermId(containerPermId); Long containerId = dao.tryGetContainerIdPermId(containerPermId);
if (containerId != null) if (containerId != null)
{ {
return new CreatedOrFetchedEntity(true, containerId); if (updateContainer)
{
dao.updateContainer(containerId, info.getContainerColumns(), info
.getContainerRows());
}
return new CreatedOrFetchedEntity(updateContainer == false, containerId);
} else } else
{ {
ImgContainerDTO container = ImgContainerDTO container =
......
...@@ -124,6 +124,10 @@ public interface IImagingQueryDAO extends TransactionQuery ...@@ -124,6 +124,10 @@ public interface IImagingQueryDAO extends TransactionQuery
+ "(?{1.name}, ?{1.description}, ?{1.wavelength}, ?{1.datasetId}, ?{1.experimentId}) returning ID") + "(?{1.name}, ?{1.description}, ?{1.wavelength}, ?{1.datasetId}, ?{1.experimentId}) returning ID")
public long addChannel(ImgChannelDTO channel); public long addChannel(ImgChannelDTO channel);
@Update("update CONTAINERS " + "set SPOTS_WIDTH = ?{2}, SPOTS_HEIGHT = ?{3} "
+ "where ID = ?{1}")
public void updateContainer(long id, int columns, int rows);
@Select("insert into CONTAINERS (PERM_ID, SPOTS_WIDTH, SPOTS_HEIGHT, EXPE_ID) values " @Select("insert into CONTAINERS (PERM_ID, SPOTS_WIDTH, SPOTS_HEIGHT, EXPE_ID) values "
+ "(?{1.permId}, ?{1.numberOfColumns}, ?{1.numberOfRows}, ?{1.experimentId}) returning ID") + "(?{1.permId}, ?{1.numberOfColumns}, ?{1.numberOfRows}, ?{1.experimentId}) returning ID")
public long addContainer(ImgContainerDTO container); public long addContainer(ImgContainerDTO container);
......
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