-->
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.  [ 8 posts ] 
Author Message
 Post subject: argument order in hbm2java-generated constructors
PostPosted: Fri Nov 04, 2005 6:25 pm 
Newbie

Joined: Fri Nov 04, 2005 4:31 pm
Posts: 3
Location: Palo Alto, CA
With recent check ins, the hbm2java is now generating full & minimal constructors. Excellent! I have this issue though:

It seems the argument order generated for full constructors is different than in Hibernate2. The new order appears to parallel the order properties are appear in the mapping file.

Is the generated argument order now defined to match the mapping file (would be a good thing in my opinion) or is an artifact of the implementation & could change with each release?

Similarly for minimal constructors -- with the additional issue that the selection of what constitutes minimal seems to have changed also.

Thanks for any guidance


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 05, 2005 5:06 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
this was why i hesitated to add it in the first place - not possible to get really right ;)

Any ways, the order is the order in which hibernate meta model returns the properties (and that should reflect the order from the mapping files as much as possible)

What has changed on the minimal definition ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 07, 2005 1:46 pm 
Senior
Senior

Joined: Mon Apr 04, 2005 8:04 am
Posts: 128
Location: Manchester, NH USA
I noticed that the version property is now showing up in the minimal constructor and the full constructor - this didn't happen before, at least for me.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 07, 2005 3:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ahh...that one should probably be removed yes. put it in jira.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 12:15 pm 
Senior
Senior

Joined: Mon Apr 04, 2005 8:04 am
Posts: 128
Location: Manchester, NH USA
Done - HBX-474. Thanks max!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 5:51 pm 
Newbie

Joined: Fri Nov 04, 2005 4:31 pm
Posts: 3
Location: Palo Alto, CA
max wrote:
What has changed on the minimal definition ?


In the appended mapping file for a node in a tree, the old minimal constructor had 3 arguments -- position, vocabulary, children, the new has just 2, position and vocabulary. The new behavior makes more sense to me than the old, so maybe this counts as a fixed bug rather than changed behavior.

Code:
<class name="VocabularyItem" ... >
    ...   
    <set name="children" inverse="true" sort="natural">
        <key column="PARENT_ID"/>
        <one-to-many class="VocabularyItem"/>
    </set>   
   
    <many-to-one name="parent" class="VocabularyItem"
         not-null="false" column="PARENT_ID"/>
   
    <property name="position" type="integer" not-null="true" />

    <many-to-one name="vocabulary" class="Vocabulary"
            column="VOCAB_ID" not-null="true"/>
           
</class>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 7:25 pm 
Newbie

Joined: Fri Nov 04, 2005 4:31 pm
Posts: 3
Location: Palo Alto, CA
nadams wrote:
In the appended mapping file for a node in a tree, the old minimal constructor had 3 arguments -- position, vocabulary, children, the new has just 2, position and vocabulary. The new behavior makes more sense to me than the old, so maybe this counts as a fixed bug rather than changed behavior.


After a little more messing around I'm not sure if the new behavior is a bug or a feature. What is the contract of the minimal constructor?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 7:52 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
minimal = non-id (except assigned), non-version and not nullable

_________________
Max
Don't forget to rate


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