-->
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.  [ 4 posts ] 
Author Message
 Post subject: Deprecated setParameter(String name, Object val, Type type)
PostPosted: Tue Jul 26, 2016 4:00 pm 
Newbie

Joined: Fri Aug 01, 2014 5:54 am
Posts: 13
Location: Brazil
Now, how can one override the type when binding a parameter to a Query?


Top
 Profile  
 
 Post subject: Re: Deprecated setParameter(String name, Object val, Type type)
PostPosted: Wed Jul 27, 2016 1:33 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
This method is not deprecated:

Code:
Query<R> setParameter(int position, Object val, Type type);


org.hibernate.Query is deprecated in favor of org.hibernate.query.Query


Top
 Profile  
 
 Post subject: Re: Deprecated setParameter(String name, Object val, Type type)
PostPosted: Wed Jul 27, 2016 7:36 am 
Newbie

Joined: Fri Aug 01, 2014 5:54 am
Posts: 13
Location: Brazil
Code:
org.hibernate.query.Query<String> q = s.createQuery("select * from foo where :bar", String.class);
q.setParameter("bar", "bar", org.hibernate.type.StringType.INSTANCE);

My Eclipse points the above setParameter as deprecated.


Top
 Profile  
 
 Post subject: Re: Deprecated setParameter(String name, Object val, Type type)
PostPosted: Wed Jul 27, 2016 11:05 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
It might be an Eclipse issue. Checkout the method on GitHub.

I'm using IntelliJ IDEA and there is no deprecation warning for this method. This is how it looks for me.


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