• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

One-to-Many Relationship Returns No Records

 
Wally Hartshorn
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an existing JPA/Hibernate application. I'm adding a new table to the database and am adding a one-to-many link from an existing table.

However, when I try to access the records from the new table via that one-to-many relationship, I get no records returned.

In the Absence class for the new table, I have these lines:


In the Employee class for the existing table, I have these lines:


In another class, I'm doing this:


I don't get an error, but I don't get any records, either. When I check the log, I find that the call to absence.size() returned 0.

I get exactly what I expect when I try this query:


What am I doing wrong?
 
Wally Hartshorn
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the lack of responses indicate that more information is needed, or does it indicate that what I posted looks correct so I must be doing something stupid elsewhere?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic