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

Select using a SimpleKey containing a null value does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0-beta1
    • 4.0
    • Runtime
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: