-->
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.  [ 3 posts ] 
Author Message
 Post subject: Unknown Entity
PostPosted: Thu Sep 07, 2006 11:08 am 
Newbie

Joined: Thu Sep 07, 2006 10:34 am
Posts: 2
First, i'd like to congrats you all. You've been done a great work with hibernate.
This is my last chance. I've posted it in many forums world wide. And there are some ones similar here which dint solve my problem.

I'm using Hibernate RC2 and Hibernate Annotations RC1. Netbeans 5, java5, firebird1.5 (jaybird).

Its a pretty simple test. Only two classes annotated. Person and User. I've followed your tutorials to annotate them.

This error maybe usual on forums, see:
Code:
Exception in thread "main" org.hibernate.MappingException: Unknown entity: Model.Usuario
        at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:547)
        at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1331)
        at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:96)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
        at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
        at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)


But i'm really using javax.persistence.* to my classes.

My hibernate.cfg.xml:
Code:
<session-factory>
     
    <mapping class="Model.Person"/>
    <mapping class="Model.User"/>
       
</session-factory>


The rest its in hibernate.properties which works fine (up to now).

I've tryed to put this information on HibernateUtil.java (the class). I've tryed so many different ways to do that. Even giving the place where is my cfg.xml as a parameter. But i got always the same error.

If a delete cfg.xml from my test, i got the same error. I've put it into any possible package. And its always the same error.

I've already tryed to not to use him, and i write my HibernateUtil.java as
Code:
.addAnnotatedClass(Model.Person.class)
you know, just like to tutorial on hibernate.org, but i got the same error!

the hbm2ddl.auto its defined as 'create' in hibernate.properties

Model: Person.java, User.java
Main: Main.java
project root: hibernate.cfg.xml, hibernate.properties, lo4j.properties, HibernateUtil.java

Guys, i'm so sorry if this question is so stupid.

I dont know if its necessary to write my classes here, if it was, please ask to me.

If I missed something, sorry. But i really wanna know how to work with hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 30, 2006 5:45 am 
Newbie

Joined: Wed Mar 15, 2006 2:25 pm
Posts: 4
Just have a look at the following line of the stacktrace:
Code:
Unknown entity: Model.Usuario

Thats a complaint about an unknown class Model.Usuario. Shouldn't this be model.User according to your mapping?

Cheers,
Jakob

_________________
Cheers,
Jakob


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 30, 2006 9:17 am 
Newbie

Joined: Thu Sep 07, 2006 10:34 am
Posts: 2
this trouble was solven.

And that was only a translation mistake


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