Torque
  1. Torque
  2. TORQUE-247

Select using a SimpleKey containing a null value does not work

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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

        Activity

        Thomas Fox created issue -
        Thomas Fox made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Thomas Fox made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1d 8h 19m 1 Thomas Fox 20/Nov/12 06:00
        Resolved Resolved Closed Closed
        103d 14h 38m 1 Thomas Fox 03/Mar/13 20:39

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development