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

    How to add the @NamedQuery in Entity class

    ferdaus87

      Hello All,

       

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

       

      The query is joining 3 tables S below:

      compound_property

      logical_operator

      rtp_goal

      rtp

       

      -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