Issues
- JPQL cast and Criteria API Expression.as produce wrong SQL for Float and Double types with mySQL databaseHHH-11207Resolved issue: HHH-11207
- CacheImpl.containsQuery(String) does not check if query cache is enabledHHH-9975Resolved issue: HHH-9975Brett Meyer
- More complete "temp table" coverage and allow Dialects to influence which strategy is usedHHH-9724Resolved issue: HHH-9724Steve Ebersole
- Embedded OneToMany association fetch join does not work in CriteriaQueryHHH-9642Resolved issue: HHH-9642Former user
- Oracle DB is using LONG for a String propertyHHH-9526Resolved issue: HHH-9526
- Allow casting of composite types in HQLHHH-9459
- @OneToOne + FetchType.LAZY fetches aggressivelyHHH-9447Resolved issue: HHH-9447Former user
- Rounding of fractional seconds causes test failures on MySQL 5.6.4+HHH-9444Resolved issue: HHH-9444Former user
- FooBarTest.testCollectionsInSelect fails on sql server 2014HHH-9443Former user
- Lazy fetch for OneToOne associations doesn't seem to work for method annotated classesHHH-9439Resolved issue: HHH-9439Former user
- Lazy fetching Basic Property with second level cache enabledHHH-9435
- Criteria select with multi level inheritance using discriminator column referencing wrong tableHHH-9311Resolved issue: HHH-9311
- Table name generated for @ElementCollection uses owning entity class name instead of mapped entity nameHHH-9280Resolved issue: HHH-9280Former user
- Statement closed twice (Exception clearing maxRows/queryTimeout [You can't operate on a closed Statement!!!])HHH-9277Resolved issue: HHH-9277
- StatefulPersistenceContext.clear() does not clear nonlazyCollectionsHHH-9273Resolved issue: HHH-9273
- Limit persister lookups in critical hot pathsHHH-9269Resolved issue: HHH-9269Emmanuel Bernard
- Merging transient entity with a component property with parent mapping causes NullPointerExceptionHHH-3868Resolved issue: HHH-3868Andrea Boriero
- Support subqueries in HQL as CASE statement alternativesHHH-1689Resolved issue: HHH-1689Steve Ebersole
18 of 18
JPQL cast and Criteria API Expression.as produce wrong SQL for Float and Double types with mySQL database
Out of Date
Description
Details
Details
Assignee
Unassigned
UnassignedReporter
Joni Ollila
Joni OllilaLabels
Components
Affects versions
Priority
Created October 27, 2016 at 7:51 AM
Updated April 8, 2022 at 12:25 PM
Resolved April 8, 2022 at 12:25 PM
Activity
Show:
Christian Beikov April 8, 2022 at 12:25 PM
Since no test case was provided for years, I'll close this issue as out of date. I also believe it will most probably not be an issue any more in 6.0.
If this still is an issue for you, please create a new issue with a test case that reproduces the problem.
Former user October 31, 2016 at 9:17 PM
@Joni Ollila, this is probably fixed by https://hibernate.atlassian.net/browse/HHH-9969#icft=HHH-9969 in 5.0. Please confirm.
Former user October 29, 2016 at 12:23 AM
@Joni Ollila, 4.2 is no longer maintained. Please attach a unit test using 5.2 that reproduces your issue. You can find a test template at: https://github.com/hibernate/hibernate-test-case-templates.
When creating Criteria API expression using Expression.as(Double.class) or Expression.as(Float.class) wrong SQL is produced. First one produces "cast(<attribute> as double precision)" and the second one "cast(<attribute> as float)". Either of these syntax are not working with MySQL database.
Noticed that same bug applies also to JPQL queries, so it is not Criteria API specific. For example "select cast(t.<attribute> as double) from Table t".