HIBERNATE JBoss.org
 |  Register  | 
     
News 
About 
   Feature List 
   Road Map 
Documentation 
   Related Projects 
   External Documentation 
Download 
Forum & Mailinglists 
Support & Training 
JIRA Issue Tracking
Wiki Community Area


Hibernate Public Training Courses


Get Hibernate in Action eBook!


JavaWorld 2003 Finalist


Jolt Award 2004 Winner
      
Documentation > Community Area > Middlegen for Hibernate > Comments > Re: Making middlegen conditional


Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
Subject: Re: Making middlegen conditional 09 Jan 2004, 13:38
From: david Replies: 0, Views: 842
 
On 06 Jan 2004 21:33, craigduncan wrote:

>I am using middlegen and hibernate to generate hbm.xml files and java
>files from an existing database.  My ant script runs middlegen and all
>the output files from that process are written to the build dir.
>Consequently  an "ant clean" will remove all that generated code.  I
>would like to keep this behaviour as that is what you would expect a
>clean to do.  What I want to do is skip the middlgen target if the
>database has not changed.  Any suggestions on how to do this?  I have
>looked at the ant "uptodate" task but I can't see how to effectively
use
>that.

>I noticed in the example above there is a unless="middlegen.skip" and
>thought maybe you have figured out a way to do what I want to do.

>Thanks for any input.

>Craig Duncan


How you detect the database has changed is difficult. If you can just 
set the proerty and your done. If you cannot, you would know as a 
developer (maybe), so you can set the property on the Ant command line 
prepared for processing the target.
 

Thread:
 Making middlegen conditional 
 craigduncan   06 Jan 2004, 21:33 
 Re: Making middlegen conditional 
 david   09 Jan 2004, 13:38 
      

coWiki