I am writing a Java application which returns XML having data for n attributes. Data for all the attributes can not be retrieved by firing a single SELECT query. so I have to fire multiple queries and then combine all resultsets to get data for attributes.
I am not sure how can I combine the results? Any suggestions?
Once the value object is created by combining the data from multiple resultsets, I have to apply user defined filters on it. User can set data filters like empname starts with A OR birthdate greater than 31st march.
How do I apply these filters on the value object collection?
yeah thats correct. but not all data is coming from database.
value objects is populated by firing multiple queries and doing some API calls. so if filter is set on a attribute which is coming from SQL I can always use WHERE clause to filter the data, but for other attributes whose data is retrieved by an API call,,I can not add filter clause.
So I thought of making VO collection first and then filter objects of this collection based on the filter.
looping through collection and then removing objects will be expensive...... The way I am planning to do it 1. Define a value object class having all the attributes 2. Fire queries and populate value object attributes and put it in the collection 3. get the user defined filters and loop through collection to filter.
I think this will be expensive. is there any alternate way?
I have created a sql ability on Arrays using a class I created called ArraySQL that is part of the open source formatteddataset api. The api also has the abilility to turn a ResultSet into an Object.