-->
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.  [ 9 posts ] 
Author Message
 Post subject: xdoclet and composite keys, just doesn't work?
PostPosted: Tue Dec 07, 2004 12:27 pm 
Newbie

Joined: Sun Apr 04, 2004 6:19 am
Posts: 15
Hibernate version: 2.1.7
xDoclet version: 1.2.2

I have problems with table with composite key having many-to-many relationship with other table.

This is what I write in javadoc for the relation (PARAMETER_NAME and PARAMETER_TYPE form a composite key):

Code:
    /**
     *            @hibernate.set
     *             lazy="true"
     *             cascade="none"
     *             table="MM_ATT_SET_TYPE_PARAM_INFO"
     *            @hibernate.collection-key
     *             column="ATTRIBUTE_SET_TYPE_ID"
     *
     *
     *            @hibernate.collection-many-to-many
     *             class="com.biofrontera.discovery.hibernate.ParameterInfo"
     *             column="PARAMETER_NAME"
     *            @hibernate.collection-many-to-many
     *             class="com.biofrontera.discovery.hibernate.ParameterInfo"
     *             column="PARAMETER_TYPE"
     *         
     */


xDoclet translates that into (i.e. loses key column):

Code:
      <many-to-many
                  class="com.biofrontera.discovery.hibernate.ParameterInfo"
                  column="PARAMETER_NAME"
                  outer-join="auto"
               />


instead of:

Code:
        <many-to-many
            class="com.biofrontera.discovery.hibernate.ParameterInfo"
        >
            <column name="PARAMETER_NAME" />
            <column name="PARAMETER_TYPE" />
        </many-to-many>




is it a xdoclet bug/"feature" or I am doing something wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 6:40 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Try:
Code:
    /**
     *            @hibernate.set
     *             lazy="true"
     *             cascade="none"
     *             table="MM_ATT_SET_TYPE_PARAM_INFO"
     *
     *            @hibernate.collection-key
     *             column="ATTRIBUTE_SET_TYPE_ID"
     *
     *            @hibernate.collection-many-to-many
     *             class="com.biofrontera.discovery.hibernate.ParameterInfo"
     *            @hibernate.column="PARAMETER_NAME"
     *            @hibernate.column="PARAMETER_TYPE"
     *         
     */

I did not try it so YMMV.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 10:47 am 
Newbie

Joined: Sun Apr 04, 2004 6:19 am
Posts: 15
Nope, doesn't work... Same result:

Code:
              <many-to-many
                  class="com.biofrontera.discovery.hibernate.ParameterInfo"
                  column="PARAMETER_NAME"
                  outer-join="auto"
               />


:(


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 10:58 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Dump xdoclet :) Really, if you can, the composite-key part of xdoclet always makes problems.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 11:19 am 
Newbie

Joined: Sun Apr 04, 2004 6:19 am
Posts: 15
michael wrote:
Dump xdoclet :) Really, if you can, the composite-key part of xdoclet always makes problems.


Yep :(

I need this composite key, because I want to have polymorphism in Parameter table on Parameter_Type field...

Is it possible to have discriminator field not in the main (I use on table per hierarchy) table? I.e. on a field from the other table with many-to-one relationship? Probably not :(


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 9:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
XDoclet normally gets the key information for composite keys from the Key class itself. Anyway, maybe XDoclet 2 will be better, I Understand alot of recent work has been done on the hibernate doclet for it.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 9:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Link xdoclet 2 plugin http://www.sourceforge.net/projects/xdoclet-plugins/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 13, 2004 12:17 pm 
Newbie

Joined: Sun Apr 04, 2004 6:19 am
Posts: 15
Sry, but where can I get the xdoclet2? (I guess it's required by the plugin)

What I see on http://xdoclet.codehaus.org/ is a 14kb jar ^^


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 13, 2004 12:37 pm 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
mikesu wrote:
Sry, but where can I get the xdoclet2? (I guess it's required by the plugin)

What I see on http://xdoclet.codehaus.org/ is a 14kb jar ^^


It's true. xdoclet-2 is pretty small... - it's plugins who do the job.

You could steal maven invocation code from build xdoclet-plugins, and it will download all dependencies for you atomatically...

_________________
Got new hibernate xdoclet plugin? http://www.sourceforge.net/projects/xdoclet-plugins/
... Momentan auf der Suche nach neuen Projekt ode Festanstellung....


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