• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate: mapping results to ArrayList of Objects

 
laura mccord
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • 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.

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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: 108
  • Mark post as helpful
  • send pies
  • 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



 
Gopakumar Naryanan
Ranch Hand
Posts: 72
Eclipse IDE Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Please provide the code of your Model/DAO class where you execute the Query..
 
Salil Vverma
Ranch Hand
Posts: 257
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
  • 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 ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic