Announcement Announcement Module
Collapse
No announcement yet.
HibernateTemplate null ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Your domain objects shouldn't extend HibernateDaoSupport - that class is intended for DAOs only.

    Rob

    Comment


    • #3
      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

      Comment


      • #4
        sorry

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

        ,mn

        Comment

        Working...
        X