-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Fetch problem after save/update
PostPosted: Wed May 27, 2009 4:15 pm 
Newbie

Joined: Thu Mar 19, 2009 2:17 pm
Posts: 1
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.