-->
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.  [ 5 posts ] 
Author Message
 Post subject: Hibernate3 java code generation from mapping files
PostPosted: Wed May 18, 2005 9:27 am 
Newbie

Joined: Wed Apr 27, 2005 5:31 am
Posts: 5
Location: UK
Hi,

When I use the Eclipse "artifact generation plugin" to generate the Java class files from my mapping files, I'd like to create 2 java source files for each class (and have one extend the other - ie, each class has a 'abstract' then a 'concrete').

Any ideas what would be the best way to try and achieve this? Is it possible to do this by modifying the template files, or do I need to hack the source of the generation wizard to get it to generate more than the one file?

Thanks,

David.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 18, 2005 5:56 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you can set <meta attribute="generated-class"> for those you want this for. search for meta generated-class and you should find examples of what it can do.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 6:41 am 
Newbie

Joined: Wed Apr 27, 2005 5:31 am
Posts: 5
Location: UK
That's not really what I'm after (although it goes some way).

In the old hbm2java tool, you could specify a config.xml file, and use these options:

<param name="generate-concrete-empty-classes">true</param>
<param name="baseclass-prefix">Base</param>

How can I specify this when using the code generation wizard in the Hibernate3 toolset??

Thanks,

David.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 6:47 am 
Newbie

Joined: Wed Apr 27, 2005 5:31 am
Posts: 5
Location: UK
Correction: what I was after was a way to specify 2 renderers, which the old tool could do via this in the config.xml:


Code:
<codegen>
  <generate prefix="Base" renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer"/>
  <generate renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer">
      <param name="generate-concrete-empty-classes">true</param>
      <param name="baseclass-prefix">Base</param>
  </generate>
</codegen>


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 7:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
NYI for the velocity stuff....add a jira request

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