• 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

Hibernate: mapping results to ArrayList of Objects

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I need help figuring out why my results are not mapping entirely. I feel like I'm forgetting something. I've used this before in other code scenarios and it worked but it doesn't seem to work for me this time.

It's very simple and it comes down to this line of code



The size of the result items is correct (9).

I ran the hibernate sql statement that is logged in catalina.out against my SQL Developer and I get 9 DISTINCT records as there should be. However, when I iterate through the ArrayList of Objects (Checklist) only the first record in the array is displayed 9 times. This is how I am displaying my arraylist....



I don't know what I'm doing wrong and I'm stuck because it looks correct to me.

Thanks in advance.

 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It might help to look at your Checklist class to see if perhaps the getRequirement() method (and the others as well) access a static variable, or something like that.
 
laura mccord
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

Thanks for the quick response.

I verified that my Checklist domain class does not have any static variables (attached below). Could there be something in my hibernate configuration or application context that could be throwing something off?

Thanks,
Laura



 
Ranch Hand
Posts: 72
Hibernate Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Please provide the code of your Model/DAO class where you execute the Query..
 
Ranch Hand
Posts: 257
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you enabled any type of caching in the project ?
Can you please let us know your hibernate configuration and mapping ?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic