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

Clarify error message for nullable parameters

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0 Beta 10
    • None
    • Core
    • None

    Description

      I am getting an error message:

      "JDBC requires that the JdbcType must be specified for all nullable parameters [...] The error may involve <mapper name>-Inline". Granted, telling me the mapper name is useful but I believe we can improve this error message in two regards:

      1. I mistakenly read "nullable parameters" as "nullable columns" and wasted time looking for problems in my database schema. I wonder if others have made a similar mistake...? Is it possible to rephrase this as follows? "Mapper methods cannot accept null arguments without a properly configured JdbcType. Either specify a JdbcType or refrain from passing in null."
      1. I noticed that when this exception is thrown iBatis has quite a bit more information available to it. Is it possible to add the following information to the error message?

      Prepared statement: "SELECT * FROM animals WHERE name = ? AND age > ?", parameter #2 was null

      This would enable me to track down exactly which parameter was equal to null.

      Attachments

        Activity

          People

            Unassigned Unassigned
            cowwoc Gili
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: