Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@Embedded not loading with owner entity

 
john lazeraski
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a User entity and Address entity that is marked @Emeddable, it has not @Table, no @Id, etc. I am doing much like many examples out there with a User and Address setup, where Address is embedded. I am able to persist the address no problem. But when I retrieve the User which IS found, the Address object is not null, but the fields in it are. The data is in the DB columns correctly. To add a twist to this, I have a State and Country entity, both of which are mapped as @OneToOne in the Address entity. Those DO load correctly. So user.getAddress().getState().getId() works. But user.getAddress().getCity() is null.

Any clue why this might be?
 
Vijitha Kumara
Bartender
Pie
Posts: 3918
10
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the relevant code fragments for this?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic