Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Lazy load on OneToMany mapping does not work
Lazy load on OneToMany mapping does not work [message #644899] Tue, 14 December 2010 11:37 Go to previous message
Matti Hansson is currently offline Matti Hansson
Messages: 68
Registered: July 2009
Member
Hi!
I'm using EclipseLink 1.1.4 to map a relationship where an "AreaSurface" can belong to several "Area". By querying Area by id I get the Area and its AreaSurface, but if I use a geometry query I get the AreaSurface but not its Areas. The log shows that a database query is prepared
[EL Fine]: ClientSession(15830327)--Connection(29407392)--SELECT FKFOGGUID, FNR_FR, AREANR FROM AREA WHERE (FKFOGGUID = ?)
	bind => [859269b6-5200-49ab-b47f-785c4c305d4d]

but never executed. I do get the Areas if I set the OneToMany mapping in AreaSurface to eager. Any idea what may be wrong?

Here are the classes:
@Entity
public class AreaSurface {
  
  @Id
  @Column(name = "GUID")
  private String uuid;
  
  @StructConverter(name = "GeometryConverter",
      converter = ConverterType.GEOMETRY_CONVERTER)
  @Convert("GeometryConverter")
  @Column(name = "SHAPE", columnDefinition = "MDSYS.SDO_GEOMETRY", nullable = false)
  private Geometry geometry;
  
  @OneToMany(mappedBy = "areaSurface") //if fetch = FetchType.EAGER is set it works
  private List<Area> areas;

  // Getters and setters..
  
}

@Entity
public class Area{
  
  @Id
  @Column(name = "FKFOGGUID")
  private String fkfogguid;
  
  @Column(name = "FNR_FR", insertable = false, updatable = false)
  private String areaId;
  
  @Column(name = "AREANR")
  private int areaNumber;
  
  @ManyToOne()
  @JoinColumn(name = "FKFOGGUID", referencedColumnName = "GUID", insertable = false, updatable = false)
  private AreaSurface areaSurface;
  
  // ...
  
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:CacheRetrieveMode.BYPASS of EclipseLink is not useful.
Next Topic:How can I query all past versions of an object with eclipselink?..
Goto Forum:
  


Current Time: Tue May 21 21:59:34 EDT 2013

Powered by FUDForum. Page generated in 0.01743 seconds