openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henno Vermeulen <>
Subject RE: Fetchgroups recursion problem
Date Wed, 07 Nov 2012 08:34:45 GMT
I'm not sure I can help, but I may have seen some similar performance problems in my code.
What is the query you use? What do you mean by class C is not eagerly fetched?

>From your post I assume that you are querying for an A object. In my case when I did that,
some related objects (like C in your case) are fetched, but with way too many queries than
you would use when hand writing the queries.
So do you really mean that C is not yet fetched when querying for A or do you mean that when
you query for A you can see from OpenJPA's trace that C is fetched with way too many queries
(N + 1 select problem)?


-----Oorspronkelijk bericht-----
Van: Sirisha Chiruvolu [] 
Verzonden: zaterdag 3 november 2012 16:03
Onderwerp: Re: Fetchgroups recursion problem

I have  below domain classes

@FetchGroup(name="Group1", attributes={
	 Class A{

	@JoinColumn(name="CASE_UID", nullable=false, insertable=false,
	private ClassB aCase.....

Class B{

	@OneToMany(mappedBy = "aCase", fetch = FetchType.Lazy)
	private List<Class C> caseList;...
Class C{


Class Test{

 OpenJPAEntityManager oem = OpenJPAPersistence.cast(em); 

My problem is Class C records are not getting eagerly fetched, there are
sperate queries that are getting fired . I want to fetch all the records in
a single query.

Can anyone help me..

		OpenJPAQuery q1=oem.createQuery(statement.toString());

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message