0 Replies Latest reply on Feb 27, 2013 4:24 AM by Muhammad Firdaus

    How to add the @NamedQuery in Entity class

    Muhammad Firdaus Newbie

      Hello All,


      I want to ask if someone know how to write the query inside @NamedQuery.


      The query is joining 3 tables S below:






      -rtp is the parent table for rtp_goal.

      -compound_property and logical_operator are both independent table which referencing inside rtp_goal table.


      My plain SQL query is like below:

      SELECT cp.compound_property_name,lo.logical_operator_name,cp.compound _property_value,cp.component_property_unit

      FROM ComponentProperty cp,LogicalOperator lo,Rtp r,RtpGoal rg

      WHERE cp.compound_property_id = rg.compound_property_id

      AND lo.logical_operator_id = rg.logical_operator_id

      AND r.rtp_id = rg.rtp_id;


      I tried to insert the above query inside @NamedQueries but it provides error as below:

      namedquery error.jpg