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