This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

inclusion of more than one finder method in CMP 2.0 using websphere 5.0

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Findbyprimary key method works fine in CMP 2.0 as Websphere 5.0 an appserver. But for other finder methods finderhelper interface and finderobject class is required. In finder object class it is mentioned about super class given below... com.ibm.vap.finders.VapEJSJDBCFinderObject
where do you find the above class to set in classpath.
The code for finderobject class is :
package vivek;
//import com.ibm.vap.finders.VapEJSJDBCFinderObject ;
/**
* Implementation class for methods in
* AccountBeanFinderHelper.
*/
public class AccountBeanFinderObject extends
com.ibm.vap.finders.VapEJSJDBCFinderObject
implements
AccountBeanFinderHelper {
public java.sql.PreparedStatement
findBigAccounts(double balance)
throws Exception {
PreparedStatement ps = null;
int mergeCount = getMergedWhereCount();
int columnCount = 1;
ps = getMergedPreparedStatement("a.balance > ?1");
for (int i=0; i <(columnCount*mergeCount); i=i+columnCount) {
ps.setInt(i+1, balance);
}
return ps;
}
}
and for finderhelper interface is:

package vivek;
//import com.ibm.vap.finders.VapEJSJDBCFinderObject ;
public interface AccountBeanFinderHelper
{
public java.sql.PreparedStatement
findBigAccounts(double db)
throws Exception;
String findBigAccountsWhereClause="select * from containermanaged
where balance > ?1";
}

can anyone help me out ..............
if any other details are required let me know.......
Thanks.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ack! No! That is the OLD, OLD way of doing things from WebSphere 3.5! We didn't even recommend that in WebSphere 4.0, much less 5.0!
WebSphere 5.0 fully supports EJB 2.0 -- that means you should use EJB-QL to specify finder methods inside the Deployment Descriptor exactly as that is defined in the spec. Read the spec, the InfoCenter or Richard Monson-Haefel's book for information on using EJB-QL.
Kyle
 
viv shar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply kyle........
This means changes only in: ibm-ejb-jar-ext.xmi
will resolve the matter or i have to add finderhelper and finederobject class also in the same package which contains beans and related classes.
below is the code for ibm-ejb-jar-ext.xmi....is it correct....if it is, it still is not working....
< ?xml version="1.0" encoding="UTF-8"? >
< ejbext:EJBJarExtension xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ejbext="ejbext.xmi" xmlns:ejb="ejb.xmi" xmi:id="ejb-jar_ID_Ext" >
< ejbExtensions xmi:type="ejbext:ContainerManagedEntityExtension" xmi:id="ContainerManagedEntity_1_Ext" concurrencyControl="pessimistic" >
< enterpriseBean xmi:type="ejb:ContainerManagedEntity" href="META-INF/ejb-jar.xml#ContainerManagedEntity_1"/ >
< finderDescriptors xsi:type="ejbext:FullSelectFinderDescriptor" xmi:id="FullSelectFinderDescriptor_1" selectStatement="SELECT OBJECT(a) FROM ContainerManaged AS a WHERE a.balance > ?1" > < finderMethodElements xmi:id="MethodElement_10" name="findBigAccounts" parms="double" type="Home" > < enterpriseBean xsi:type="ejb:ContainerManagedEntity" href="META-INF/ejb-jar.xml#ContainerManagedEntity_1"/ > < /finderMethodElements > < /finderDescriptors >
< structure xmi:id="BeanStructure_1" inheritenceRoot="false"/ >
< beanCache xmi:id="BeanCache_1" activateAt="TRANSACTION" loadAt="TRANSACTION"/ >
< localTran xmi:id="LocalTran_1" boundary="BEAN_METHOD" unresolvedAction="ROLLBACK"/ >
< /ejbExtensions >
< ejbJar href="META-INF/ejb-jar.xml#ejb-jar_ID"/ >
< /ejbext:EJBJarExtension >
can u give the steps required to be followed for successfull set up........thanks...in adv.
vivek.
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Viv -- are you using WebSphere 4.0 or 5.0? You only put EJB-QL in the IBM extension descriptor for EJB 1.1 (WebSphere 4.0). For 5.0 it goes in the actual EJB Deployment Descriptor as defined in the EJB 2.0 spec. If you are working in EJB 4.0, I don't recommend using EJB-QL -- use SQL as described in my EJB workbook.
Kyle
 
viv shar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank u very much kyle...............
I got it right now after lots of confusion........
thanks once again.........
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic