Great! Note, you could reduce the verbosity by getting rid of the
interface, NOT registering a service and using @Autobuild
Ie:
@Startup
public static void initHibernateEventListener(@Autobuild
HibernateInitializerImpl hi) {
hi.initialize();
}
Thanks Lance, got it working.
public interface HibernateInitializer {
public void initialize();
}
public class HibernateInitializerImpl implements HibernateInitializer {
@Inject
SolrIndexer solrIndexer;
@Inject
private HibernateSessionSource hss;
@Override
public v
I'm not convinced you should be doing this in a HibernateConfigurer since
you need the SessionSource. HibernateConfigurers are executed before the
SessionFactory exists.
Can you add the listener in a @Startup method or some @EagerLoad service?
Thanks Thiago, sometimes its to easy :).
Now I've got everything injected, but my
EventListenerHibernateConfigurer still don't work:
java.lang.RuntimeException: Exception constructing service
'ValueEncoderSource': Error invoking service contribution method
org.apache.tapestry5.hibernate.modu
On Sun, 15 Dec 2013 12:08:53 -0200, Matthias
wrote:
in AppModule
public static void
contributeHibernateSessionSource(OrderedConfiguration
config) {
config.add("EventListener", new
EventListenerHibernateConfigurer());
}
If you use the 'new' keyword directly, no inje
Hi, today I tried to add some hibernate event listeners to my
application. This was my first naive approach:
in AppModule
public static void
contributeHibernateSessionSource(OrderedConfiguration
config) {
config.add("EventListener", new
EventListenerHibernateConfigurer());
}