This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Configuration

 
Devaki Nihar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using orion1.5 .
Can anyone please tell me what configuration i have to do for the finder methods in ejb-jar.xml
and orion-ejb-jar.xml
I recognized 2 ways while studying -
1)
in the <entity> tag of ejb-jar.xml add
<query>
<query-method>
<method-name>findByEmployeeName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>
SELECT OBJECT(k) FROM Employee AS k WHERE k.ename=?1
</ejb-ql>
</query>
and no mapping in orion-ejb-jar.xml
2)
in <entity> tag of ejb-jar.xml add
<query>
<query-method>
<method-name>findByEmployeeName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql></ejb-ql>
</query>

and in <entity-deployments> tag of orion-ejb-jar.xml

<finder-method query="$ename = $1">
<method>
<ejb-name>Employee</ejb-name>
<method-name>findByEmployeeName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</method>
</finder-method>

which is the correct one?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic