-->
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.  [ 2 posts ] 
Author Message
 Post subject: Code indentation, implements and serialVersionID
PostPosted: Wed Aug 25, 2010 2:46 am 
Newbie

Joined: Wed Aug 25, 2010 2:23 am
Posts: 1
Hello

I am using hibernate tools to generate java code from database tables (reengineering) with JPA annotations. I have encounter following problems:

1. Code indentation is 8 spaces long. Is there any possibility to change it to 4 ?
2. Every generated class implements java.io.Serializable. I prefer to have in place of class declaration following senetence: class MyName implements Serializable and import java.io.Serializable. How to achieve this ?
3. Every class should have serialVersionID generated. How to generate it ?

Lukasz


Top
 Profile  
 
 Post subject: Re: Code indentation, implements and serialVersionID
PostPosted: Fri Sep 03, 2010 3:47 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
See the documentation how to use meta attributes to customize export.
To change "implements" section use "implements" meta attribute.
Also you'll need "extra-import".
For generation of serialVersionID create generator object and use it in custom template.
For example change PojoFields.ftl template so it uses your generator and creates additional field.


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

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.