-->
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.  [ 9 posts ] 
Author Message
 Post subject: Hibernate Warning of Deprecated MEMBER OF syntax
PostPosted: Wed Dec 16, 2015 10:00 am 
Newbie

Joined: Wed Dec 16, 2015 9:57 am
Posts: 5
On Hibernate 5 I receive the following warning: deprecation: HHH90000016: Found use of deprecated 'collection property' syntax in HQL/JPQL query [null.elements]; use collection function syntax instead [elements(null)].

Essentially Hibernate 5 deprecated the JPQL 'MEMBER OF' syntax in favor of the JPQL inner join syntax. My question is essentially why? Is it worth changing from the MEMBER OF syntax to INNER JOIN? I'm curious what the reasoning is.

Thanks in advance,
Steve


Top
 Profile  
 
 Post subject: Re: Hibernate Warning of Deprecated MEMBER OF syntax
PostPosted: Wed Dec 16, 2015 10:26 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
It's not the MEMBER OF which got deprecated, it's the collection properties that were dropped in favor of functions.
MEMBER OF is JPA 2.0 compliant, so it shouldn't be depreciated.

This is the issue:

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


Top
 Profile  
 
 Post subject: Re: Hibernate Warning of Deprecated MEMBER OF syntax
PostPosted: Wed Dec 16, 2015 10:40 am 
Newbie

Joined: Wed Dec 16, 2015 9:57 am
Posts: 5
I appreciate your response. Good to know that MEMBER OF is respected. Now I am confused as to why the warning is being issued at all as I am not using collection properties to my knowledge.

Here is a good example from StackOverflow which illustrates the problem: http://stackoverflow.com/questions/33338186/how-to-remove-hibernate-deprecation-warning-message
I'll insert the stackoverflow query herein for simplicity:

Code:
List<Book> books = session.createQuery(
       "from Book b where :x member of b.bookCategories")
       .setParameter("x", crimeStory)
       .list();


How is it that this query produces the collection properties warning? How can we avoid this warning but still use MEMBER OF syntax which I prefer to the INNER JOIN syntax?

Thanks in advance,
Steve

mihalcea_vlad wrote:
It's not the MEMBER OF which got deprecated, it's the collection properties that were dropped in favor of functions.
MEMBER OF is JPA 2.0 compliant, so it shouldn't be depreciated.

This is the issue:

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


Top
 Profile  
 
 Post subject: Re: Hibernate Warning of Deprecated MEMBER OF syntax
PostPosted: Wed Dec 16, 2015 4:11 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
You should open a JIRA issue for this.

A JOIN might also perform better than MEMBER OF, if the latter results in a sub-select.


Top
 Profile  
 
 Post subject: Re: Hibernate Warning of Deprecated MEMBER OF syntax
PostPosted: Thu Dec 17, 2015 8:04 am 
Newbie

Joined: Wed Dec 16, 2015 9:57 am
Posts: 5
Ok, I will open a JIRA after I gather some more information. That's also a good point about the inner join. Noted.


Top
 Profile  
 
 Post subject: Re: Hibernate Warning of Deprecated MEMBER OF syntax
PostPosted: Tue Mar 15, 2016 9:47 am 
Beginner
Beginner

Joined: Mon Jul 05, 2004 9:29 am
Posts: 38
sagneta wrote:
Ok, I will open a JIRA after I gather some more information. That's also a good point about the inner join. Noted.


@sagneta, did you create a JIRA for this warning? I got the same problem and could not find a JIRA about it.


Top
 Profile  
 
 Post subject: Re: Hibernate Warning of Deprecated MEMBER OF syntax
PostPosted: Tue Mar 15, 2016 9:49 am 
Newbie

Joined: Wed Dec 16, 2015 9:57 am
Posts: 5
I totally forgot to create a JIRA. I will try to do so.


Top
 Profile  
 
 Post subject: Re: Hibernate Warning of Deprecated MEMBER OF syntax
PostPosted: Wed Mar 16, 2016 7:37 am 
Newbie

Joined: Wed Dec 16, 2015 9:57 am
Posts: 5
Ok the JIRA now exists. I apologize for dropping the ball.

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


Top
 Profile  
 
 Post subject: Re: Hibernate Warning of Deprecated MEMBER OF syntax
PostPosted: Wed Mar 16, 2016 1:03 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Thanks


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