1 Reply Latest reply on Aug 6, 2002 1:50 PM by Dain Sundstrom

    ejb-ql: using non-standard class types as parameter

    Travel Maniac Newbie

      if I have something like:

      findAllUserFolders(User user),

      how do I formulate a sql statement in ejb-jar.xml that queries all the top level folders that belong to this user? With normal sql I would:
      select * from folder_tbl where user_id=3 and parent_id=-1
      I can't use foreign keys here because there's this extra constraint of the parent_id being -1 (parent id points to the folder that this folder belongs to, and -1 or null is an indication that this folder belongs to no folder). Note that "user" is also another registered EJB entity bean.