-->
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: Unknown Entity (but the entitity is mapped!)
PostPosted: Thu Jul 06, 2006 10:49 am 
Newbie

Joined: Wed Jul 05, 2006 10:14 am
Posts: 7
Hi, here is my problem:

I´m getting a MappingException exception when I deal with a class in Hibernate that it´s already mapped:
"Unknown entity: ecm.crc.busca.PseudoRC"

This entity is using the same table of another entity. Could this be the cause of the problem?
Can I map more than one entity accessing the same table on the SGBD?


Hibernate version: 3.2 RC

Mapping documents:

Code between sessionFactory.openSession() and session.close():
sessao.load(objeto, id);
where "objeto" is of the type Object and id is a String

Full stack trace of any exception that occurs:

Name and version of the database you are using: MySQL 5.0.22

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

_________________
Henrique Lobo Weissmann


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 06, 2006 11:50 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Two different classes can map to a single table without mapping errors, though it's very likely to give other errors later. Normally that sort of thing is done as components.

Is the mapping that isn't being found being loaded? Is the file that defines the mapping mentioned in your .cfg.xml file?

Try changing the method you use to load it to one of the methods that takes a Class as the first parameter: for example, "objeto = sessao.get(PseudoRC.class, id);". The version that you're using may end up clouding the issue (if, for example, objeto is an unmapped superclass of the object you want to load); the version with the class parameter will definitely try to load the correct object.

_________________
Code tags are your friend. Know them and use them.


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.