You'll definitely drive yourself crazy if you are hoping this will be clear from the ejb-jar.xml descriptor content. The real mechanics are container-specific, and much clearer with some containers like
JBoss.
As far as ejb-jar.xml and the bean callback methods are concerned, you can think of it like this:
0. before ejbCreate, the container doesn't know the pk
of the new entity.
1. ejbCreate() populates the data for the current entity,
including the fields necessary to define the pk, but
excluding any CMR foreign-key references.
2. After ejbCreate, but before ejbPostCreate, the container
knows the pk for your new entity.
3. ejbPostCreate() deals both with storing foreign keys
into your new entity, *and* providing your pk as a
foreign key value to other entities (remember, your
deployment descriptor might specify that the relationship
is navigable in both directions).