| Author |
@Embedded not loading with owner entity
|
john lazeraski
Greenhorn
Joined: Nov 14, 2011
Posts: 27
|
|
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
Joined: Mar 24, 2008
Posts: 3670
|
|
|
Can you post the relevant code fragments for this?
|
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
|
 |
 |
|
|
subject: @Embedded not loading with owner entity
|
|
|