| Author |
Message |
|
|
Post subject: Hibernate reverse engineering and generics
Posted: 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 |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 23, 2009 - 10:16 AM
|
|
Moderator


Joined: Aug 21, 2004
Posts: 2518
|
|
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
|
| |
|
|
|
 |
|
|
Post subject: Hibernate reverse engineering and generics
Posted: 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 |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jan 27, 2012 - 06:42 PM
|
|
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 |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jan 30, 2012 - 08:06 AM
|
|

Joined: Nov 11, 2010
Posts: 2193
|
|
moilejter,
Thank you for the request. We already have an enhancement request filed.
The dev team is looking into it. |
_________________ Swapna
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jun 20, 2013 - 01:48 AM
|
|

Joined: Feb 01, 2006
Posts: 4
|
|
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 |
|
|
| |
|
|
|
 |
|
|