Uploaded image for project: 'Torque'
  1. Torque
  2. TORQUE-247

Select using a SimpleKey containing a null value does not work

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0-beta1
    • Fix Version/s: 4.0
    • Component/s: Runtime
    • Labels:
      None

      Description

      The code
      SimpleKey keyToSelect = SimpleKey.keyFor((Integer) null);
      Criteria criteria = new Criteria()
      .where(BookPeer.AUTHOR_ID, keyToSelect);

      List<Book> books = BookPeer.doSelect(criteria);
      throws a NullPointerException:
      java.lang.NullPointerException
      at org.apache.torque.util.BasePeerImpl.setPreparedStatementReplacements(BasePeerImpl.java:2246)
      at org.apache.torque.util.BasePeerImpl.doSelect(BasePeerImpl.java:1525)
      at org.apache.torque.util.BasePeerImpl.doSelect(BasePeerImpl.java:1152)
      at org.apache.torque.util.BasePeerImpl.doSelect(BasePeerImpl.java:961)
      at org.apache.torque.test.peer.base.BaseBookPeer.doSelect(BaseBookPeer.java:305)
      ....
      The problem is that the NullValueBuilder does not check for ObjectKeys containing Null

        Attachments

          Activity

            People

            • Assignee:
              tfischer Thomas Fox
              Reporter:
              tfischer Thomas Fox
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: