-->
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.  [ 1 post ] 
Author Message
 Post subject: property from @OrderBy clause not found?
PostPosted: Mon Apr 09, 2012 6:37 pm 
Newbie

Joined: Mon Sep 24, 2007 2:55 pm
Posts: 13
I'm using JBoss AS 7 including hibernate 4.1.1.
When deploying my ear app I get this:
Caused by: org.hibernate.AnnotationException: property from @OrderBy clause not found: biz.mbisoftware.fn.ejb.entity.MbiTstfs.mbiSprch.sprachNr
at org.hibernate.cfg.annotations.CollectionBinder.buildOrderByClauseFromHql(CollectionBinder.java:1006)
at org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:770)
at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:721)
at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:670)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:66)
at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1587)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1362)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1727)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
... 9 more

Entity MbiTstvw has:
/** Relation with MbiTstfs. */
@OneToMany( cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true )
@OrderBy( "tstNr ASC, mbiSprch.sprachNr ASC" )
@JoinColumns( {
@JoinColumn( name = "tst_nr", referencedColumnName = "tst_nr", insertable = false, updatable = false )
} )
private Collection<MbiTstfs> mbiTstfs;

Entity MbiTstfs has:
/** Relation with MbiSprch. */
@Id
@ManyToOne( fetch = FetchType.LAZY, optional = false )
@JoinColumns( {
@JoinColumn( name = "sprach_nr", referencedColumnName = "sprach_nr" )
} )
private MbiSprch mbiSprch;

Entity MbiSprch has:
/** Sprachen-Nummer (Verweis auf mbi_sprch). */
@Id
@Column( name = "sprach_nr", nullable = false )
private Integer sprachNr;

So the path for the OrderBy annotation should be correct.
Where is my problem?


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

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.