Thread:
 Another example for XDOCLET ... 
 invizible   21 Apr 2006, 12:21 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: invizible (21 Apr 2006, 12:21) Replies: 0, Views: 25779
Subject: Another example for XDOCLET ...
Hi, 
  I use XDOCLET to generate both hibernate.cfg.xml and *.hbm.xml 
files. Here is the ant target to do both. please free to change it 
accoridng to your needs. 

NOTE : change the "xdoclet.classpath" property based on your classpath

<target name="hibernate" depends="init-xdoclet" description="creates 
hibernate config file">
		<taskdef name="hibernatedoclet" 
classname="xdoclet.modules.hibernate.HibernateDocletTask" 
classpathref="xdoclet.classpath" />
		
		<hibernatedoclet 
excludedtags="@version,@author,@todo" 
			destdir="${build.dir}" 
			force="false" 
			verbose="true">

			<fileset dir="${java.dir}">
				<include name="**/*.java" />
			</fileset>
			<hibernate version="2.0" />
			<hibernatecfg
				dataSource="java:/OracleDS" 
			
	dialect="org.hibernate.dialect.OracleDialect" 
			
	jndiname="java:/hibernate/SessionFactory" 
			
	cacheProviderClass="org.hibernate.cache.EhCacheProvider" 
			
	transactionManagerStrategy="org.hibernate.transaction.JTATran
sactionFactory" 
			
	transactionManagerLookup="org.hibernate.transaction.JBossTran
sactionManagerLookup" >
				<otherProperty 
name="current_session_context_class" 
value="cdot.ctis.controller.ExtendedThreadLocalSessionContext" />
			</hibernatecfg>
		</hibernatedoclet>
	</target>
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]