Hi all!!
I have a problem with 2 entities.
Example:
Code:
@Entity
public class Person{
.....
@ManyToOne
@JoinColumn(name="id_adress")
private Address address;
......
}
and
@Entity
public class Address{
.....
@Id
@Column(name="id_address")
private Long idAddress;
private String name
......
}
When I save or update a person with its Address, in the DDBB all is saved fine and there are no problems there.
But, when I want to obtain this person back, all the Address fields are null (except the id). This happens only the first time that I try to obtain it.
After that all the data is retrieved.
I try to find the Address by its id and set it to Person, but the quey that returns the Address brings all null too (except the id).
There is some annotation to force to retrieve alldata allways? or some way to refresh the Address object?
Thanks!