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: Confusion regarding adding fields in DAO & implementing
PostPosted: Thu Jan 15, 2009 4:10 pm 
Newbie

Joined: Tue Jan 13, 2009 5:02 am
Posts: 1
Location: Kolkata
Hello, I am new to Hibernate & really having great trouble in understanding some issues.
My questions are:
    i) Suppose I add some extra methods & fields in a particular DAO class & for some rows of the corresponding table I instantiate the Class & put them in some kind of collection. Now if I call the load() or get() method, does the system get the unique object already present in the system & stored in my collection or does it again instantiate the class from the table? Because in the first case I get the values which I put in my custom added fields which are not in the table & in the later case the custom added fields contain default values.

    ii) Also I have to make the Class implement the Runnable interface since I have to store the objects of the class in some collection as tasks & periodically submit them to a thread pool (java.util.concurrent.ThreadPoolExecutor) for execution. Is this implementation going to hamper the normal working of Hibernate?

    iii) It would really be better if I could extend the DAO class instead of making changes into it directly & have Hibernate create objects of it instead of the parent class. (For example I have Person table so there is a Person DAO class, I extend it in the SpecialPerson class & want Hibernate to make objects of SpecialPerson class directly). If it is possible then what are the changes that are needed to be done in the xml files or in some other files?


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.