I meant that the hibernate-implementation is bad design here. Having a method: getExecutableCriteria(Session session) to me would mean that any object adhering to the interface Session could be passed as a parameter. However getExecutableCriteria really needs a SessionImpl to be passed so that should have been the type of the param.
Filip S. Adamsen-2 wrote: > > Hi, > > The problem here is that the proxy generated by Tapestry doesn't > implement SessionImplementor. You'll have to get the SessionFactory and > grab a Session from there if you want to do this. > > I don't use tapestry-hibernate so that's all I can say about that. > > By the way, the Session/SessionImplementor interfaces and the way > they're used isn't bad design - it's exactly what interfaces are for. :) > > -Filip > > Britske skrev: >> When injecting a (hibernate) Session a proxy to the actual session is >> returned. >> >> However, when using the session in a lot of my dao-services I need to >> have >> access to the 'real' underlying session instead of just the proxy. >> >> Is there a way to do this? >> >> >> Some background: >> after revisioning my dao/repository layer a bit I want to rely on >> hibernate's DetachedCriteria for a lot of queries. THis basically enables >> you to build hibernate criteria's without having a session handy. (very >> useful in the light of MVC, etc. ) However, when actually executing these >> detachedcriteria through detachedcrit.getExecutableCriteria(Session >> session) >> a 'real' session has to be supplied since the method makes uses the >> underlying implementation instead of just the session-interface. (bad >> design, I know) >> >> Anyone? > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/T5%3A-possible-to-get-the-%27real%27-object-instead-of-a-proxy--tp18400135p18409536.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]