-->
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: SchemaExport & joined-subclass
PostPosted: Wed Nov 10, 2004 9:45 am 
Beginner
Beginner

Joined: Mon Nov 08, 2004 11:58 am
Posts: 20
Hi,

for a superclass Person, I have two subclasses declared as follows:

/**
*
*
* @hibernate.class
* table="PERSON"
*
* @hibernate.joined-subclass
* table="PLAYER"
*
* @hibernate.joined-subclass-key
* column="PLAYER_ID"
*
* @hibernate.joined-subclass
* table="TEAM_MANAGER"
*
* @hibernate.joined-subclass-key
* column="TEAM_MANAGER_ID"
*/
public class Person implements IPerson, Serializable{
...
}

When I generate the mapping, I get this output:

...
<joined-subclass
name="de.soccermanager.person.entity.Player"
table="PLAYER"
dynamic-update="false"
dynamic-insert="false"
>
<key
column="PLAYER_ID"
/>
...
</joined-subclass>
<joined-subclass
name="de.soccermanager.person.entity.TeamManager"
table="TEAM_MANAGER"
dynamic-update="false"
dynamic-insert="false"
>
<key
column="PLAYER_ID"
/>
...
</joined-subclass>

For both subclasses the generated key-column is set to PLAYER_ID. However, for the class TEAM_MANAGER it should be TEAM_MANAGER_ID. What is wrong?

thx,
sven


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 12, 2004 7:38 am 
Beginner
Beginner

Joined: Mon Nov 08, 2004 11:58 am
Posts: 20
I have not found any solution and probably because of a "another" bug in HibernateDocletTask.

I am wondering how many Hibernate users really use this tool and if the "top-down" approach is the best way to go. I mean on a big project with many POJOs it is really a pain if you have to manually correct the generated mappings every time. Furthermore I am forced to check each mapping for the proper convertion, very time consuming and it is easily to oversee wrong entries ...

Maybe one should drop the XDoclet-Hibernate approach at all?! Any experiences?

sven


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 13, 2004 5:59 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I use Xdoclet as my preferred approach (current project 200+ tables) most of the others create the mapping xml as their base (work from the middle).

Why not create JIRA issue and ask the XDoclet group..what about XDoclet 2.0 which has better support. What about fixing it and creating the patch - this gives something back. You have many options - some of which help yourself and the community - which is great.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 13, 2004 6:08 pm 
Beginner
Beginner

Joined: Mon Nov 08, 2004 11:58 am
Posts: 20
I also prefer XDoclet for setting up my hibernate mappings...


After investigating the xdt mappings of the xdoclet-hibernate module I have to rectify my last statement. I found out, that there is NO bug at all with the joined-subclass attribute. I simply declared the attributes in the wrong class (the superclass instead of the subclasses).

In the past I always used the superclass to declare a subclass. And as long as you have only one subclass to declare it works. That is why I never came up with the idea that the fault is on my side.

Thanks for your little challenge David. Otherwise I had never looked at the source of the hibernate module...

sven


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 13, 2004 7:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Glad you found the issue and hope you continue with the challenge. Thats how we grow the community and all benefit from it.


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.