Yes the entityManager is created by guice.
But the entities that you retrieve from the DB are not created by guice
and therefore the interceptor does not work.
On 14.08.2016 16:51, Travis Collins wrote:
I'm running a small test that uses a Guice managed JPA context. It's
working very well.
I have created some custom annotations on the entity classes. These
annotations are generally used to validate values on setters. I'm
using the Guice binder.bindInterceptor(...) method to intercept method
calls and validate values.
When I use a Guice Provider<> to instantiate new instances of these
classes, the annotation interceptors are working correctly.
However, when I retrieve a JPA object from the persistence context,
the custom annotation interceptors are not being called. For example,
if I get an entity instance using the JPA entity manager, and then try
to set an invalid value on that object - the interceptor is not called
and the invalid value is allowed.
I have verified that the entityManager being used is Guice provided.
Any ideas?
--
You received this message because you are subscribed to the Google
Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-guice/7c493f80-dcf4-427f-9706-36283ae7160d%40googlegroups.com
<https://groups.google.com/d/msgid/google-guice/7c493f80-dcf4-427f-9706-36283ae7160d%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-guice/fa9eb442-483f-71f2-6300-3f2f3685b840%40gmx.ch.
For more options, visit https://groups.google.com/d/optout.