-->
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: hibernate code generation - constructor methods
PostPosted: Mon Jul 02, 2007 1:10 pm 
how do i control the way the constructor methods are generated

for example, by default i get the following method generated

public Act(long id, Jurisdiction jurisdiction, Agency agency, String name) {
this.id = id;
this.jurisdiction = jurisdiction;
this.agency = agency;
this.name = name;
}


But i dont want this..instead i want the constructor method to look like the one below

public Act(Jurisdiction jurisdiction, String name) {
this.jurisdiction = jurisdiction;
this.name = name;
}


Top
  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 5:14 pm 
Newbie

Joined: Fri Feb 23, 2007 4:37 pm
Posts: 4
You need to customize pojo.ftl template file in HibernateTool. Unzip, modify the file, zip it back to get what you want. Taking out default constructor is the easiest path, because you never know when you have id or custId or something like that.

_________________
Tim


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.