If I understand correctly, you'd either have to use join mapping (and that's only supported in XML), or use two SELECTs (even subselects mapped in a result map. There's no way to express that you're returning two lists with simple mappings.
Clinton On Tue, Aug 18, 2009 at 10:31 AM, Richard Bibb<richard.b...@aimhedge.com> wrote: > > I'm new to iBatis and I'm looking into using it in my project so far it > appears to do what I want but I'm beginning to run into problems with what I > want to do (I probably just have to look at things in anoter way) > > Currently I'm using the interface/annotations only method to get at the data > (only because it's quicker for me) but I'm not adverse to using xml > > The data I am looking at is timeseries financial data (i.e. viewed from an > object point of view Arrays or Array lists are what you want). In the > database each item of data is stored as a separate row > > Selecting a single piece of data is easy, selecting an ArrayList of data is > also easy. > > public interface BackAdjFutureMapper { > �...@select("select value from back_adj_future " + > "where feed = #{feed} " + > "and instrument = #{instrument} " + > "and periodicity = #{periodicity} " + > "and date < str_to_date('19980721','%Y%m%d') " + > "and date > str_to_date('19980701','%Y%m%d')") > ArrayList<Double> selectBackAdjFuture(BackAdjFuture args); > > my question is how do I reurn both the timestamp and the value? > > public interface BackAdjFutureMapper { > �...@select("select date, value from back_adj_future " + <<< Note > the extra > field > "where feed = #{feed} " + > "and instrument = #{instrument} " + > "and periodicity = #{periodicity} " + > "and date < str_to_date('19980721','%Y%m%d') " + > "and date > str_to_date('19980701','%Y%m%d')") > AnObjectContainingTwoArrayLists > selectBackAdjFuture(BackAdjFuture args); > > I tried creating an object with two array lists but I get the error: No type > handler could be found to map the property 'date' to the column 'DATE'. One > or both of the types, or the combination of types is not supported. > > I also tried returning to a HashMap but again an error: Expected one result > to be returned by selectOne(), but found: 12 > > I can see that lots of annotations exist but there aren't any examples to go > with them > > Can anyone help? > > > > -- > View this message in context: > http://www.nabble.com/Timeseries-retrieval-with-iBatis-tp25028620p25028620.html > Sent from the iBATIS - User - Java mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org > For additional commands, e-mail: user-java-h...@ibatis.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org