On Mon, Oct 29, 2012 at 8:17 AM, Igor Drobiazko
<igor.drobia...@gmail.com> wrote:
> Hi Kalle,
> sure, why not? What exactly is needed?

I was hoping you would know :) The entity-listener currently takes a
class as a parameter:
<persistence-unit-metadata>
        <persistence-unit-defaults>
            <entity-listeners>
                <entity-listener
class="za.co.yellowfire.solarflare.jpa.SearchIndexListener">
                    <post-persist method-name="postPersist"  />
                    <post-remove method-name="postRemove"  />
                </entity-listener>
                <entity-listener
class="za.co.yellowfire.jpa.DomainEntityListener">
                    <pre-persist method-name="prePersist"  />
                    <pre-update method-name="preUpdate"  />
                </entity-listener>
            </entity-listeners>
        </persistence-unit-defaults>
</persistence-unit-metadata>

But in JPA 2.1 an entity listener can be a CDI injected instance (see
http://blog.ringerc.id.au/2012/06/jpa-21-will-support-cdi-injection-in.html).
What I don't know is what the configuration looks like. EclipseLink
2.5.0 will be JPA 2.1 compliant. It's still early for 2.5.0 (GA is
mid-2013) but the milestone releases will probably start supporting it
soon. For us, it's certainly easy to autobuild the listener but
there'd have to be something in the spec to hand it out to the JPA
provider. I'm currently doing the same in an implementation specific
way.

Kalle

>
> On Fri, Oct 26, 2012 at 12:17 AM, Kalle Korhonen <kalle.o.korho...@gmail.com
>> wrote:
>
>> Hey Igor & all, is anybody tracking the JPA 2.1 work and/or
>> integrating with the bleeding edge? I'd love to use injectable
>> EntityListeners, as is (in 2.0) they are pretty restrictive. Looks
>> like Tapestry will need to add a bit of support to make the CDI happen
>> once the spec's finalized.
>>
>> Kalle
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: dev-h...@tapestry.apache.org
>>
>>
>
>
> --
> Best regards,
>
> Igor Drobiazko
> http://tapestry5.de
> http://twitter.com/drobiazko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tapestry.apache.org
For additional commands, e-mail: dev-h...@tapestry.apache.org

Reply via email to