Add a new fetch mode, perhaps called "FETCH_SINGLE", that returns just one
fetch property and does not wrap it in an array, list or map.
For example,
{{{
Search s = new Search(Person.class);
s.setFetchMode(Search.FETCH_SINGLE);
s.addFetch("name"); //exactly one fetch should be added
List<String> results = generalDAO.search(s);
assertEquals("Mike Wilson", results.get(0));
}}}
Other fetch modes all would return each result as a collection of some
sort. For example:
{{{
s.setFetchMode(Search.FETCH_ARRAY);
List<Object[]> results = generalDAO.search(s);
assertEquals("Mike Wilson", results.get(0)[0]); //note the [0] at the end
of the line.
}}}
Original issue reported on code.google.com by dwolvert on 6 Aug 2008 at 2:23
Original issue reported on code.google.com by
dwolvert
on 6 Aug 2008 at 2:23