[Hibernate-JIRA] Commented: (HHH-892) HQL parser does not resolve alias in ORDER BY clause
by Jean-François St-Germain (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-892?page=co... ]
Jean-François St-Germain commented on HHH-892:
----------------------------------------------
wow! it took 5 (FIVE) years to fix such an essential and basic functionality!!!
In the mean time that a stable build is released including this fix, just use the column number instead of its alias...
select a.id as annoying, a.field2 as bug from a order by 2
results will be sorted based on the second column
> HQL parser does not resolve alias in ORDER BY clause
> -----------------------------------------------------
>
> Key: HHH-892
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-892
> Project: Hibernate Core
> Issue Type: Bug
> Components: query-hql
> Affects Versions: 3.5.4, 3.6.0.Beta1
> Environment: Hibernate 3.0.5, MySQL, Tomcat
> Reporter: Guido Laures
> Assignee: Gail Badner
> Fix For: 3.6.0.CR2
>
> Attachments: HHH-892.patch, HibernateHavingAliasTest.java
>
>
> 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
15 years, 6 months
[Hibernate-JIRA] Created: (HHH-5670) Filters defined on Embeddable classes are ignored
by Frode Carlsen (JIRA)
Filters defined on Embeddable classes are ignored
-------------------------------------------------
Key: HHH-5670
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5670
Project: Hibernate Core
Issue Type: Improvement
Components: core
Affects Versions: 3.6.0
Reporter: Frode Carlsen
If defining a class as Embeddable and defining any Filters on it, these are ignored.
It would be very useful to be able to define such filters once in relation to the Embeddable, so that it could be reused elsewhere as a value object.
@Embeddable
@FilterDef(name = "history", parameters = { @ParamDef(name = "effectiveTime", type = "timestamp") })
@Filters({ @Filter(name = "history", condition = ":effectiveTime between effective_from and effective_until") })
public class EffectiveDate {
@Temporal(TIMESTAMP) Date effectiveFrom;
@Temporal(TIMESTAMP) Date effectiveUntil;
...
}
@Entity
public Class Address {
@Id
private Long id;
@Embedded
private EffectiveDate effective;
}
--
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
15 years, 6 months