-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to generate DDL in Hibernate using EJB3/JPA
PostPosted: Tue Jul 07, 2009 1:33 pm 
Newbie

Joined: Tue Jul 07, 2009 1:07 pm
Posts: 2
I'm developing an EJB3/JPA application that will use Hibernate for persistence. I need to be able to generate static DDL script that can be tuned by DBAs.

One possible alternative is to perhaps use EclipseLink jars only while generating the DDL.

Please let me know if there is a better way, just by using Hibernate jars.

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: How to generate DDL in Hibernate using EJB3/JPA
PostPosted: Wed Jul 08, 2009 4:47 am 
Beginner
Beginner

Joined: Thu Jun 30, 2005 1:04 pm
Posts: 26
Hello,

I use hibernate tools and ant task like this :
Code:
   <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="class.path" />

   <target name="jpa2ddl" depends="init"  description="build ddl from jpa files">
      <hibernatetool destdir="${generated.ddl.dir}">
         <jpaconfiguration/>
         <hbm2ddl drop="true" create="true" export="false" update="false" delimiter=";" format="true" outputfilename="${schema.export.file}" />
      </hibernatetool>
   </target>


Unfortunatly, this task look after a persistence.xml file.

See hibernate tools documentation for more details


Top
 Profile  
 
 Post subject: Re: How to generate DDL in Hibernate using EJB3/JPA
PostPosted: Wed Jul 08, 2009 5:16 pm 
Newbie

Joined: Tue Jul 07, 2009 1:07 pm
Posts: 2
Thanks for the information. I'll try this out.

I was planning to also try hbm2ddl that is bundled along with Hibernate.


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