I have a controller that uses Spring to automatically map HTTP request params to business domain objects. I persist the field data in the domain objects to a database.
I have another controller that needs to support searching on any combination of fields related to the domain objects. For some of the fields (e.g. date fields), I need to allow searching within a range. So, I can't reuse the domain objects since it only has a single date field.
For example, I have a Report domain object with a date field. However, the search needs a "from" Report date field and a "to" Report date field.
Should I create a set of domain objects for just searching that mostly mirror the business domain objects (except for fields that support range searches)? Or is there some better way to do this?
Thanks in advance for your help.