-->
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: How to generate DDL in Hiberante3 with annotations aproach
PostPosted: Fri Feb 04, 2005 12:19 pm 
Beginner
Beginner

Joined: Wed Jan 21, 2004 10:52 pm
Posts: 27
Location: Santa Cruz do Sul - RS - Brazil
Hibernate version:
3beta3

Name and version of the database you are using:
Postgres 8rc1 on WindowsXP

In Hibernate2x I use xdoclet to create hbm files and Ant task to generate DDL scripts...

But, in Hibernate3, using Java annotations (in ejb3 on JBoss) how can I create DDL script?

I know that's possible to use
Code:
hibernate.hbm2ddl.auto=create
property in ejb3 package, but I can't use It.

_________________
Do you still create DTO factories? Oh, no!
Try DTOptimzier now!
https://dtoptimizer.dev.java.net/


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 04, 2005 2:41 pm 
Pro
Pro

Joined: Fri Nov 19, 2004 5:52 pm
Posts: 232
Location: Chicago, IL
I just wrote a little program that uses the SchemaExport class programatically like the following.

Code:
SchemaExport se = new SchemaExport(SessionHelper.getConfiguration());
se.create(true, true);


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 05, 2005 7:35 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
It would be great it someone could write a new ant task based on the old one to handle schema generation.
Most certainly not so long.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 28, 2005 12:31 pm 
Beginner
Beginner

Joined: Sat Jan 17, 2004 5:35 am
Posts: 25
Location: Birmingham, UK
How do you see this working with regard to the separation between Hibernate and Hibernate-Annotations?

I guess the options are either adapt SchemaExportTask.getConfiguration() in Hibernate to attempt to construct an AnnotationConfiguration via reflection, or provide an annotation-specific version of SchemaExportTask that explicity creates an AnnotationConfiguration.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 28, 2005 2:25 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
STOP! ;)

we have an ant task for this (committed last week) in the tools package.

http://opensource.atlassian.com/project ... se/HBX-117

it will be part of the soon to be here tools release.

you can go build it from cvs if you want.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 28, 2005 2:42 pm 
Beginner
Beginner

Joined: Sat Jan 17, 2004 5:35 am
Posts: 25
Location: Birmingham, UK
Super, I assume you meant:
http://opensource.atlassian.com/project ... se/HBX-112

I'll look forward to the alpha3 release!

Cheers,

Mark


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.