0 Replies Latest reply on Aug 4, 2003 4:37 PM by kutter

    REQUEST FOR DOCUMENTATION: ejbql over simple relations

    kutter Newbie

      In the J2EE tutorial of Sun, there is a simple
      example 5, where a relation "league" is used,
      which is not of many-type.

      In the JBoss docu there is only one example,
      the selectAccomplices (see my other post),
      but no running example with something
      like the below: ".... WHERE t.league = ?1"

      I try to do my own example (see my post in the
      CMP/CMR forum) but I cannot get it running.

      Would it be possible to get a running example,
      for instance an extension of the Gangster-stuff,
      where something like ".... WHERE t.league = ?1"
      is running?

      Thanks in advance, Philipp


      Example 5, http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBQL4.html

      SELECT DISTINCT OBJECT(p)
      FROM Player p, IN (p.teams) AS t
      WHERE t.league = ?1


      Data retrieved: The players that belong to the specified league.

      Finder method: findByLeague(LocalLeague league)

      Description: The expressions in this query navigate over two relationships. The p.teams expression navigates the PlayerEJB-TeamEJB relationship, and the t.league expression navigates the TeamEJB-LeagueEJB relationship.

      In the other examples, the input parameters are String objects, but in this example the parameter is an object whose type is a LocalLeague interface. This type matches the league relationship field in the comparison expression of the WHERE clause.