-->
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.  [ 2 posts ] 
Author Message
 Post subject: Bugs with @OrderBy on embedded object
PostPosted: Mon Apr 07, 2008 2:35 am 
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: Mon Apr 07, 2008 12:45 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
what do you mean exactly with "embedded", are both publishInfo and position embedded in Category?
I'm no guru here, but they (the gurus) will be more likely to help you if you post the full source code if the entity. If it's complicated maybe you could reduce it to the minimal failing code and then show just that. You should also post the hibernate versions(s) you are using.

regards,
Sanne


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.