[Hibernate-JIRA] Commented: (HHH-892) HQL parser does not resolve alias in ORDER BY clause
by Nate (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-892?page=co... ]
Nate commented on HHH-892:
--------------------------
The workaround mentioned above no longer works (at least not with 3.2.x). I tried it and I get an exception saying "org.hibernate.util.JDBCExceptionReporter - ERROR: column "col_1_0_" does not exist" yet when I look at the SQL generated, that SHOULD be a valid column:
[INFO] [talledLocalContainer] QUERY = select point.id, (acos(cos(radians(:latitude))*cos(radians(:longitude))*cos(radians(point.latitude))*cos(radians(point.longitude))+cos(radians(:latitude))*sin(radians(:longitude))*cos(radians(point.latitude))*sin(radians(point.longitude))+sin(radians(:latitude))*sin(radians(point.latitude)))*3963.189) as distance from com.waypointdepot.domain.Waypoint point where col_1_0_ <= :maxDistance order by col_1_0_
[INFO] [talledLocalContainer] Hibernate:
[INFO] [talledLocalContainer] select
[INFO] [talledLocalContainer] waypoint0_.id as col_0_0_,
[INFO] [talledLocalContainer] acos(cos(radians(?))*cos(radians(?))*cos(radians(waypoint0_.latitude))*cos(radians(waypoint0_.longitude))+cos(radians(?))*sin(radians(?))*cos(radians(waypoint0_.latitude))*sin(radians(waypoint0_.longitude))+sin(radians(?))*sin(radians(waypoint0_.latitude)))*3963.189 as col_1_0_
[INFO] [talledLocalContainer] from
[INFO] [talledLocalContainer] waypoint waypoint0_
[INFO] [talledLocalContainer] where
[INFO] [talledLocalContainer] col_1_0_<=?
[INFO] [talledLocalContainer] order by
[INFO] [talledLocalContainer] col_1_0_
[INFO] [talledLocalContainer] 15096 [http-8080-Processor24] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 42703
[INFO] [talledLocalContainer] 15096 [http-8080-Processor24] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: column "col_1_0_" does not exist
I cannot believe this is classified as a new feature request. This is clearly broken.
> HQL parser does not resolve alias in ORDER BY clause
> -----------------------------------------------------
>
> Key: HHH-892
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-892
> Project: Hibernate3
> Type: New Feature
> Versions: 3.0.5
> Environment: Hibernate 3.0.5, MySQL, Tomcat
> Reporter: Guido Laures
> Priority: Minor
>
>
> When using an alias for an ORDER BY clause this is not always correctly resolved. Example:
> SELECT SUM(A.x) AS mySum FROM MyClass AS A GROUP BY A.y ORDER BY mySum
> does not work because "mySum" is not resolved in the ORDER BY clause which results in an exception telling that mySum is an unknown column.
> Workaround (not to say "hack") is using:
> SELECT SUM(A.x) AS mySum FROM MyClass AS A GROUP BY A.y ORDER BY col_0_0_
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 5 months
[Hibernate-JIRA] Commented: (HHH-1936) IdentityGenerator doesn't support BigInteger as a valid identity type.
by Kristian Schjelderup (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1936?page=c... ]
Kristian Schjelderup commented on HHH-1936:
-------------------------------------------
We are struggling with the same issue when integrating with an 10+ yr old Sybase db using numeric for identity columns.
Tried making changes to the IdentifierGeneratorFactory and extended the two if..else-blocks to support BigDecimal (which is the native mapping type for numeric) with success. But - obviously we would like this issue handled correctly, and are anxiously waiting for someone in the core team to comment on this issue.
> IdentityGenerator doesn't support BigInteger as a valid identity type.
> ----------------------------------------------------------------------
>
> Key: HHH-1936
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1936
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.0.5
> Environment: Hibernate 3.0.5, Sybase 12.05, Window/ Unix
> Reporter: Leonid Shtivelman
>
>
> Identity generator strategy doesn't support BigInteger as a valid id type. This causes problem with Sybase which requires identity column to be numeric. It would seem an obvious way to get around this problem is to set column mapping to long in hibernate xml and the actual java object. This will solve obvious problem of creating identity, but will cause performance problem on selection. In order for Sybase to use index for parameter query the variable type of the parameter and column index type has to be the same. If ones maps column type to Long, Hibernate will use JDBC method setLong(long) to set value in the prepared statement. This will cause mismatch between parameter type and column index type, and Sybase will not use index to locate index. As you can see this is a big problem for anyone that is using identity columns Sybase and Hibernate
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 5 months
[Hibernate-JIRA] Commented: (HHH-1851) relax special handling of 'id' property
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1851?page=c... ]
Max Rydahl Andersen commented on HHH-1851:
------------------------------------------
hint: Go look at the downloads page before asking about when a release is out ;)
> relax special handling of 'id' property
> ---------------------------------------
>
> Key: HHH-1851
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1851
> Project: Hibernate3
> Type: Improvement
> Components: query-hql
> Environment: independent, all versions all databases.
> Reporter: Gunther Schadow
> Assignee: Steve Ebersole
> Fix For: 3.2.2
>
>
> Hibernate has long treated 'id' in a special manner in HQL and Criteria queries. The drawback to this has always been that it effectively means users cannot define non-identifier properties named id and refer to those properties in HQL/Criteria queries.
> Thus, I will change this such that:
> (1) 'id' can still be used to refer to the identifier property, whatever the property's actual name, as long as the entity does not define a non-identitifer property named id.
> (2) if the entity defines a non-identifier property named 'id', using 'id' in HQL or Criteria queries will refer to this non-identifier property; users would need to refer to the identifier property by its actual name.
> FYI, the original reason for this feature was to support entity's which did not define an identifier property at all (users were responsible for managing the ids seperately. That feature was never really recommended and has been deprecated since early in the 3.x development.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 5 months
[Hibernate-JIRA] Created: (HHH-2387) bring back Session's method reconnect()
by Dmitry (JIRA)
bring back Session's method reconnect()
---------------------------------------
Key: HHH-2387
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2387
Project: Hibernate3
Type: Improvement
Reporter: Dmitry
Currently Session.reconnect() is deprecated as "manual reconnection is only needed in the case of application-supplied connections, in which case the reconnect(java.sql.Connection) for should be used".
There are cases other than using application-supplied connections when this method seems to be useful.
For example, with ZK framework (an Ajax-based presentation tier framework) it is possible to suspend a server thread until a modal window is closed by the end user. It would be nice to have a possibility not to close thread-bound Session during the thread suspension period - rather disconnect() it, reconnect()ing it subsequently after thread resumes. This would leave Session cache untouched during thread suspension.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 5 months