Binding parameters to Query / ProcedureCall #4597
Replies: 3 comments 18 replies
-
This looks pretty good to me. It:
which resolves my objections nicely. OTOH, why did you get rid of its type parameter? I would have kept it, I think, for a teensy bit of type safety.
I don't really care if it lives or dies. The only think I would say in its defense is that now with |
Beta Was this translation helpful? Give feedback.
-
One more comment. I'm not too keen on calling these methods |
Beta Was this translation helpful? Give feedback.
-
Currently we support binding an Object-valued value with a
However, that no longer matches any
Long story short, I cannot see a way to make this work from a user perspective in this not unusual situation. I can see a few options...
And of course, we could do both. (1) is pretty straight-forward. Yes, |
Beta Was this translation helpful? Give feedback.
-
Query
has a lot of methods to bind parameters. I propose we clean these up.https://hibernate.atlassian.net/browse/HHH-15017
Type determination
There are multiple overloads with regards to influencing the "binding type" which should be used to bind these values to JDBC - ultimately resolved to
org.hibernate.metamodel.mapping.Bindable
behind the scenes.So the first proposal has to do with what kind of things we want to accept for influencing the binding-type.
We currently have overloads accepting
AllowableParameterType
as well asBasicTypeReference
. We should consolidate these into a single overload via inheritance.AllowableParameterType
allows for embeddables, whereasBasicTypeReference
can only be used for basic-valued types.There are obviously many ways to achieve such consolidation...
AllowableParameterType
BasicTypeReference
implementAllowableParameterType
AllowableParameterType
references, including embeddablesSomething like:
Query.setProperties
Do people actually use this? I have personally never used it, and have not seen any bug/enhancement requests related to it in years. Should we just drop this?
Beta Was this translation helpful? Give feedback.
All reactions