- This topic has 5 replies, 5 voices, and was last updated 11 years, 6 months ago by raydawg2000.
-
AuthorPosts
-
Aniruddh ChitreMemberHi,
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<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
private Set audioformats = new HashSet(0);
instead of
private Set<AudioFormat> audioformats = new HashSet<AudioFormat>(0);
I get similar generics related warnings at other places.
Thanks & Regards,
Aniruddh
Brian FernandesModeratorAniruddh,
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.
Aniruddh ChitreMemberBrian,
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.xRegards,
Aniruddh
Moises LejterMemberLet 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
support-swapnaModeratormoilejter,
Thank you for the request. We already have an enhancement request filed.
The dev team is looking into it.
raydawg2000Participantis 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
-
AuthorPosts