Uploaded image for project: 'iBatis for Java [READ ONLY]'
  1. iBatis for Java [READ ONLY]
  2. IBATIS-669

Support for two and more parameters for query input

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 3.0 Beta 3
    • None
    • Core
    • None

    Description

      Ibatis now support only one parametrs for query input. Use special class or map for input multiple parametrs is annoying.

      It's not possible write this:

      SendMapper sm = session.getMapper(SendMapper.class);
      List<Send> ls = sm.getAllItems(10, 2);

      and in SendMapper:

      @Select({"SELECT * FROM send LIMIT #

      {1}

      , #

      {2}

      "})
      List getAllItems(int offset, int limit);

      OR

      @Select({"SELECT * FROM send LIMIT #

      {offset}, #{limit}"})
      List getAllItems(@Param("offset") int offset, @Param("limit") int limit);

      OR use XML mapper:

      <select id="getAllItems" parameters="offset:int,limit:int">
      SELECT * FROM send LIMIT #{offset}

      , #

      {limit}
      <select>

      or more java like syntax:
      <select id="getAllItems" parameters="int offset, int limit">
      SELECT * FROM send LIMIT #{offset}, #{limit}

      <select>

      Attachments

        1. ibatis3-myTest.zip
          17 kB
          Tomáš Procházka

        Activity

          People

            cbegin Clinton Begin
            t.prochazka Tomáš Procházka
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: