[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Data updated during aboutToInsert isnt getting persisted
|
Just an update to this post..
This is the code that is running just prior to the insert.
public void aboutToInsert(DescriptorEvent event) {
CpBuildingInterestLink bil = (CpBuildingInterestLink)
event.getObject();
if (bil.getInterestLinkId() == null) {
bil.setInterestLinkId(new
CpInterestLinkId(getCpInterestType().getInterestTypeId(),
cpBuilding.getBuildingId()));
}
}
I notice that both the entity that represents "this" object, and what I get
from event.getObject are one in the same. Initially I had thought they were
different.
khaskett wrote:
>
> I added the DescriptorEventListener to one of my Entities, and then in the
> aboutToInsert method, I added some code to update the EmbedddId field
> entry to the value of one the parent entities autogenerated id's. When I
> step through the code it stops just prior to that entity getting inserted,
> as I can see the parent entity getting inserted, and I can see the code
> execute in the aboutToInsert adding the appropriate values, but when it
> actually runs the insert it still has null as the value in the fields I
> had updated.
>
> Any ideas on why this is happening?
>
>
--
View this message in context: http://www.nabble.com/Data-updated-during-aboutToInsert-isnt-getting-persisted-tp25928146p25952969.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.