-->
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.  [ 6 posts ] 
Author Message
 Post subject: middlegen dao generation
PostPosted: Tue Mar 08, 2005 10:53 am 
Beginner
Beginner

Joined: Wed Feb 23, 2005 9:24 am
Posts: 28
Hi all,

I'm using hibernate middlegen plugin for my DAOs generation.
I would like to know if it's possible to cutomise it like below:

1) all DAO will extends a given class
2) generate only methods signature (without codes) we can give.

any help would be greetly appreciated.

Meissa


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 08, 2005 8:21 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The Ant task for DAO generation has various argument to allow customised generation. In many cases this will not cover user's requires (since they can vary so much) so you can edit the velocity script to create what ever form of code you find necessary.


Top
 Profile  
 
 Post subject: middlegen
PostPosted: Wed Mar 09, 2005 5:56 am 
Beginner
Beginner

Joined: Wed Feb 23, 2005 9:24 am
Posts: 28
david wrote:
The Ant task for DAO generation has various argument to allow customised generation. In many cases this will not cover user's requires (since they can vary so much) so you can edit the velocity script to create what ever form of code you find necessary.



unfortunately I've never used velocity framework. I've been searching for a velocity script in vain.
Could you give me just a little example or point me out an url about hibernate DAO customisation throughout velocity.

Meissa


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 09, 2005 9:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The velocity script is found in the Middlegen-hibernate plugin jar.
Obviously, you could get the source as an alternative.
Unzip the jar for the hibernate plugin and look for the *.vm of which the DAO generator will be obvious. Compare your output with the script you will see it is fairly simple to follow how the code is generated from the template.
Further velocity specific information can be found on its own web site.


Top
 Profile  
 
 Post subject: Re: middlegen dao generation
PostPosted: Thu Feb 21, 2008 6:39 am 
Newbie

Joined: Thu Feb 21, 2008 4:57 am
Posts: 2
meissa wrote:
Hi all,

I'm using hibernate middlegen plugin for my DAOs generation.
I would like to know if it's possible to cutomise it like below:

1) all DAO will extends a given class
2) generate only methods signature (without codes) we can give.

any help would be greetly appreciated.

Meissa




Plssssssssssssss can u telll how DAO classes are generating by using Hibernate-middlegen. I can able to generate POJO classes not DAOs.

How i need to genertate those.. I am using hbm2java target like this

<!-- =================================================================== -->
<!-- Run hbm2java depends="middlegen" -->
<!-- =================================================================== -->
<taskdef
name="hbm2java"
classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask"
classpathref="lib.class.path"
/>
<target name="hbm2java" description="Generate .java from .hbm files.">

<hbm2java output="pojos">
<fileset dir="${build.gen-src.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</hbm2java>
</target>


Pleaseeeeeeee send thiss,
Thanks,
Mahesh


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 23, 2008 8:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Firstly, hbm2java and Middlegen are two different beasts (programs).

Answers
1) Middlgen has a option that is set in the Ant task to get the DAOs to be generated.

2) hbm2java - see documentation
http://www.hibernate.org/hib_docs/tools/reference/en/html/ant.html#d0e1193

is one of a number of exporters - choose the exporters to do what you require. See section 3.4.2 for a list of exporters - DAO is one of them.


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