-->
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.  [ 8 posts ] 
Author Message
 Post subject: Schema Update
PostPosted: Tue Mar 06, 2007 5:00 pm 
Newbie

Joined: Tue Mar 06, 2007 12:07 pm
Posts: 7
Is there a way that I can get the schema update script instead of updating the schema against the database directly?

Thanks,


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 06, 2007 8:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Personally I never go directly - always get the script (and modify as appropriate).

See the documentation for the options.

http://www.hibernate.org/hib_docs/v3/reference/en/html/toolsetguide.html#toolsetguide-s1-6


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 07, 2007 1:38 pm 
Newbie

Joined: Tue Mar 06, 2007 12:07 pm
Posts: 7
David, Thank you for your reply. But I am using the new HibernateTool, here is my ant script:

<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="ejb3toolslib" />

<hibernatetool destdir="Docs">
<jpaconfiguration persistenceunit="em"/>
<classpath>
<path location="bin/classes" />
</classpath>
<hbm2ddl export="false" update="true" format="true" outputfilename="updatescript.ddl"/>
</hibernatetool>

I was expecting an schema update script been generated but it's not.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 07, 2007 6:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
On the surface it looks OK. I dont have time to try it out at the moment. Maybe later - or Max will come in and help.

BTW: Have you tried getting it to dump the whole schema (update="false") and does the script get created?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 13, 2007 9:48 am 
Newbie

Joined: Tue Mar 06, 2007 12:07 pm
Posts: 7
Yes, I tried with update="false". The script is generated but this is for everything.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 19, 2007 11:32 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
could you be a tad more specific on what is wrong with update script ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 22, 2007 4:07 pm 
Newbie

Joined: Thu Sep 28, 2006 11:09 am
Posts: 4
Location: Auburndale, MA, USA
I had the same problem -- no output file !?! So I turned on logging and voila, the update script statements appeared in the log file. I run HBM2DDL via "ant" and I had to specify the following within the ant target definition :

<record name="schemaupdate.log" loglevel="debug"/>

The loglevel can also be set to "info" and the update stmts still appear. I also found the statements scrolling on my command window (win xp). The rest of my ant parms are set to this :

<hbm2ddl
outputfilename="schemaupdate.sql"
export="false"
update="true"
drop="true"
create="true"
delimiter="${db.gen.delimiter}"
/>

The "db.gen.delimiter" variable is defined earlier as a semi-colon. I'm not sure if the "drop" and "create" parms do anything, but I left them in anyway.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 22, 2007 4:10 pm 
Newbie

Joined: Thu Sep 28, 2006 11:09 am
Posts: 4
Location: Auburndale, MA, USA
I had the same problem -- no output file !?! So I turned on logging and voila, the update script statements appeared in the log file. I run HBM2DDL via "ant" and I had to specify the following within the ant target definition :

<record name="schemaupdate.log" loglevel="debug"/>

The loglevel can also be set to "info" and the update stmts still appear. I also found the statements scrolling on my command window (win xp). The rest of my ant parms are set to this :

<hbm2ddl
outputfilename="schemaupdate.sql"
export="false"
update="true"
drop="true"
create="true"
delimiter="${db.gen.delimiter}"
/>

The "db.gen.delimiter" variable is defined earlier as a semi-colon. I'm not sure if the "drop" and "create" parms do anything, but I left them in anyway.


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