-->
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: mapping interface implementing classes
PostPosted: Fri Jun 03, 2005 12:31 pm 
Newbie

Joined: Fri Jun 03, 2005 12:14 pm
Posts: 4
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 2.1.7

Name and version of the database you are using: mysql 4.1.9

I'm trying to map an class that implements an interface without success.
I use xdoclet to generate the hbm files.
As I have read in chapter 8 of the documentation, what I'm trying to do is perfectly possible.
The problem is that the xdoclet that I put into my implementing class doesn't seem to be taken into account.

Here is how my interface looks :

/**
* @hibernate.class table="_i_event"
*/
public interface IEventVO {...}

And here is how I map my implementing class :

* @hibernate.joined-subclass table="_calendar_event"
* @hibernate.joined-subclass-key column="ID"
*
*/
public class CalendarEventVO implements IEventVO{...}

The resulting hbm file doesn't have the joined-subclass section as if my implementing class doesn't know it is 'extending' the interface.
Am I doing something wrong with xdoclet or did I not correctly understand the hibernate documentation and it is not possible to map implementing classes like subclasses of there interfaces?
Thanks,

Arthur Clement


Top
 Profile  
 
 Post subject: hibernate annotations
PostPosted: Fri Jun 03, 2005 2:51 pm 
Newbie

Joined: Fri Jun 03, 2005 2:15 pm
Posts: 14
I am new to Hibernate annotations. After we immplement the annotations in pojos, do we still need some tool to create the mapping files or the hibernate will directly work on the annotations? If we need tools to create mapping files, what kind of tools should we use? If use ant, what task? Is there any ant example?

Thanks.

Wade


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 06, 2005 4:04 am 
Newbie

Joined: Fri Jun 03, 2005 12:14 pm
Posts: 4
The tool you need is xdoclet. Then after you have written your annotations you use the ant task hibernate (see http://xdoclet.sourceforge.net) to generate the mapping files.
The annotations do not replace the mapping files.

But this still doesn't tell me why my generated mapping files dont include the joined subclass when I try to map a interface and its implementors.
I'd really appreciate some clues here.

Arthur CLEMENT


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 06, 2005 5:52 am 
Newbie

Joined: Fri Jun 03, 2005 12:14 pm
Posts: 4
Seems the issue comes from xdoclet.
I currently use version 1.2 and will try to upgrade to 2.0 which should fix the problem.


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Mon Jun 06, 2005 10:30 am 
Newbie

Joined: Fri Jun 03, 2005 2:15 pm
Posts: 14
Thank CLEMENT for his response.

Wade


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.