-->
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: Eager fetch is not done
PostPosted: Wed Dec 19, 2007 7:16 am 
Newbie

Joined: Mon Dec 17, 2007 11:50 am
Posts: 14
Hi there,

I have two classes:

public class Edge implements Serializable {

@Id
@GenericGenerator(name = "gen", strategy = "uuid")
@GeneratedValue(generator = "gen")
private String id;

@OneToMany(mappedBy="edge", fetch=FetchType.EAGER)
@IndexColumn(name="id")
private List<Lane> lanes = new ArrayList<Lane>();

public List<Lane> getLanes() {
return lanes;
}

public void setLanes(ArrayList<Lane> lanes) {
this.lanes = lanes;
}
}

---------------------------
@Entity
@Table(name="lanes")
public class Lane implements Serializable {

@Id
@GenericGenerator(name = "aName", strategy = "uuid")
@GeneratedValue(generator = "aName")
private String Id;

@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name="edge")
private Edge edge;

public Edge getEdge() {
return edge;
}

public void setEdge(Edge edge) {
this.edge = edge;
}
}

---------------------------------

In my understanding of eager fetch, all corresponding Lanes should be loaded, when I load an edge. Unfortunately, this is not done. The same problem occurs while saving. When I persist an edge, its lanes are not persisted. Does anyone know, what could be the problem?


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.