[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5250) Allow more flexible query parameter types for binding
Steve Ebersole (JIRA)
noreply at atlassian.com
Fri May 21 03:21:11 EDT 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=37237#action_37237 ]
Steve Ebersole commented on HHH-5250:
-------------------------------------
Yes JDBC does define a number of type conversions. These conversions are also limited to certain methods of certain JDBC interfaces. So, don't kid yourself that it is open-ended. Your driver may choose to be more lenient/flexible then the spec, but the spec is the spec.
As to your specific request, I don't know that I would ever design an application in such a way that I don't have some idea of the datatype of the incoming parameters. Anyway here the issue is, we'll see how much support it gets...
> Allow more flexible query parameter types for binding
> -----------------------------------------------------
>
> Key: HHH-5250
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5250
> Project: Hibernate Core
> Issue Type: New Feature
> Components: core
> Affects Versions: 3.5.1
> Reporter: Hannes Havel
>
> SEE HHH-5238
> Hi Gail,
> I am not agree you, that this is not a BUG.
> I am not amused that you switch the issue HHH-5238 to resolved, with out any explanation of your view.
> Second: your reference, that i should use the forum for help is not on the right place.
> because i know, what a question is and what a bug report is.
> (I have 20 year of experiance in software development).
> ================================================
> Explanation of my view:
> In this case the string consists only numbers and representing a integer number of e.g. "10" and this can be converted to a integer 10 and i am not speaking about to convert a text string to an integer.
> JDBC an do this easily.
> Is hibernate so restricted ?
> How you can establish a generalized query interface where only strings are transported and the provided service has no knowledge about the queried entities and the datatypes of the fields.
> So i think a automatic conversion of a string representing a number to the nhumber type and so on is a esential funktionality for a
> data sorage and retrieve interface.
> For Hibernate the only thing to be changed for the primitive datatype handling is explaind in the following code snipplet:
> IntegerType.set(PreparedStatement st, Object value, int index)
> throws SQLException {
> if (value instanceof String)
> st.setInt( index, Integer.parseInt((String)value));
> else
> st.setInt( index, ( (Integer) value ).intValue() );
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list