On Monday 27 October 2008 20:08:44 Dhanji R. Prasanna wrote:
> On Tue, Oct 28, 2008 at 1:06 PM, Timothy Braje <[EMAIL PROTECTED]> wrote:
> > This may not be the best forum for this, but I was wondering if you
> > thought of
> > implementing the @PersistenceContext annotations like Spring has. One
> > thing I
> > like about Spring's JPA support is the ease of use. For example:
> >
> > public class Dao {
> >
> > @PersistenceContext EntityManager em;
> >
> > @Transactional public Foo getFoo(Integer id) {
> > return em.find(Foo.class, id);
> > }
> > }
> >
> > Last time I tried warp-persist, it wasn't quite this simple. Of course,
> > I haven't used it in a while...
>
> @Inject is 12 characters shorter =D
>
> Dhanji.
Good point, but I remember having to do more work in the content of the
method, dealing with transactional semantics. Also, if I remember correctly,
you have to inject a Provider<EntityManager> and then a emProvider.get()
rather than just em.<callmethod>.
Am I totally mis-remembering or off-base here? How would the above method be
implemented with warp?
Tim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---