MyEclipse Forums
This thread has been locked & this forum has been archived.
Please post new topics to Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
View previous topic Printable version Log in to check your private messages View next topic
Author Message
aniruddhc
Post subject: Hibernate reverse engineering and generics  PostPosted: Feb 23, 2009 - 06:40 AM



Joined: Feb 23, 2009
Posts: 4

Hi,
When generating code with Hibernate reverse engineering the generated code shows a lot of generics related warnings. For example the following is a mapping file snippet

Code:

        <set name="audioformats" inverse="true">
            <key>
                <column name="formatid" precision="9" scale="0" />
            </key>
            <one-to-many class="com.test.hibernate.AudioAsset" />
        </set>


This generates a property definition in the class as follows

Code:

     private Set audioformats = new HashSet(0);

instead of
Code:

     private Set<AudioFormat>  audioformats  = new HashSet<AudioFormat>(0);


I get similar generics related warnings at other places.

Thanks & Regards,
Aniruddh
 
 View user's profile Send private message  
Reply with quote Back to top
Support-Brian
Post subject:   PostPosted: Feb 23, 2009 - 10:16 AM
Moderator
Moderator


Joined: Aug 21, 2004
Posts: 2583

Aniruddh,

We do generate generic code (like typed collections) if you use Hibernate 3.2 with annotations instead of mapping files. There is no UI control which will turn on generic generation for other cases. Please let us know if you need this feature.

_________________
Brian
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
aniruddhc
Post subject: Hibernate reverse engineering and generics  PostPosted: Feb 23, 2009 - 10:25 AM



Joined: Feb 23, 2009
Posts: 4

Brian,
Thanks for the reply. I will try code generation with annotations. It would be great to have generics based code generated for mapping files as well. This might be very be very helpful when migrating from Hibernate 2.x

Regards,
Aniruddh
 
 View user's profile Send private message  
Reply with quote Back to top
moilejter
Post subject:   PostPosted: Jan 27, 2012 - 06:42 PM
Registered Member
Registered Member


Joined: Feb 19, 2009
Posts: 12

Let me second this request for the ability to generate code using generic, even if not generating code with annotations. (Not sure if you already support it - we are still at MyEclipse 8.6, and it does not seem to be an option there...).

Moises
 
 View user's profile Send private message  
Reply with quote Back to top
support-swapna
Post subject:   PostPosted: Jan 30, 2012 - 08:06 AM



Joined: Nov 11, 2010
Posts: 2491

moilejter,

Thank you for the request. We already have an enhancement request filed.
The dev team is looking into it.

_________________
Swapna
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
raydawg2000
Post subject:   PostPosted: Jun 20, 2013 - 01:48 AM



Joined: Feb 01, 2006
Posts: 6

is there any update to this feature for xml mapping files? This would be great to have. I have a couple regExps I run through eclipse to generate this stuff for me after the fact but its a pain and not always accurate! thanks
 
 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
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits