-->
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.  [ 4 posts ] 
Author Message
 Post subject: Trouble With XDoclet joined-subclass
PostPosted: Tue Apr 20, 2004 7:46 pm 
Newbie

Joined: Tue Apr 20, 2004 4:02 pm
Posts: 4
I'm having a problem getting XDoclet to generate the mapping files for the table-per-subclass mapping strategy.

I have a Person persistent class that extends a BaseEntity persistent class. BaseEntity has the following XDoclet class-level tags:

@hibernate.class table="BASE_ENTITY"

When I use the following Person class class-level tags:

@hibernate.joined-subclass
@hibernate.joined-subclass-key column="PERSON_ID"

The XDoclet task runs and says the build was successful, but nothing is generated. I've seen examples that list the table in the joined-subclass tag, though the XDoclet docs don't mention this as a valid argument, but I tried it anyway:

@hibernate.joined-subclass table="PERSON"
@hibernate.joined-subclass-key column="PERSON_ID"

Still nothing.

Just to see if I can get anything generated, I tried

@hibernate.class table="PERSON"
@hibernate.joined-subclass table="PERSON"
@hibernate.joined-subclass-key column="PERSON_ID"

This gives the error about Person having no ID field.

So, I'm a bit stuck. I'm using XDoclet 1.2b4, but also tried just 1.2 and 1.2b2, and am using Hibernate 2.1.2.

Any suggestions?

_________________
Jack


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 21, 2004 4:29 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
On BaseEntity
@hibernate.class table="BASE_ENTITY"

And map an id property

On Person
@hibernate.joined-subclass table="PERSON"
@hibernate.joined-subclass-key column="PERSON_ID"

Works for me

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 24, 2004 11:57 am 
Newbie

Joined: Tue Apr 20, 2004 4:02 pm
Posts: 4
Emmanuel,

Thanks for the response.

I tried your suggestion, but I can never get XDoclet to generate the mapping file for a joined-sublass. The XDoclet task starts, takes a few seconds, and then returns, but no code or errors are generated. I'm using XDoclet v1.2.

I researched the issue a bit more and found a bug report in JIRA at the XDoclet site: http://opensource.atlassian.com/projects/xdoclet/browse/XDT-712 which seems to address the same problem I'm having. Even though that was a 1.2b3 issue, it's status still shows as open - and my experience with 1.2 seems to bear it out.

I'm just curious, when you use the @hibernate.joined-subclass tag as you described, is the parent class in the same package? Do you get a separate mapping file for the subclass or is the generated mapping info nested inside the parent class' mapping file?

Thanks again.

_________________
Jack


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 25, 2004 2:48 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Same package I guess (don't have to code right now)

_________________
Emmanuel


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