Plugins (1057)


Training and Consulting (44)



EPIC Poll

What is your favourite developer portal?

[ Results | Polls ]

Votes: 541
Comments: 0

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Guest
Post subject: mapping bug?  PostPosted: Jun 21, 2006 - 03:14 PM






When I use this code:
Code:

<set name="comments" table="TRACK_COMMENTS">
   <key column="TRACK_ID" />
   <element type="string" column="COMMENT" />
</set>


It creates a set of type null, but shouldn't it be of type String?
private java.util.Set<null> comments;

Anyone know why this is the case?
 
   
Reply with quote Back to top
Guest
Post subject:   PostPosted: Jun 22, 2006 - 10:35 AM






Same Guy ^^

Here is another mapping that causes the generated code to give a type of null:
Code:

<list name="tracks" table="ALBUM_TRACKS">
         <meta attribute="use-in-tostring">true</meta>
         <key column="ALBUM_ID" />
         <index column="POSITION" />
         <composite-element class="com.orielly.hh.AlbumTrack">
            <many-to-one name="track"
               class="com.orielly.hh.Track">
               <meta attribute="use-in-tostring">true</meta>
               <column name="TRACK_ID" />
            </many-to-one>
            <property name="disc" type="integer" />
            <property name="positionOnDisc" type="integer" />
         </composite-element>
      </list>


It maps to this: private java.util.List<null> tracks;

But it should be private java.util.List<com.orielly.hh.AlbumTrack> tracks;



I am using Hibernate 3.0, and the examples I am getting this from is 2.0. Did the semantics change between versions which h-sync doesn't look out for?
 
   
Reply with quote Back to top
huangjd
Post subject:   PostPosted: Jun 22, 2006 - 10:52 AM



Joined: Jun 22, 2006
Posts: 3

I was those (huangjd) ^^
 
 View user's profile Send private message  
Reply with quote Back to top
Khazrak
Post subject:   PostPosted: Jun 29, 2006 - 04:45 AM
Guest





Hi there !

I got mapping generation bug too, don't know if it's the same as you two...

I use SQLServer05, Hibernate3.0 and jtds1.2, and when I want to generate hbm files, sometimes (and I just don't understand the rule for that), it didn't take the constraint to generate code...

Ex :
It put an pk in a property tag and not in an id tag
It did't make many-to-one and other relation, it put all in property tag

Did someone know something about this bug ?

Thx

Khazrak

PS : s'cuse my english, I'm from switzerland ^^
 
   
Reply with quote Back to top
maxxyme
4 Post subject:   PostPosted: Feb 04, 2008 - 04:36 AM



Joined: Jan 15, 2008
Posts: 5

As mentioned in this thread the support of nested <composite-element> seems to be unsupported in HibernateSynchronizer, or... in fact, BADLY supported.

I found the following threads related to this problem :
(Aug 19, 2005)
http://www.eclipseplugincentral.com/PNp ... ement.html
(Jul 20, 2004)
http://www.eclipseplugincentral.com/PNp ... ement.html
(Mar 25, 2004)
http://www.eclipseplugincentral.com/PNp ... ement.html


The last one (2005) let me to a possible work-around: setting the class="..." on the <set> tags, not just only on the <composite-element>, make the synchronization correctly generates what's expected.
But unfortunately, you have to remove the "fake" attribute as its not supported in the Hibernate DTD.
 
 View user's profile Send private message  
Reply with quote Back to top
maxxyme
Post subject:   PostPosted: Feb 04, 2008 - 05:38 AM



Joined: Jan 15, 2008
Posts: 5

I reported the problem into the Hibernate Synchronizer bug tracker hosted on SourceForge.net:

https://sourceforge.net/tracker/index.p ... tid=623990

Hope we'll an answer one day... if the project leader is not sleeping...?!
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits