diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/ISampleLister.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/ISampleLister.java index 3b5c75173c64cd132aa67c93e14f9ea09a4c1a4c..c401234cad233f8624f510e40ab5d01b2c0103f1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/ISampleLister.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/ISampleLister.java @@ -24,7 +24,7 @@ import java.util.Set; import ch.systemsx.cisd.common.collections.IValidator; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListOrSearchSampleCriteria; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; -import ch.systemsx.cisd.openbis.generic.shared.dto.SampleRelationShipSkeleton; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleRelationshipSkeleton; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleSkeleton; /** @@ -63,8 +63,8 @@ public interface ISampleLister * getParentToChildrenIdsMap/getChildToParentsIdsMap. */ @Deprecated - public List<SampleRelationShipSkeleton> listSampleRelationShipsBy( - IValidator<SampleRelationShipSkeleton> criteria); + public List<SampleRelationshipSkeleton> listSampleRelationshipsBy( + IValidator<SampleRelationshipSkeleton> criteria); /** Returns a map from child id to set of parents ids for specified children. */ public Map<Long, Set<Long>> getChildToParentsIdsMap(Collection<Long> childrenIds); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleLister.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleLister.java index b201a674a24c5495a6fd1b5c4edca322c9b39daf..bda26f8005864ddab7a1b60dc3c423566de81486 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleLister.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleLister.java @@ -35,7 +35,7 @@ import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory; import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListOrSearchSampleCriteria; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; -import ch.systemsx.cisd.openbis.generic.shared.dto.SampleRelationShipSkeleton; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleRelationshipSkeleton; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleSkeleton; /** @@ -104,16 +104,16 @@ public class SampleLister implements ISampleLister } @Override - public List<SampleRelationShipSkeleton> listSampleRelationShipsBy( - IValidator<SampleRelationShipSkeleton> criteria) + public List<SampleRelationshipSkeleton> listSampleRelationshipsBy( + IValidator<SampleRelationshipSkeleton> criteria) { DataIterator<SampleRelationRecord> records = dao.getQuery().getSampleRelationshipSkeletons(); - List<SampleRelationShipSkeleton> result = new ArrayList<SampleRelationShipSkeleton>(); + List<SampleRelationshipSkeleton> result = new ArrayList<SampleRelationshipSkeleton>(); for (SampleRelationRecord record : records) { - SampleRelationShipSkeleton skeleton = new SampleRelationShipSkeleton(); - skeleton.setRelationShipTypeID(record.relationship_id); + SampleRelationshipSkeleton skeleton = new SampleRelationshipSkeleton(); + skeleton.setRelationshipTypeID(record.relationship_id); skeleton.setParentSampleID(record.sample_id_parent); skeleton.setChildSampleID(record.sample_id_child); if (criteria.isValid(skeleton)) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleRelationShipSkeleton.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleRelationshipSkeleton.java similarity index 76% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleRelationShipSkeleton.java rename to openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleRelationshipSkeleton.java index 89826b7026fdd4e1cb23c834e36e908138a0d921..ea3c4ef2449187c5c006d406a60e8345e095677e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleRelationShipSkeleton.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleRelationshipSkeleton.java @@ -17,17 +17,17 @@ package ch.systemsx.cisd.openbis.generic.shared.dto; /** - * Only primary and foreign keys of a sample relationship in the database. - * + * Only primary and foreign keys of a sample relationship in the database. + * * @author Franz-Josef Elmer */ -public class SampleRelationShipSkeleton +public class SampleRelationshipSkeleton { private long parentSampleID; - + private long childSampleID; - - private long relationShipTypeID; + + private long relationshipTypeID; public final long getParentSampleID() { @@ -49,13 +49,13 @@ public class SampleRelationShipSkeleton this.childSampleID = childSampleID; } - public final long getRelationShipTypeID() + public final long getRelationshipTypeID() { - return relationShipTypeID; + return relationshipTypeID; } - public final void setRelationShipTypeID(long relationShipTypeID) + public final void setRelationshipTypeID(long relationShipTypeID) { - this.relationShipTypeID = relationShipTypeID; + this.relationshipTypeID = relationShipTypeID; } } diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/business/SampleLoader.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/business/SampleLoader.java index 94b2505c796484e276228aee2050466bec7734fa..d50638f9155aed1482457623fd605ab224c55583 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/business/SampleLoader.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/business/SampleLoader.java @@ -30,7 +30,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListOrSearchSampleCriteria; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.generic.shared.dto.SpacePE; -import ch.systemsx.cisd.openbis.generic.shared.dto.SampleRelationShipSkeleton; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleRelationshipSkeleton; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleSkeleton; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; @@ -111,18 +111,18 @@ public class SampleLoader implements ISampleLoader sampleLister .getRelationshipTypeID(BasicConstant.PARENT_CHILD_INTERNAL_RELATIONSHIP); @SuppressWarnings("deprecation") - List<SampleRelationShipSkeleton> relationshipSkeletons = - sampleLister.listSampleRelationShipsBy(new IValidator<SampleRelationShipSkeleton>() + List<SampleRelationshipSkeleton> relationshipSkeletons = + sampleLister.listSampleRelationshipsBy(new IValidator<SampleRelationshipSkeleton>() { @Override - public boolean isValid(SampleRelationShipSkeleton skeleton) + public boolean isValid(SampleRelationshipSkeleton skeleton) { - return skeleton.getRelationShipTypeID() == relationshipTypeID + return skeleton.getRelationshipTypeID() == relationshipTypeID && sampleIDs.contains(skeleton.getChildSampleID()); } }); Set<Long> filteredSampleIDs = new HashSet<Long>(); - for (SampleRelationShipSkeleton sampleRelationShipSkeleton : relationshipSkeletons) + for (SampleRelationshipSkeleton sampleRelationShipSkeleton : relationshipSkeletons) { filteredSampleIDs.add(sampleRelationShipSkeleton.getChildSampleID()); }