Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class GermplasmQuery extends BrapiQuery {
private String defaultDisplayName;
private String breedingMethod;
private String seedSource;
private String pedigree;
private String femaleParentGID;
private String maleParentGID;
private String createdDate;
Expand All @@ -37,6 +38,9 @@ public SearchRequest constructSearchRequest() {
if (!StringUtils.isBlank(getSeedSource())) {
filters.add(constructFilterRequest("seedSource", getSeedSource()));
}
if (!StringUtils.isBlank(getPedigree())) {
filters.add(constructFilterRequest("pedigree", getPedigree()));
}
if (!StringUtils.isBlank(getFemaleParentGID())) {
filters.add(constructFilterRequest("femaleParentGID", getFemaleParentGID()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
@Singleton
public class GermplasmQueryMapper extends AbstractQueryMapper {

private String defaultSortField = "accessionNumber";
private SortOrder defaultSortOrder = SortOrder.ASC;
private final String defaultSortField = "accessionNumber";
private final SortOrder defaultSortOrder = SortOrder.ASC;

private Map<String, Function<BrAPIGermplasm, ?>> fields;
private final Map<String, Function<BrAPIGermplasm, ?>> fields;

public GermplasmQueryMapper() {
fields = Map.ofEntries(
Expand All @@ -31,6 +31,10 @@ public GermplasmQueryMapper() {
germplasm.getAdditionalInfo().get(BrAPIAdditionalInfoFields.GERMPLASM_BREEDING_METHOD).getAsString() :
null),
Map.entry("seedSource", BrAPIGermplasm::getSeedSource),
Map.entry("pedigree", (germplasm) ->
germplasm.getAdditionalInfo() != null && germplasm.getAdditionalInfo().has(BrAPIAdditionalInfoFields.GERMPLASM_PEDIGREE_BY_NAME) ?
germplasm.getAdditionalInfo().get(BrAPIAdditionalInfoFields.GERMPLASM_PEDIGREE_BY_NAME).getAsString() :
null),
Map.entry("femaleParentGID", (germplasm) ->
germplasm.getAdditionalInfo() != null && germplasm.getAdditionalInfo().has(BrAPIAdditionalInfoFields.GERMPLASM_FEMALE_PARENT_GID) ?
germplasm.getAdditionalInfo().get(BrAPIAdditionalInfoFields.GERMPLASM_FEMALE_PARENT_GID).getAsString() :
Expand Down