-->
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.  [ 5 posts ] 
Author Message
 Post subject: does FetchProfile work in HQL ?
PostPosted: Fri Feb 15, 2013 1:14 pm 
Newbie

Joined: Mon Dec 01, 2003 12:41 pm
Posts: 12
Location: Aix en Provence, France
dear all,
I can't make Fetch Profiles work with HQL.
I used it succesfully with the (old) native Criteria and with session.get() API, but not with HQL.
is it normal ?
thanks

the following does not work :
Code:
   @Override
   public List<Country> findAllFetchProfileCities() {
      getSession().enableFetchProfile("countryCities");
      boolean enabled = getSession().isFetchProfileEnabled("countryCities");
      List<Country> list = getSession().createQuery("from Country").list();
      enabled = getSession().isFetchProfileEnabled("countryCities");
      return list;
   }

the following works OK :
Code:
   @Override
   public Country findOneFetchProfileCities(Long _id) {
      getSession().enableFetchProfile("countryCities");
      Country c = (Country) getSession().get(Country.class, _id);
      return c;
   }

   @Override
   public List<Country> findAllCriteriaFetchProfileCities() {
      getSession().enableFetchProfile("countryCities");
      return getSession().createCriteria(Country.class).list();
   }

_________________
Gauthier P.


Top
 Profile  
 
 Post subject: Re: does FetchProfile work in HQL ?
PostPosted: Fri Dec 13, 2013 10:33 am 
Newbie

Joined: Fri Dec 13, 2013 10:22 am
Posts: 4
Hi Gauthier,

I have the same problem as you using a ProjectionList on a session using a FetchProfile...

did you resolve your previous problem ?

thx

i42
---
Salut Gauthier,

j'ai le mm problème que toi lorsque j'utilise une ProjectionList sur une session qui se sert d'un FetchProfile

As tu réussi à résoudre ton problème ?

merci (d'avance)

i42


Top
 Profile  
 
 Post subject: Re: does FetchProfile work in HQL ?
PostPosted: Fri Dec 13, 2013 10:44 am 
Newbie

Joined: Mon Dec 01, 2003 12:41 pm
Posts: 12
Location: Aix en Provence, France
No I guess, it simply doesn't work !
I've had no response from stackOverflow either.

_________________
Gauthier P.


Top
 Profile  
 
 Post subject: Re: does FetchProfile work in HQL ?
PostPosted: Fri Dec 13, 2013 11:19 am 
Newbie

Joined: Fri Dec 13, 2013 10:22 am
Posts: 4
so have you find any way to bypass this problem to functionnaly reach your original goal ?


Top
 Profile  
 
 Post subject: Re: does FetchProfile work in HQL ?
PostPosted: Thu Sep 18, 2014 11:27 am 
Newbie

Joined: Thu Sep 18, 2014 11:15 am
Posts: 1
Hi,

I have encountered the same issue (v 4.2.12). There seem to be part of answer in that Hibernate ticket:

See the: Steve Ebersole added a comment - 22/Oct/2009 15:53 PM

https://hibernate.atlassian.net/browse/HHH-3414

Basically HQL does not honor fetch-profiles.

Let me know if you have any other information regarding that please.

Thx


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.