Results 1 to 4 of 4

Thread: HibernateTemplate null ?

  1. #1
    Join Date
    Aug 2005
    Posts
    14

    Default HibernateTemplate null ?

    I have such piece of code :

    List<UserStatuses> status = getHibernateTemplate().find(
    "from UserStatuses us where us.statusData=?",data);
    if (status == null) {
    return null;
    }
    logger.info("blabla: " + status.get(0).getHibernateTemplate());

    i get blabla: null, so getHibernateTemplate() returns null while instantiated from objects returned by "find", UserStatuses class is "public class UserStatuses extends HibernateDaoSupport", so, what's the problem ? should i instantiate on each object returned by find "setHibernateTemplate" ? or what ?

    thanks in advance, mn

  2. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    Your domain objects shouldn't extend HibernateDaoSupport - that class is intended for DAOs only.

    Rob
    Rob Harrop
    Lead Engineer, dm Server
    SpringSource
    http://www.springsource.com

    Co-Author - Pro Spring

  3. #3
    Join Date
    Aug 2005
    Posts
    14

    Default but thats my DAO object

    well, but UserStatuses is one of my DAO objects, it has hbm.xml, and a few additional functions, like some finders -> one of them which i presented

  4. #4
    Join Date
    Aug 2005
    Posts
    14

    Default sorry

    seems i didn't quite get what's a domain object and whats a DAO object, sorry and thanks

    ,mn

Similar Threads

  1. Replies: 2
    Last Post: Oct 17th, 2005, 08:41 PM
  2. Replies: 2
    Last Post: Oct 13th, 2005, 02:47 PM
  3. Replies: 4
    Last Post: Sep 27th, 2005, 11:31 PM
  4. Replies: 3
    Last Post: May 16th, 2005, 07:04 AM
  5. Strange Data Access Error
    By webifyit in forum Data
    Replies: 2
    Last Post: Dec 28th, 2004, 11:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •