-->
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.  [ 4 posts ] 
Author Message
 Post subject: hbmtemplate and toggle overwriting
PostPosted: Fri May 18, 2007 10:43 am 
Newbie

Joined: Fri Sep 15, 2006 2:09 am
Posts: 11
Hi.

I'm wondering, if there's an easy way to toggle whether hbmtemplate should overwrite existing files or not. I took a look at the POJO and Seam exporterclasses but I didn't find an option. Seems that the TemplateProducer always overwrites existing files. Is there something planned for the future?

After some digging I found something in the DAONewExporter:

Code:
    /**
     * Override to avoid overwriting the existing files
     * In the final version this should be moved to GenericExporter
     */
    protected void exportPOJO(Map additionalContext, POJOClass element)
    {
        String filename = resolveFilename(element);
        File file = new File(getOutputDirectory(), filename);
        if (file.exists() && !isOverwrite()) {
            log.warn("Skipping the generation of file " + file + " because target already exists");
        }
        else {
            super.exportPOJO(additionalContext, element);
        }
    }


Sounds that something is planned. For now I would have to implement my own GenericExporter which allows overwrite toggling.


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 19, 2007 1:11 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
on the todo list (possibly to be handled by the ArtifactCollector)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 12, 2007 10:43 am 
Newbie

Joined: Tue Apr 25, 2006 10:02 am
Posts: 2
Will there be a solution soon? I am having the same problem and copying my files to a tmp-dir an copying to the original place with ant is not what i expected...

Greetings,
Meaculpa


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 12, 2007 10:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Not soon since we are finalizing for GA currently.

It will be later - but sooner if someone contributes a workable patch.

_________________
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.  [ 4 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.