3 Replies Latest reply on Nov 21, 2001 8:01 PM by erik777

    Jaws.XML and CMP finder query

    nietsnie

      any way to gets jaws to do a finder query like this?:

      select distinct id from table?

        • 1. Re: Jaws.XML and CMP finder query
          schaefera

          AFAIK no but this is not desirable because an Entity EJB represents a datastore record.

          But still you can make it happen when you create a DB View on a table like:
          CREATE VIEW ( NUMBER(5) ) AS SELECT DISTINCT Id FROM Table_XYZ;

          But be warned that when you create such a view your Entity EJB can only be READ-ONLY because a DB will reject an INSERT or UPDATE on this view.

          Have fun - Andy

          • 2. Re: Jaws.XML and CMP finder query
            danch1

            Is 'id' the primary key? If so you just need to add a 'findAll' in your home interface.

            • 3. Re: Jaws.XML and CMP finder query
              erik777

              That's what I'm working on. You should be able to do it with a CODED custom finder, which is what I'm trying to do, only I can't get it to work. It returns a collection with size of 0, and doesn't even appear to run the code.

              Look in the manual:

              http://www.jboss.org/online-manual/HTML/ch05s07.html

              and read the last section, "Custom finders coded in your beans".

              If you get it to work, then please let me know.