posted 20 years ago
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?