-->
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: small bug in hibernate tutorial
PostPosted: Mon Jan 16, 2006 12:47 am 
Newbie

Joined: Mon Jan 16, 2006 12:42 am
Posts: 3
Location: Atlanta
Seems to me that there's a small bug in this:
<set name="events" table="PERSON_EVENT">
<key column="PERSON_ID"/>
<many-to-many column="EVENT_ID" class="Event"/>
</set>

I think "Event" must be changed to "events.Event" for the code to work.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 5:22 am 
Regular
Regular

Joined: Tue Dec 14, 2004 5:21 am
Posts: 104
Location: india
hibernate uses reflection to identify the class from name . hence this doesnt seems to be a bug :)

_________________
sHeRiN
thanks for your ratings ...... :)


Top
 Profile  
 
 Post subject: reflection
PostPosted: Tue Jan 17, 2006 5:01 pm 
Newbie

Joined: Mon Jan 16, 2006 12:42 am
Posts: 3
Location: Atlanta
but the code did not compile until I made this change... so I think it really is a bug. It's true I think that the class name is Event; you seem to be saying that Java can map from Event to know that the class is in package events.Event. That does make sense, however, it doesn't compile. When this same construct is used elsewhere in the tutorial, the class (Person, I think) is qualified with the "events." package name.

Another little thing - the tutorial says you need to locate library sdk.jar (servlet developers kit), but I found that it did not seem necessary to find and download this library; also, I was not able to find the library, anyway.

The tutorial is great; I'm not complaining, just trying to help out.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 5:10 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
Did you miss the package attribute?
<hibernate-mapping package="events">
Normally it is quite useful.

Regards Sebastian

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


Top
 Profile  
 
 Post subject: small bug in hibernate tutorial
PostPosted: Thu Jan 19, 2006 11:37 am 
Newbie

Joined: Mon Jan 16, 2006 12:42 am
Posts: 3
Location: Atlanta
That's true that use of the package attribute would have taken care of it, but this tutorial doesn't introduce/use package attributes in xml files. Anyway, I noticed that some industrious person seems to have taken care of this little thing; someone changed "Event" to "events.Event" where it needed changing. Thanks! :)


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.