-->
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.  [ 4 posts ] 
Author Message
 Post subject: SchemaExport fails?
PostPosted: Sat Jul 16, 2005 8:20 pm 
Newbie

Joined: Mon Mar 29, 2004 1:08 pm
Posts: 10
I am attempting to generate a schema with the method below.

During testing, the "annotationConfiguration" parameter contains 3 annotated classes (within the annotatedClasses ArrayList of the AnnotationConfiguration object).

After instantiating a new SchemaExport, each of these annotated classes is set to null; and the create method neiither prints output to the console, nor creates the schema in the file indicated by the "fileName" parameter.

Any suggestions?

Thanks

Charlie Kelly
**************************************************************


protected static void exportSchemaToFile(String fileName, AnnotationConfiguration annotationConfiguration) throws Exception
{
try
{
SchemaExport schemaExport = new SchemaExport (annotationConfiguration);
schemaExport.setDelimiter(PersistenceController.SCHEMA_DELIMITER);

schemaExport.setOutputFile(fileName);
boolean script = true; // - print the DDL to the console
boolean export = true; // - export the script to the database
schemaExport.create(script, export);
}// try
catch (Exception e)
{
PersistenceLogger.logError (e.toString(), e);
throw new Exception (e);
}// catch (Exception e)
}//


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2005 2:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
use hibernate tools to generate from annotations - that works at least ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2005 12:30 pm 
Newbie

Joined: Mon Mar 29, 2004 1:08 pm
Posts: 10
Which Hibernate tool(s)?

Isn't SchemaExport a Hibernate tool?

Thanks

Charlie


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2005 12:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
sure - but just saying that if your task is simply to export annotations to the database/.sql then use the Hibernate Tools (tools.hibernate.org) which has ant tasks for it.

With respect to running it directly i cannot reproduce your problem since it works fine here ;)

_________________
Max
Don't forget to rate


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