p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional Java Development with the Spring Framework (http://p2p.wrox.com/forumdisplay.php?f=181)
-   -   Page 273 - HibernateCallbackHandler (http://p2p.wrox.com/showthread.php?t=33212)

interrom September 8th, 2005 07:05 AM

Page 273 - HibernateCallbackHandler
 
On page 273, retruntype of HibernateCallback.doInHibernate(Session session) is wrong.

Correct Code:
Code:

public Collection getVets() throws DataAccessException {
        return getHibernateTemplate().executeFind(
            new HibernateCallback() {
                public Object doInHibernate(Session session)
                    throws HibernateException
                {
                    Query query = session.createQuery(
                            "from Vet vet order by vet.lastName, vet.firstName");
                    // further customization of the query object
                    return query.list();
                }
            });
    }



All times are GMT -4. The time now is 02:46 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.