-->
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: Hibernate's bug? Can't load ,but can find the object!?
PostPosted: Thu Aug 26, 2004 5:03 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
2.0.3

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

mysql3.1:

CastClassException
erpt:

I use
Code:
  Workforce wf = (Workforce) s.load(Workforce.class, workforce_id);


I will get a CastClassException
If I use the code :

Code:
List list=s.find("from Workforce as w where w.work_id=?",workforce_id,Hibernate.STRING);
Workforce wf=(Workforce)list.get(0);

It will get the object?
Why? It there any different between the two method? THKS!

_________________
You are not alone...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 26, 2004 5:04 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Please read the RED BOX again.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.