Note that there are some explanatory texts on larger screens.

plurals
  1. PONested Callback Handlers?
    primarykey
    data
    text
    <p>I am getting a set of data from the database where the query produces a repetition of data with a different "Special" value. For example the user "A" can be repeated twice, having three different "Special" values under the "Special Column".</p> <p>I am using a callback handler to retrieve the data and put it into a list, now additionally I want the Special column to have its own callback where for each user the specials list will be stored, so therefore the user data wont be repeatedly taken and stored into the list and I wont have to manually filter it out. Can anyone point me to a direction of achieving this?</p> <p>Another way of achieving this is to concatenate the results into a string there itself, which would be easier, but the query seems to be complex and messy when I include the joins.</p> <p>The code is below</p> <pre><code> String query = getQuery(SPECIALS_REPORT_QUERY); getJdbcTemplate().query(query, parameters, dataTypes, new RowCallbackHandler() { @Override public void processRow(ResultSet rs) throws SQLException { SpecialsResultsSetDTO dto = new SpecialsResultsSetDTO(); dto.setRoomNo(rs.getString("ROOM_NO")); dto.setGuestName(rs.getString("GUEST_NAME")); dto.setNoOfAdults((rs.getInt("NO_OF_ADULTS"))); dto.setNoOfChildren(rs.getInt("NO_OF_CHILDREN")); dto.setNoOfInfants(rs.getInt("NO_OF_INFANTS")); dto.setMealPlanCode(rs.getString("MEAL_PLAN_CODE")); dto.setArrivalDateTime(rs.getDate("ARRIVAL_DATE_TIME")); dto.setDepartureDate(rs.getString("DEPARTURE_DATE")); //there should be a callback handler or something to store the data to a list in the dto bean object (for the specials) dtoList.add(dto); } }); </code></pre> <p>Any advice on solving this problem would be helpful</p> <p>Regards, Milinda</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload