[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-7025) Descending sort by composite properties works wrong

pootek (JIRA) noreply at atlassian.com
Mon Feb 6 13:13:13 EST 2012


    [ https://hibernate.onjira.com/browse/HHH-7025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45380#comment-45380 ] 

pootek commented on HHH-7025:
-----------------------------

Accidentally clicked "create" when description wasn't ready. Above missing:
{code}
@Entity
class Ent {
  public DatePeriod dp;
}
EntityManager em;
em.em.createQuery("SELECT e FROM Ent e ORDER BY dp DESC").getResultList();
{code}
Last line produces SQL query
{code}
select e.* from ent e order by dp.from, dp.to desc
{code}
instead of
{code}
select e.* from ent e order by dp.from desc, dp.to desc
{code}


> Descending sort by composite properties works wrong
> ---------------------------------------------------
>
>                 Key: HHH-7025
>                 URL: https://hibernate.onjira.com/browse/HHH-7025
>             Project: Hibernate ORM
>          Issue Type: Bug
>          Components: query-sql
>    Affects Versions: 3.6.4
>         Environment: Hibernate 3.6.4.Final, jtds driver, gnu/linux, openjdk 1.6.0_22
>            Reporter: pootek
>
> When trying to sort descending by an embedded property of domain object, jpaql is translated to wrong sql. For example:
> {code}
> class DatePeriod {
>     Date from;
>     Date to;
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list