-->
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.  [ 3 posts ] 
Author Message
 Post subject: Generating POJO's one at time
PostPosted: Tue Jan 31, 2006 10:39 am 
Newbie

Joined: Tue Nov 25, 2003 12:26 pm
Posts: 12
We are upgrading from Hibernate 2.1 to Hibernate 3.1. Using version 2.1 hibernate tools I was able to generate POJO's for HBM files one at time using the class net.sf.hibernate.tool.hbm2java.CodeGenerator with parameters that gave the template name, the output location and the hbm file.

I haven't been able to figure out how to create POJO's one at a time using Hibernate3Tools.

Is there a way?

_________________
Arthur Fitt


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 31, 2006 11:52 am 
Regular
Regular

Joined: Tue Nov 29, 2005 12:31 pm
Posts: 75
Use org.hibernate.tool.hbm2x.POJOExporter.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 31, 2006 11:58 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
currently no - and it only worked in the "old days" because it would ignore some associations which can/could result in pretty bad code generated.

Today the model has to be sound/complete, meaning if a mapping has an assocation to another mapping both mappings have to be included and we automatically dump all classes.

Anyways, you can write your own Exporter or simply write a template that only exports a set of the pojos. Look at POJOExporter for how it is done programmatically

a thing that might work (as a sideeffect) is that you could put some logic in the top of pojo.vm which would either generate the right contents or let the file be empty. If the output is empty we dont generate a file for it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.