-->
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.  [ 5 posts ] 
Author Message
 Post subject: No persister error
PostPosted: Wed Jul 28, 2004 3:24 pm 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi all,

I

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 28, 2004 3:29 pm 
Beginner
Beginner

Joined: Fri Mar 26, 2004 8:19 am
Posts: 49
Not 100% sure, but I think you need to call

object.getClass()

instead of using

Object.class

(ret = (Object) dataSource.load(Object.class, l); )


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 28, 2004 3:35 pm 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi,

Internally the code of AbstractHibernateDAO that I posted do
this, Look the code of this class. The load method tries to do this...

Thanks

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 28, 2004 4:05 pm 
Regular
Regular

Joined: Tue Oct 28, 2003 8:25 am
Posts: 72
Location: Belgium
Hibernate needs a class and a PK to load an object. The class is necessary to find the table on which the select will be performed.

Think of it this way: if you tell Hibernate to load an object giving it a PK but Object as the class name, how should it know from which table should it fetch the object ? There is no way to identify a row in a database by knowing its PK but not the table name.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 29, 2004 9:45 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi,

I found the error in the abstract class. I forgot the class in the
parameter.

Thanks!!!

_________________
Tads


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