Hi All,
Could someone who knows OpenJPA through code(!), clarify this? I think, I'm
also running into the same problem! I've a simple entity with :
@preUpdate public void preUpdate() {
setLastUpdatedOn(new Date());
}
I see in SQL trace logs that one additional query with lastUpdatedOn and
version columns being printed!(without @preUpdate it's not executed). I also
noticed that org.apache.openjpa.event.AbstractLifecycleListener has
beforePersist(event), beforeStore(event), and on entityManager.merge(entity);
beforePersist is called if it's a new entity else only beforeStore is
called. There is no preUpdate method.
What is correct api to use in the above scenario?
Thanks in advance,
Shambhu.
On 9/20/07, Gene Woo <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> When I try to persist a brand new entity instance into database. What's
> the
> correct sequence of interceptor's invocation? The result I got is:
>
> persist
> @PrePersist
> @PostPersist
> commit
> @PreUpdate
> @PostUpdate
>
> I just doubt openjpa invokes "update" interceptors after commit.
>
> --
> Best Regards,
>
> Gene Woo
>