1 Reply Latest reply on Mar 19, 2014 7:46 AM by sunil_patel

    Ejbfinders for nested query for jboss

    rockeys

      Hi Friends,

       

      Could you please help me on how to use nested query in ejb finders for EJB 2.0 for jboss 4.0.5 for the below ejb ? Please note I am migrating from weblogic 8.1 to jboss 4.0.5 and this below EJB code does work in weblogic.

       

      @ejb.finder

      *  view-type = "local"

      *  description = "finds the defined timeframe"

      *query   = " SELECT OBJECT(o) FROM SecGlobalHistoryEJB AS o WHERE o.groupingId IN (SELECT mr.groupingId FROM SecGlobalHistoryEJB AS mr, *SecGlobalReviewHistoryEJB AS dr WHERE mr.groupingId = dr.itemId AND mr.itemId = ?1 AND mr.itemTypeId = ?2 AND dr.itemTypeId = ?3 AND dr.reviewDtTm >= ?4 )";

      * signature = "Collection DuplRvwStartDate(java.lang.Integer p_iMRItemId, java.lang.Integer p_iMRItemTypeId,

      *                        java.lang.Integer p_iDRItemType, java.util.Date p_dtDuplRvwStartDate)"

      *  weblogic-include-updates= "false"

       

       

       

       

      Exception

      SELECT OBJECT(o) FROM SecGlobalHistoryEJB AS o WHERE o.groupingId IN (SELECT mr.groupingId FROM SecGlobalHistoryEJB AS mr, SecGlobalReviewHistoryEJB AS dr WHERE mr.groupingId = dr.itemId AND mr.itemId = ?1 AND mr.itemTypeId = ?2 AND dr.itemTypeId = ?3 AND dr.reviewDtTm >= ?4 ); - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "SELECT" at line 1, column 83.

      Was expecting one of:

          "ABS" ...

          "LENGTH" ...

          "LOCATE" ...

          "SQRT" ...

          "MOD" ...

          "(" ...

          <INTEGER_LITERAL> ...

          <FLOATING_POINT_LITERAL> ...

          <NUMERIC_VALUED_PARAMETER> ...

          <NUMERIC_VALUED_PATH> ...

          )

       

      Kindly help !

       

      Thanks,

      Rockeys