• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

purpose of ejbPostCreate method

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

Can anybody explain me the purpose of having the ejbPostCreate<method> , what are the responsibity of ejbCreate<method> and what left to do in the post create method and one more thing if there is no create method , then how entity will be created ,is it created by finder method ?

Thanks in advance.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I won't give you a full answer, as it is too long to explain.
Basically, after ejbCreate has been called, the entity exists and has a primary key.
What you can do in doPostCreate is setting the CMR fields for example.
You can get the primary key by calling getPrimaryKey(). You can pass a reference to the component interface of the bean to another bean.


if there is no create method , then how entity will be created ,is it created by finder method ?


You're misunderstanding the concept of ejbCreate. ejbCreate will insert some data in a persistent store.
Finder methods only looks for data, and the retrieved data is set into a bean by the container.
Create methods are not called here.
 
Gaurav Chugh
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks you.
 
Never trust an airline that limits their passengers to one carry on iguana. Put this tiny ad in your shoe:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic