-->
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.  [ 2 posts ] 
Author Message
 Post subject: Fetch Type Eager But related object not retrieved
PostPosted: Tue Sep 25, 2007 4:42 pm 
Newbie

Joined: Mon Aug 27, 2007 9:36 am
Posts: 5
Hi guys, I am using JBoss 4.0.5.GA, PostgreSQL 8

I hope this is not so newbie question, I was an EJB2 developer in the past, and I made the switch to EJB3 with Hibernate, I have an entity defined like this:

Code:
@Entity
@Table(name="USER")
public class User implements Serializable {
   
   private Long id;
   private String full_name;
   private String username;
        private Level level;

[...]
   
   @OneToOne(fetch=FetchType.EAGER,cascade=CascadeType.MERGE)
   public Level getLevel() {
      return level;
   }
   public void setLevel(Level level) {
      this.level = level;
   }


"Level" is another entity, and a table One to One relation at Database.

The problem is that when I retrieve one "User" from the DB the "level" object is not being populated (it is null), even that I set the Fetch Type to Eager.

What am I missing?
Thanks!

_________________
http://www.freebsd.org


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 26, 2007 8:59 am 
Newbie

Joined: Mon Aug 27, 2007 9:36 am
Posts: 5
anyone ? :'(

_________________
http://www.freebsd.org


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

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.