Skip to content
Snippets Groups Projects
Commit bb60f5cc authored by felmer's avatar felmer
Browse files

LMS-2600 handle unkown space and sample type in SampleLoader. Make database...

LMS-2600 handle unkown space and sample type in SampleLoader. Make database basic name configurable.

SVN: 23479
parent b7fd8cc0
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package ch.systemsx.cisd.openbis.plugin.phosphonetx.server.business; package ch.systemsx.cisd.openbis.plugin.phosphonetx.server.business;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -77,10 +78,18 @@ public class SampleLoader implements ISampleLoader ...@@ -77,10 +78,18 @@ public class SampleLoader implements ISampleLoader
{ {
SampleTypePE sampleTypePE = SampleTypePE sampleTypePE =
daoFactory.getSampleTypeDAO().tryFindSampleTypeByCode(sampleTypeCode); daoFactory.getSampleTypeDAO().tryFindSampleTypeByCode(sampleTypeCode);
if (sampleTypePE == null)
{
return Collections.emptySet();
}
final Long sampleTypeID = sampleTypePE.getId(); final Long sampleTypeID = sampleTypePE.getId();
SpacePE space = SpacePE space =
daoFactory.getSpaceDAO().tryFindSpaceByCodeAndDatabaseInstance(spaceCode, daoFactory.getSpaceDAO().tryFindSpaceByCodeAndDatabaseInstance(spaceCode,
daoFactory.getHomeDatabaseInstance()); daoFactory.getHomeDatabaseInstance());
if (space == null)
{
return Collections.emptySet();
}
final Long spaceID = space.getId(); final Long spaceID = space.getId();
List<SampleSkeleton> sampleSkeletons = List<SampleSkeleton> sampleSkeletons =
sampleLister.listSampleBy(new IValidator<SampleSkeleton>() sampleLister.listSampleBy(new IValidator<SampleSkeleton>()
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<bean id="phosphonetx-db-configuration-context" <bean id="phosphonetx-db-configuration-context"
class="ch.systemsx.cisd.dbmigration.DatabaseConfigurationContext"> class="ch.systemsx.cisd.dbmigration.DatabaseConfigurationContext">
<property name="basicDatabaseName" value="phosphonetx" /> <property name="basicDatabaseName" value="${phosphonetx.database.basic-name}" />
<property name="createFromScratch" value="${phosphonetx.database.create-from-scratch}" /> <property name="createFromScratch" value="${phosphonetx.database.create-from-scratch}" />
<property name="scriptSingleStepMode" value="${phosphonetx.database.script-single-step-mode}" /> <property name="scriptSingleStepMode" value="${phosphonetx.database.script-single-step-mode}" />
<property name="sequenceNameMapper"> <property name="sequenceNameMapper">
......
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