Merging beans for composite search
- From: "Francesco Vivoli" <f.vivoli@xxxxxxxxx>
- Date: 21 Jul 2005 02:59:39 -0700
Hi everyone,
I am pretty stuck with a composite search problem, which among the
others has the need of the following operation:
I have a bean representing the search criteria ( the search domain is
People objects, and I'm searching-by-example ), call them
PeopleSearchCriteria
that can be filled in with details of a person I am searching
( through setName() and the like )
Now I have two of these criteria, name them C1 and C2 ( spawning
disjoint sets S1 and S2 )
and I have to create a third one (C3) by merging the information
contained in each of them ( thus with a search set equal the union of
the two S3 = {S1 U S2} )
The simple solution would be to go through every getter of S1 and S2
and set the respective setter of S3 when they return a value ( not null
), but the point is that I have like 70 properties to check and I don't
really like doing it...
Another possibility would be inserting a proxy recording the setters
that are called to fill the two criteria, but it happens that the class
structure is
People
^
|
PeopleSearchCriteria
Being People a bean as well, so no interface involved...
I actually found a class that emulates an interface proxy for normal
classes but it seems to be more an hack that something smooth...
Any ideas?
Hope to have been clear enough, really.
cheers,
Francesco
.
- Follow-Ups:
- Re: Merging beans for composite search
- From: H. S. Lahman
- Re: Merging beans for composite search
- Prev by Date: Interface Vs Xml....Discussion
- Next by Date: Re: This stuff is too simple
- Previous by thread: Interface Vs Xml....Discussion
- Next by thread: Re: Merging beans for composite search
- Index(es):