-->
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.  [ 4 posts ] 
Author Message
 Post subject: Help,AnnotationException !!
PostPosted: Wed Mar 17, 2010 6:21 am 
Newbie

Joined: Wed Mar 10, 2010 1:02 am
Posts: 3
Guys, help me:what wrong with my code.i've been map the entity class at my hibernate.cfg.xml files
Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on org.mktp.entity.KartuKeluarga.nikKk references an unknown entity: org.mktp.entity.Penduduk
at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:81)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:499)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:304)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:753)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:691)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1390)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1359)
... 72 more

this is my entity class :
.....
@OneToMany(cascade = CascadeType.ALL, mappedBy = "nikKk")
private List<KartuKeluarga> kartuKeluargaList;
...........

..........
@JoinColumn(name = "nik_kk", referencedColumnName = "nik")
@ManyToOne(optional = false)
private Penduduk nikKk;
....................


Top
 Profile  
 
 Post subject: Re: Help,AnnotationException !!
PostPosted: Wed Mar 17, 2010 6:24 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
You must also annotate class Penduduk with the @Entity annotation as you use class Penduduk in a relation.


Top
 Profile  
 
 Post subject: Re: Help,AnnotationException !!
PostPosted: Wed Mar 17, 2010 6:32 am 
Newbie

Joined: Wed Mar 10, 2010 1:02 am
Posts: 3
thank's. for your replies...I've add that annotation.but the exception still appear..any other solution


Top
 Profile  
 
 Post subject: Re: Help,AnnotationException !!
PostPosted: Wed Mar 17, 2010 6:41 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Is the exception still exacly the same (also same message) ?
Quote:
Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on org.mktp.entity.KartuKeluarga.nikKk references an unknown entity: org.mktp.entity.Penduduk


Or is it now complaining about another class being a unknown entity?


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