dcsimg
When is the primary key class populated when ejbCreate() is not called using BMP?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Pat_Hardy
Posted On:   Tuesday, May 7, 2002 10:15 AM

Hello,


If I have data in a database and I call ejbFindByPrimaryKey() without calling ejbCreate() first, using BMP, when is the PK class populated with the proper information and stored in the EntityContext?


I understand that the PK is populated in ejbCreate(), but what if the bean has already been created and you're locating it for the first time? In ejbLoad(), to ensure you have the right key, you need to call ctx.getPrimaryKey() to get the PK, but how did it get there in the first place?


Thanks.

Re: When is the primary key class populated when ejbCreate() is not called using BMP?

Posted By:   Pat_Hardy  
Posted On:   Tuesday, May 7, 2002 10:23 AM

Folks, scratch that question.


What I meant to ask was:


If I have data in a database and ejbLoad() is called without calling ejbCreate() first, using BMP, when is the PK class populated with the proper information and stored in the EntityContext?


The answer: ejbFindByPrimaryKey() is called and returns the PK. The container then sets the PK in the EntityContext and then ejbLoad() is called.


If I am wrong. Someone please let me know. I'm trying to understand how things work using BMP.


Thanks.

About | Sitemap | Contact