-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate annotations, DAO and persistence
PostPosted: Tue Jul 28, 2009 5:39 am 
Newbie

Joined: Tue Jul 28, 2009 5:27 am
Posts: 1
Hello everyone. Sorry for bothering with this question that, I'm sure, has a simple answer that I really cannot find out. I read articles over and over and still cannot find the answer.
So I'm using Hibernate annotations and dao stuff. Everything works perfectly: I can define beans with table information, declare relationships and collections etc.
I created some classes to manage access to data, like:
Code:
  public class UserManager extends HibernateDaoSupport implements IUserManager{
       //declarations
      public User getUser(String id){
             return (User) getHibernateTemplate().load(User.class,id);
      }
}

The objects are created using spring so I can inject session factory etc.
Here's my problem. The user returns correctly, but when I try to 1) access a lazy collection in it, or when I edit it and try to 2) update the db, it says that the 1) session is closed and the 2) object is detatched and cannot be updated
I'm sure I'm missing some obvious configuration aspect, or more probably, I'm missing the theory I mostly skipped because of urgency...
Any help will be extremely appreciated.
Thanks in advance


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.