Can someone explain in detail the different steps involved in adding 'finder' methods other than 'findByPrimaryKey' in IBM's VisualAge for Java?

Badri Kuppa

You can create finder methods in the Home Interface and give an SQL hint in the finderHelper class. For example if you want to create a finder method for userId then the method in the home interface would be like this.

ObjectToBeReturned findByUserId(String userId) throws java.rmi.RemoteException, javax.ejb.FinderException;

then in the finder helper class you can put this line..

public final static String findByUserIdWhereClause = "USERID = ?";

Remember, the String declaration in finderHelper class should be as above, i.e.,

you can replace the where clause by a select statement too!

I hope this helps you!


0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact