No .. its not what i mean .. I am confused .. when an object of an Entity Bean will be constructed ? when i invoke ejbCreate() or ejbFindByPrimaryKey() or what ?
Let say .. you want to update a record with the enity bean after you up your Enterprise App. You will need an entity bean object that represents the record right ? and if the object is already in JVM, you call ejbFindByPrimaryKey() to get the reference, after that you can call any methods inside the object. If The object of entity bean isnt in JVM yet, how can i create the object ? >From all my understanding, ejbCreate() will create an entity object and add a record into database. But how about if the data already in database and i just wanna create the object that represents the record data ? === === thx, a Java Addicted ----- Original Message ----- From: "Ashwani Kalra" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 27, 2002 2:50 PM Subject: Re: EntityBean > You are confusing when ejbCreate is called. It is called when you invoke one > of the create methods in the home interface. ejbFindByPrimaryKey is called > for getting the existing records. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Thanks > Ashwani Kalra > Sr. Mem. Dev. Staff > Aithent Technologies > http://www.geocities.com/ashwani_kalra/ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > -----Original Message----- > From: A mailing list for Enterprise JavaBeans development > [mailto:[EMAIL PROTECTED]]On Behalf Of JavaSoft > Sent: Wednesday, March 27, 2002 12:16 PM > To: [EMAIL PROTECTED] > Subject: EntityBean > > > Hi guys > I am confused about ejbFindByPrimaryKey() method. It said that the method > will return reference to the object of the Primary Key. > > My question is when Entity Bean Object will be created ? if the answer is > when invoking ejbCreate(), how about if in the table, there're some datas > already before My Enterprise App. up ? I dont think i need to invoke > ejbCreate() to create object of a record data that already exist in the > table when I up my Enterprise Application right ? > And the datas in the table could be from the admin enter it directly to the > table or migrate from another database. > > So what i will get if i invoke ejbFindByPrimaryKey() without invoking > ejbCreate() first ? > > === > thx, > a Java Addicted > > =========================================================================== > 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". > > =========================================================================== > 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". > =========================================================================== 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".
