[jboss-user] [EJB3] - How to add the @NamedQuery in Entity class
Muhammad Firdaus
do-not-reply at jboss.com
Wed Feb 27 04:24:51 EST 2013
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:
https://community.jboss.org/servlet/JiveServlet/showImage/2-799823-20376/namedquery+error.jpg https://community.jboss.org/servlet/JiveServlet/downloadImage/2-799823-20376/450-178/namedquery+error.jpg
--------------------------------------------------------------
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]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130227/e5a329f6/attachment.html
More information about the jboss-user
mailing list