Muhammad Firdaus
2013-02-27 09:24:51 UTC
Muhammad Firdaus [https://community.jboss.org/people/ferdaus87] created the discussion
"How to add the @NamedQuery in Entity class"
To view the discussion, visit: https://community.jboss.org/message/799823#799823
--------------------------------------------------------------
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:
Loading Image... Loading Image...
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/799823#799823]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
"How to add the @NamedQuery in Entity class"
To view the discussion, visit: https://community.jboss.org/message/799823#799823
--------------------------------------------------------------
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:
Loading Image... Loading Image...
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/799823#799823]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]