-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate reverse engineering and generics without JPA
PostPosted: Thu Apr 19, 2012 4:43 am 
Newbie

Joined: Wed Apr 18, 2012 4:37 am
Posts: 7
I am currently using hibernate tools and reveng.xml with custom templates to generate my POJO code.
Sadly, I get the same problems as this guy here, who would (like me) like to have typed generics:
http://www.myeclipseide.com/PNphpBB2-vi ... 23016.html

Instead of generating: Set mySet = new HashSet(0);
I would like to have: Set<MyType> mySet = new HashSet<MyType>(0);

Only difference to him is my setup:
I use multiple generic exporters together with muliple hibernate.*.reveng.xml and various custom templates to generate:
- DAOs (<myClass>DAO.java)
- POJOs (abstract and non-abstract) each residing in different packages
- Hibernate Mapping Files (*.hbm.xml)

As far as I know, I then cannot use JPA in my current setup, as the classes are generated using a generic exporter and templates.
So next, I thought about tampering my templates, so annotations are generated and after that trigger the standard hbm2java exporter, who would then read the annotations and generate the final code. Is this approach silly or is there a better way to get the above typed generics in my generated Java code?

Thanx in advance!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.