This hasn't gone away per se, just that the Hibernate-specific elements of the PersistenceService has been abstracted out for modularization reasons. But fear not, there's a HibernatePersistenceService that extends the generic PersistenceService. In a custom page of trails-hibernate application, you might have:
@InjectObject("spring:persistenceService")
public abstract HibernatePersistenceService getPersistenceService();
Check the javadocs for trails-hibernate, e.g:
http://www.trailsframework.org/constant/site/modules/trails-hibernate/apidocs/index.html. It has all of the DetachedCriteria-based operations that used to be in PersistenceService, albeit with slightly changed signatures in some cases.
Also, check the examples. All of them are using trails-hibernate and instantiating HibernatePersistenceServiceImpl as "persistenceService" bean (except for examples-security, which is using SecurePersistenceImpl that derives from HibernatePersistenceServiceImpl).
Kalle
On 10/5/07, Mark Dzmura <mark.dzmura@...> wrote:
Following some examples in Trails 1.0, I was using the PersistenceService with Hibernate detached criteria, and things were working well for me.
I have written a considerable amount of back-end code (non-webapp) using this method. Now I'm trying to upgrade some of the code to Trails
1.1,
and according to the 1.1 Javadocs the PersistenceService interface has seemingly become simpler, with no way to create a general query.
Did this capability go away for a good reason? Is there a better alternative means of doing this? I could get a hibernate session and use hibernate directly,
but I am new to hibernate and tapestry and am trying to keep things at the Trails level as much as possible at this point.
What is "best practice" for database access in the trails world?
Thanks,
Mark