Hello,
try with this snippet :
import javax.inject.Inject;
import javax.persistence.EntityManager;
import org.hibernate.Session;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
public class ProvideHibernateSessionModule extends AbstractModule {
@Override
protected void configure() {
}
@Provides @Inject
protected Session providesHibernateSession(EntityManager entityManager)
{
return (Session) entityManager.getDelegate();
}
}
2011/12/1 beastieboy <[email protected]>
> That would be great to have access in guice-persist to hibernate
> specific features like ScrollableResults or Criteria. Is there any
> easy way to have org.hibernate.Session injected? The warp-persist
> examples did not work for me (@Inject Provider<Session> session).
>
> --
> 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.
>
>
--
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.