From f8e03c6f749c3d5bfdca6efcd52d4d17e1df5347 Mon Sep 17 00:00:00 2001 From: pkupczyk <pkupczyk> Date: Thu, 24 Mar 2016 20:15:18 +0000 Subject: [PATCH] SSDM-3395 : V3 AS API - controlled vocabulary terms - change VocabularyTermSearchCriteria to have withVocabulary().withCode() syntax instead of withVocabularyCode() SVN: 36017 --- .../vocabulary/ISearchVocabularyExecutor.java | 29 ++++++ .../vocabulary/SearchVocabularyExecutor.java | 96 +++++++++++++++++++ .../SearchVocabularyTermExecutor.java | 47 ++++++--- .../asapi/v3/CreateVocabularyTermTest.java | 2 +- .../asapi/v3/DeleteVocabularyTermTest.java | 2 +- .../asapi/v3/SearchVocabularyTermTest.java | 8 +- .../search/VocabularyCodeSearchCriteria.java | 37 ------- .../search/VocabularySearchCriteria.java | 68 +++++++++++++ .../VocabularyTermCodeSearchCriteria.java | 37 ------- .../search/VocabularyTermSearchCriteria.java | 9 +- 10 files changed, 238 insertions(+), 97 deletions(-) create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/vocabulary/ISearchVocabularyExecutor.java create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/vocabulary/SearchVocabularyExecutor.java delete mode 100644 openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularyCodeSearchCriteria.java create mode 100644 openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularySearchCriteria.java delete mode 100644 openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularyTermCodeSearchCriteria.java diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/vocabulary/ISearchVocabularyExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/vocabulary/ISearchVocabularyExecutor.java new file mode 100644 index 00000000000..9e6c20e30d4 --- /dev/null +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/vocabulary/ISearchVocabularyExecutor.java @@ -0,0 +1,29 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.ethz.sis.openbis.generic.server.asapi.v3.executor.vocabulary; + +import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.search.VocabularySearchCriteria; +import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.ISearchObjectExecutor; +import ch.systemsx.cisd.openbis.generic.shared.dto.VocabularyPE; + +/** + * @author pkupczyk + */ +public interface ISearchVocabularyExecutor extends ISearchObjectExecutor<VocabularySearchCriteria, VocabularyPE> +{ + +} diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/vocabulary/SearchVocabularyExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/vocabulary/SearchVocabularyExecutor.java new file mode 100644 index 00000000000..524ffc9e4d8 --- /dev/null +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/vocabulary/SearchVocabularyExecutor.java @@ -0,0 +1,96 @@ +/* + * Copyright 2014 ETH Zuerich, Scientific IT Services + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.ethz.sis.openbis.generic.server.asapi.v3.executor.vocabulary; + +import java.util.List; + +import org.springframework.stereotype.Component; + +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.CodeSearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.ISearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.IdSearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.PermIdSearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.id.VocabularyPermId; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.search.VocabularySearchCriteria; +import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext; +import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.AbstractSearchObjectManuallyExecutor; +import ch.systemsx.cisd.openbis.generic.shared.dto.VocabularyPE; + +/** + * @author pkupczyk + */ +@Component +public class SearchVocabularyExecutor extends AbstractSearchObjectManuallyExecutor<VocabularySearchCriteria, VocabularyPE> implements + ISearchVocabularyExecutor +{ + + @Override + protected List<VocabularyPE> listAll() + { + return daoFactory.getVocabularyDAO().listAllEntities(); + } + + @Override + protected Matcher getMatcher(ISearchCriteria criteria) + { + if (criteria instanceof IdSearchCriteria<?>) + { + return new IdMatcher(); + } else if (criteria instanceof CodeSearchCriteria || criteria instanceof PermIdSearchCriteria) + { + return new CodeMatcher(); + } else + { + throw new IllegalArgumentException("Unknown search criteria: " + criteria.getClass()); + } + } + + private class IdMatcher extends SimpleFieldMatcher + { + + @Override + protected boolean isMatching(IOperationContext context, VocabularyPE object, ISearchCriteria criteria) + { + Object id = ((IdSearchCriteria<?>) criteria).getId(); + + if (id == null) + { + return true; + } else if (id instanceof VocabularyPermId) + { + VocabularyPermId permId = (VocabularyPermId) id; + return object.getCode().equals(permId.getPermId()); + } else + { + throw new IllegalArgumentException("Unknown id: " + id.getClass()); + } + } + + } + + private class CodeMatcher extends StringFieldMatcher + { + + @Override + protected String getFieldValue(VocabularyPE object) + { + return object.getCode(); + } + + } + +} diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/vocabulary/SearchVocabularyTermExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/vocabulary/SearchVocabularyTermExecutor.java index d5050ac73d2..f645daf111a 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/vocabulary/SearchVocabularyTermExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/vocabulary/SearchVocabularyTermExecutor.java @@ -16,19 +16,24 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.executor.vocabulary; +import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.CodeSearchCriteria; import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.ISearchCriteria; import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.IdSearchCriteria; import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.PermIdSearchCriteria; import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.id.VocabularyTermPermId; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.search.VocabularyCodeSearchCriteria; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.search.VocabularyTermCodeSearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.search.VocabularySearchCriteria; import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.search.VocabularyTermSearchCriteria; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.AbstractSearchObjectManuallyExecutor; +import ch.systemsx.cisd.openbis.generic.shared.dto.VocabularyPE; import ch.systemsx.cisd.openbis.generic.shared.dto.VocabularyTermPE; /** @@ -39,6 +44,9 @@ public class SearchVocabularyTermExecutor extends AbstractSearchObjectManuallyEx ISearchVocabularyTermExecutor { + @Autowired + private ISearchVocabularyExecutor searchVocabularyExecutor; + @Override protected List<VocabularyTermPE> listAll() { @@ -54,12 +62,12 @@ public class SearchVocabularyTermExecutor extends AbstractSearchObjectManuallyEx } else if (criteria instanceof PermIdSearchCriteria) { return new PermIdMatcher(); - } else if (criteria instanceof VocabularyCodeSearchCriteria) + } else if (criteria instanceof CodeSearchCriteria) { - return new VocabularyCodeMatcher(); - } else if (criteria instanceof VocabularyTermCodeSearchCriteria) + return new CodeMatcher(); + } else if (criteria instanceof VocabularySearchCriteria) { - return new VocabularyTermCodeMatcher(); + return new VocabularyMatcher(); } else { throw new IllegalArgumentException("Unknown search criteria: " + criteria.getClass()); @@ -79,8 +87,8 @@ public class SearchVocabularyTermExecutor extends AbstractSearchObjectManuallyEx return true; } else if (id instanceof VocabularyTermPermId) { - VocabularyTermPermId termId = (VocabularyTermPermId) id; - return object.getCode().equals(termId.getCode()) && object.getVocabulary().getCode().equals(termId.getVocabularyCode()); + VocabularyTermPermId permId = (VocabularyTermPermId) id; + return object.getCode().equals(permId.getCode()) && object.getVocabulary().getCode().equals(permId.getVocabularyCode()); } else { throw new IllegalArgumentException("Unknown id: " + id.getClass()); @@ -100,24 +108,37 @@ public class SearchVocabularyTermExecutor extends AbstractSearchObjectManuallyEx } - private class VocabularyCodeMatcher extends StringFieldMatcher + private class CodeMatcher extends StringFieldMatcher { @Override protected String getFieldValue(VocabularyTermPE object) { - return object.getVocabulary().getCode(); + return object.getCode(); } } - private class VocabularyTermCodeMatcher extends StringFieldMatcher + private class VocabularyMatcher extends Matcher { @Override - protected String getFieldValue(VocabularyTermPE object) + public List<VocabularyTermPE> getMatching(IOperationContext context, List<VocabularyTermPE> objects, ISearchCriteria criteria) { - return object.getCode(); + List<VocabularyPE> vocabularyList = searchVocabularyExecutor.search(context, (VocabularySearchCriteria) criteria); + Set<VocabularyPE> vocabularySet = new HashSet<VocabularyPE>(vocabularyList); + + List<VocabularyTermPE> matches = new ArrayList<VocabularyTermPE>(); + + for (VocabularyTermPE object : objects) + { + if (vocabularySet.contains(object.getVocabulary())) + { + matches.add(object); + } + } + + return matches; } } diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateVocabularyTermTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateVocabularyTermTest.java index 9f367b3ebe7..826121c51dc 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateVocabularyTermTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateVocabularyTermTest.java @@ -394,7 +394,7 @@ public class CreateVocabularyTermTest extends AbstractTest String sessionToken = v3api.login(TEST_USER, PASSWORD); VocabularyTermSearchCriteria criteria = new VocabularyTermSearchCriteria(); - criteria.withVocabularyCode().thatEquals(((VocabularyPermId) vocabularyId).getPermId()); + criteria.withVocabulary().withCode().thatEquals(((VocabularyPermId) vocabularyId).getPermId()); VocabularyTermFetchOptions fetchOptions = new VocabularyTermFetchOptions(); fetchOptions.sortBy().ordinal().asc(); diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/DeleteVocabularyTermTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/DeleteVocabularyTermTest.java index b0d9531fa6e..2a8b0b94daa 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/DeleteVocabularyTermTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/DeleteVocabularyTermTest.java @@ -441,7 +441,7 @@ public class DeleteVocabularyTermTest extends AbstractDeletionTest String sessionToken = v3api.login(TEST_USER, PASSWORD); VocabularyTermSearchCriteria criteria = new VocabularyTermSearchCriteria(); - criteria.withVocabularyCode().thatEquals(vocabularyCode); + criteria.withVocabulary().withCode().thatEquals(vocabularyCode); SearchResult<VocabularyTerm> result = v3api.searchVocabularyTerms(sessionToken, criteria, new VocabularyTermFetchOptions()); v3api.logout(sessionToken); diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchVocabularyTermTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchVocabularyTermTest.java index 1720c0a316a..2336ae2dc5b 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchVocabularyTermTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchVocabularyTermTest.java @@ -191,7 +191,7 @@ public class SearchVocabularyTermTest extends AbstractTest public void testSearchWithVocabularyCodeThatEquals() { VocabularyTermSearchCriteria criteria = new VocabularyTermSearchCriteria(); - criteria.withVocabularyCode().thatEquals("HUMAN"); + criteria.withVocabulary().withCode().thatEquals("HUMAN"); testSearch(criteria, new VocabularyTermPermId("CHILD", "HUMAN"), new VocabularyTermPermId("MAN", "HUMAN"), new VocabularyTermPermId("WOMAN", "HUMAN")); } @@ -200,7 +200,7 @@ public class SearchVocabularyTermTest extends AbstractTest public void testSearchWithVocabularyCodeThatContains() { VocabularyTermSearchCriteria criteria = new VocabularyTermSearchCriteria(); - criteria.withVocabularyCode().thatContains("MA"); + criteria.withVocabulary().withCode().thatContains("MA"); testSearch(criteria, new VocabularyTermPermId("BDS_DIRECTORY", "$STORAGE_FORMAT"), new VocabularyTermPermId("CHILD", "HUMAN"), new VocabularyTermPermId("MAN", "HUMAN"), new VocabularyTermPermId("PROPRIETARY", "$STORAGE_FORMAT"), new VocabularyTermPermId("WOMAN", "HUMAN")); @@ -210,7 +210,7 @@ public class SearchVocabularyTermTest extends AbstractTest public void testSearchWithVocabularyCodeThatStartsWith() { VocabularyTermSearchCriteria criteria = new VocabularyTermSearchCriteria(); - criteria.withVocabularyCode().thatStartsWith("G"); + criteria.withVocabulary().withCode().thatStartsWith("G"); testSearch(criteria, new VocabularyTermPermId("FEMALE", "GENDER"), new VocabularyTermPermId("MALE", "GENDER")); } @@ -218,7 +218,7 @@ public class SearchVocabularyTermTest extends AbstractTest public void testSearchWithVocabularyCodeThatEndsWith() { VocabularyTermSearchCriteria criteria = new VocabularyTermSearchCriteria(); - criteria.withVocabularyCode().thatEndsWith("T"); + criteria.withVocabulary().withCode().thatEndsWith("T"); testSearch(criteria, new VocabularyTermPermId("BDS_DIRECTORY", "$STORAGE_FORMAT"), new VocabularyTermPermId("PROPRIETARY", "$STORAGE_FORMAT")); } diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularyCodeSearchCriteria.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularyCodeSearchCriteria.java deleted file mode 100644 index 5b630fbb429..00000000000 --- a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularyCodeSearchCriteria.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2016 ETH Zuerich, CISD - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.search; - -import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.SearchFieldType; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.StringFieldSearchCriteria; -import ch.systemsx.cisd.base.annotation.JsonObject; - -/** - * @author pkupczyk - */ -@JsonObject("as.dto.vocabulary.search.VocabularyCodeSearchCriteria") -public class VocabularyCodeSearchCriteria extends StringFieldSearchCriteria -{ - - private static final long serialVersionUID = 1L; - - public VocabularyCodeSearchCriteria() - { - super("vocabularyCode", SearchFieldType.ATTRIBUTE); - } - -} diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularySearchCriteria.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularySearchCriteria.java new file mode 100644 index 00000000000..86993431500 --- /dev/null +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularySearchCriteria.java @@ -0,0 +1,68 @@ +/* + * Copyright 2014 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.search; + +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.AbstractObjectSearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.CodeSearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.PermIdSearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.SearchCriteriaToStringBuilder; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.SearchOperator; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.id.IVocabularyId; +import ch.systemsx.cisd.base.annotation.JsonObject; + +/** + * @author pkupczyk + */ +@JsonObject("as.dto.vocabulary.search.VocabularySearchCriteria") +public class VocabularySearchCriteria extends AbstractObjectSearchCriteria<IVocabularyId> +{ + + private static final long serialVersionUID = 1L; + + public VocabularySearchCriteria() + { + } + + public PermIdSearchCriteria withPermId() + { + return with(new PermIdSearchCriteria()); + } + + public CodeSearchCriteria withCode() + { + return with(new CodeSearchCriteria()); + } + + public VocabularySearchCriteria withOrOperator() + { + return (VocabularySearchCriteria) withOperator(SearchOperator.OR); + } + + public VocabularySearchCriteria withAndOperator() + { + return (VocabularySearchCriteria) withOperator(SearchOperator.AND); + } + + @Override + protected SearchCriteriaToStringBuilder createBuilder() + { + SearchCriteriaToStringBuilder builder = super.createBuilder(); + builder.setName("VOCABULARY"); + return builder; + } + +} diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularyTermCodeSearchCriteria.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularyTermCodeSearchCriteria.java deleted file mode 100644 index e6f44037c9e..00000000000 --- a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularyTermCodeSearchCriteria.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2016 ETH Zuerich, CISD - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.search; - -import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.SearchFieldType; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.StringFieldSearchCriteria; -import ch.systemsx.cisd.base.annotation.JsonObject; - -/** - * @author pkupczyk - */ -@JsonObject("as.dto.vocabulary.search.VocabularyTermCodeSearchCriteria") -public class VocabularyTermCodeSearchCriteria extends StringFieldSearchCriteria -{ - - private static final long serialVersionUID = 1L; - - public VocabularyTermCodeSearchCriteria() - { - super("vocabularyTermCode", SearchFieldType.ATTRIBUTE); - } - -} diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularyTermSearchCriteria.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularyTermSearchCriteria.java index 8309f395215..329ac2b896f 100644 --- a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularyTermSearchCriteria.java +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/vocabulary/search/VocabularyTermSearchCriteria.java @@ -17,6 +17,7 @@ package ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.search; import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.AbstractObjectSearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.CodeSearchCriteria; import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.PermIdSearchCriteria; import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.SearchCriteriaToStringBuilder; import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.SearchOperator; @@ -41,14 +42,14 @@ public class VocabularyTermSearchCriteria extends AbstractObjectSearchCriteria<I return with(new PermIdSearchCriteria()); } - public VocabularyTermCodeSearchCriteria withCode() + public CodeSearchCriteria withCode() { - return with(new VocabularyTermCodeSearchCriteria()); + return with(new CodeSearchCriteria()); } - public VocabularyCodeSearchCriteria withVocabularyCode() + public VocabularySearchCriteria withVocabulary() { - return with(new VocabularyCodeSearchCriteria()); + return with(new VocabularySearchCriteria()); } public VocabularyTermSearchCriteria withOrOperator() -- GitLab