• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Confusion regarding adding fields in DAO & implementing the Runnable interface

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Yup, yup, yup. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic