You want to use the findByXXX() methods, not the create method.

The create() method specifically creates a new entity bean, and therefore a
new row on the database.  What you want to do is to lookup existing rows,
which you can do using the findByXXX() methods.  They retrieve an existing
row (or rows) without creating any new records.



Good luck.


Jonathan





Raj wrote:
>
> Hi
>
> I am new to the EJB world and have a question which
> may appear too simple/fundamental but would appreciate
> some clarification.
>
> I need to write EJB's for an inquiry application which
> does not store or delete data from an already existing
> database.
> As per the specifiction, there should be one or more
> Create methods, Finder methods and destroy methods; as
> I will be writing the data access code within the
> bean( which is typical of BMP), is it mandatory that
> the create and post create has to be written with all
> the necesssary arguments(pl. bear in mind that I need
> not create any rows in the database).
>
> When I need to make a reference to the bean using
> home.create, I do not want any row to be created - is
> this possible ? ( but I believe that I do need to
> start with home.create to have a reference bean)
> As I need to retrieve data only, is it possible to
> directly call the finder methods?
>
> Any clarifications to the above is appreciated.
>
> THanks,
> RD
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year!  http://personal.mail.yahoo.com/
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

--
Jonathan Baker

Senior Architect
Internet Applications Division
Sybase, Inc.

[EMAIL PROTECTED]
+1 510 922-0460

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to