-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Bugs with @OrderBy on embedded fields ?
PostPosted: Sun Apr 06, 2008 6:31 pm 
Beginner
Beginner

Joined: Sun Jul 31, 2005 6:15 pm
Posts: 28
Hi guys.

Before opening a JIRA I just want to make sure that there's a bug with @OrderBy on embedded fields .

Code:
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "category")   
    @OrderBy("publishInfo.position")
    public Set<Category> getChildren()
    {
        return children;
    }


Where publishInfo is an embedded object inside the Category object.

The stack trace :
Code:
Caused by: java.lang.NullPointerException
   at org.hibernate.cfg.annotations.CollectionBinder.buildOrderByClauseFromHql(CollectionBinder.java:851)
   at org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:608)
   at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:563)
   at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:517)
   at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:43)
   at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
   at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:316)
   at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)


Does anyone meet already this problem ?

Cheers

_________________
Michael Courcy


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 18, 2008 5:25 pm 
Newbie

Joined: Sat Sep 10, 2005 3:05 am
Posts: 6
Location: Paris
********************
Hibernate version: hibernate3.2.6.ga
********************
stack trace of any exception that occurs:
23:03:22,765 WARN [ServiceController] Problem starting service persistence.units:jar=EntityGenDao.jar,unitName=genPersistUn
it
java.lang.NullPointerException
at org.hibernate.cfg.annotations.CollectionBinder.buildOrderByClauseFromHql(CollectionBinder.java:851)
at org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:608)
at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:563)
at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:517)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:43)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1136)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:316)
.../...
********************
Name and version of the database you are using: MySQL 5
********************

I have the same problem.

There is a JIRA about that :
http://opensource.atlassian.com/projects/hibernate/browse/ANN-617

**************
It seems to be in Hibernate Annotation : Exception is happening in "org.hibernate.cfg.annotations.CollectionBinder....."

in JBoss, I have seen that the hibernate-annotations.jar is also in the .../jboss-4.2.2.GA/client folder.

In my config, I did not updated this lib....
I wonder if it may be the reason of this exception, related to the JIRA...

will do a check....

*************
Anyway, if any one have an idea about that @orderBy problem ?....

_________________
Antoine Herzog.
JBoss Portal and GateIn (JSR-286), JSF, Richfaces, J2EE, Drools, BRMS.
http://www.sysemo.com/Sysemo-expertise- ... portal.php


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 18, 2008 5:42 pm 
Newbie

Joined: Sat Sep 10, 2005 3:05 am
Posts: 6
Location: Paris
Well...
I have not change anything in the ".../jboss-4.2.2.GA/client" folder (which should not be involved in anything with this problem).

but I updated the hibernate-annotations package with the last recent one : hibernate-annotations-3.3.1.ga.jar

(and hibernate-entitymanager-3.3.2.ga.jar).

The exception is not throwing anymore...

_________________
Antoine Herzog.
JBoss Portal and GateIn (JSR-286), JSF, Richfaces, J2EE, Drools, BRMS.
http://www.sysemo.com/Sysemo-expertise- ... portal.php


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.