-->
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: org.hibernate.AnnotationException: @OneToOne or @ManyToOne o
PostPosted: Thu Sep 18, 2008 9:52 am 
Beginner
Beginner

Joined: Tue Jun 06, 2006 3:37 am
Posts: 29
I've created a new Entity named Yamina and added to it annotation


Code:
@Entity
public class YaminaDistrict implements Serializable {

   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
   @Column(name = "cedtId")
   private long id;

   @Column(name = "yaminaDistrict")
   private int numero;

   @Column(name = "cetlf", length = 40, nullable = true)
   private String libelleFr;

   @Column(name = "cetla", length = 40, nullable = true)
   private String libelleDe;



And I use it as property of a class like here :

Code:
@Entity
public class Commune implements Serializable {
...
   @ManyToOne(fetch = FetchType.EAGER, optional = true)
   @Cascade ((org.hibernate.annotations.CascadeType.SAVE_UPDATE))
   private YaminaDistrict district;
}


I then configured my annotedSessionFactory to add it as annoted class

Code:
      <property name="annotatedClasses">
         <list>
<value>ch.btc.datec.yamina.model.ObjetDemande</value>
            <value>ch.btc.datec.yamina.model.District</value>
            <value>ch.btc.datec.yamina.model.YaminaDistrict</value>
...


but once I start the deployment of my application I got the following error :

Code:
org.hibernate.AnnotationException: @OneToOne or @ManyToOne on ch.btc.datec.yamina.model.Commune.district references an unknown entity: ch.btc.datec.yamina.model .YaminaDistrict


Any idea what I've missed ?

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 18, 2008 10:03 am 
Beginner
Beginner

Joined: Tue Jun 06, 2006 3:37 am
Posts: 29
founded I missed the declaration in the persistance.xml


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.