Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-4559

JDBC OG shouldn't return list.get(0) if maxRows > 1 but only 1 row returned

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 5.1 GA
    • Fix Version/s: 5.2 M1
    • Component/s: None
    • Labels:

      Description

      Object payload = list;
      if (list.isEmpty()) {
      	return null;
      }
      if (list.size() == 1) {
      	payload = list.get(0);
      }
      return payload;
      

      If a select query is performed and maxRows>1 we should always return a List or null rather than getting the first element.

      maxRows>1 implies the application is expecting a List and shouldn't have to check the payload type.

        Attachments

          Activity

            People

            Assignee:
            abilan Artem Bilan
            Reporter:
            grussell Gary Russell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: