I have a collection, a List of Map, the map is Map<String, String>. I need to query this collection with comparison, logical, like, not in operators. Something like SQL.
I will be populating the list from a database stored procedure, so I am not sure about the size. But, I guess the size should not be more than 10,000 records.
While posting this I am having a look at Apache functors, I don’t know if they will help here.
Other way that I am thinking of is using the in-memory database Derby to achieve this.
Please let me know of any Java library or any other way of doing this.
The maps in the list will be like below:
Map<String, String> m1 = new Map<String, String>();
m1.put("name","Mark");
m1.put("age","21");
m1.put("city","some city");
Map<String, String> m1 = new Map<String, String>();
m1.put("name","David");
m1.put("age","25");
m1.put("city","other city");
I need to query the list to get Map which has:
name=Markname=Mark and age > 30city not in "other city"
I found JFilter which helps you with filtering in-memory data (java objects ). Below is the description from JFilter website.
JFilter is a simple and high performance open source library to filter (query), map (select) and reduce (aggregate) objects in a Java collection. Query is given in json format like Mongodb queries.
I have written a post on using JFilter with Maps, which I am using as a generic way of storing data and querying/filtering using JFilter
Here is the link to the post Using JFilter to query/filter in-memory data