2 Replies Latest reply on Jul 15, 2002 6:55 PM by dsundstrom

    Bad sql generated for finder methods

    sergiu

      Hi,
      I'm having big problems making a simple findBy... method work for my EJB application. The cause is the sql generated by JBoss. He generates sql's like:
      "SELECT FROM benutzer WHERE " for a findByPrimaryKey
      "SELECT FROM benutzer WHERE LOGIN_KENNUNG=? " for findByLoginKennung
      "SELECT FROM benutzer " for findAll
      I have tried to declare EJB-QL statements for the finder, but nothing changed.
      The attached file containes a part of the jboss log file.
      Does somebody knows a reason for this?

      Sergiu

        • 1. Re: Bad sql generated for finder methods
          sergiu

          Its just incredible how useful this forum is!!
          I mean, I just post my problem, and in the next 10 second I found the solution! Is not this amazing! :-)))

          It was caused by a bad tag in ejb-jar.xml: <prim-key-field> instead of <primkey-field>!!!!!

          Sergiu

          P.S. Why is a <prim-key-class> tag (with '-' between prim and key) and a <primkey-field> tag (no '-' between prim and key)?? Damn!

          • 2. Re: Bad sql generated for finder methods
            dsundstrom

            Don't get me started on the crapy metadata required by the EJB specification.