[hibernate-issues] [Hibernate-JIRA] Updated: (ANN-284) @OrderBy clash with @Formula Properties

Emmanuel Bernard (JIRA) noreply at atlassian.com
Fri Aug 25 19:29:25 EDT 2006


     [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-284?page=all ]

Emmanuel Bernard updated ANN-284:
---------------------------------

        Summary: @OrderBy clash with @Formula Properties  (was: @OrderBy for @Formula-Properties)
    Fix Version: 3.2.0
      Assign To: Emmanuel Bernard

> @OrderBy clash with @Formula Properties
> ---------------------------------------
>
>          Key: ANN-284
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-284
>      Project: Hibernate Annotations
>         Type: New Feature

>   Components: binder
>     Versions: 3.1beta8
>     Reporter: Sven Schliesing
>     Assignee: Emmanuel Bernard
>      Fix For: 3.2.0

>
>
> When Hibernate loads the collection defined here:
> @OneToMany(mappedBy="board")
> @javax.persistence.OrderBy(value="lastPostAt")
> private List<Thread> threads = new ArrayList<Thread>();
> I get this exception:
> Exception in thread "main" java.lang.ClassCastException: org.hibernate.mapping.Formula
> 	at org.hibernate.cfg.annotations.CollectionBinder.buildOrderByClauseFromHql(CollectionBinder.java:603)
> 	at org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:454)
> 	at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:408)
> 	at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:382)
> 	at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35)
> 	at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1012)
> 	at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:238)
> 	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1168)
> Sure it's not a bug. But using Formulas for sorting would be great. I tried to create a patch myself but I think It will take forever for me to understand the binding mechanism. 

-- 
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