Comments (1)
Possible Solution
In public class ColumnFilter add
private ArrayList<String> valuesToSearch;
...
public ArrayList<String> getValuesToSearch() {
return valuesToSearch;
}
....
public void setValueToSearch(JsonNode valueToSearch) {
ArrayList<String> temp = new ArrayList<String>();
Iterator<JsonNode> rulesIter = valueToSearch.elements();
while (rulesIter.hasNext()) {
temp.add(rulesIter.next().asText());
}
this.valuesToSearch = temp;
}
in Class SearchBuilder line 380
if (valueToSearch.isEmpty() && jsonFilter.get("value") instanceof ArrayNode) {
columnFilter.setValueToSearch(jsonFilter.get("value"));
}
in line 428 function getColumnQuery to
private String getColumnQuery(ColumnFilter cf, String fieldName) {
String query = null;
String rsqlFragment = getRsqlFragmentForMatchMode(cf.getMatchMode(), cf.getType());
if (cf.getType() != ColumnType.DATE && !cf.getValueToSearch().isEmpty()) {
rsqlFragment = rsqlFragment.replace("[placeholder]", cf.getValueToSearch());
query = fieldName + rsqlFragment;
} else if (cf.getType() != ColumnType.DATE) {
List<String> res = new ArrayList<String>();
for (int i = 0; i < cf.getValuesToSearch().size(); i++ ) {
String value = cf.getValuesToSearch().get(i);
if (!value.isEmpty()) {
res.add(fieldName + rsqlFragment.replace("[placeholder]", value));
}
}
query = "([values])";
query = query.replace("[values]", StringUtils.collectionToDelimitedString(res, " or "));
}
else {
query = getDatesQuery(cf, rsqlFragment, fieldName);
}
return query;
}
}
from springbootgenericpagingfilteringforprimengtable.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from springbootgenericpagingfilteringforprimengtable.