-->
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: Command line utility to generate schema
PostPosted: Sun Oct 23, 2005 10:51 pm 
Regular
Regular

Joined: Sun Sep 25, 2005 11:35 pm
Posts: 57
Is there a command line utility to generate schemas. I know there is the SchemaExport class, but that requires writing a program.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 24, 2005 10:06 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
The program to write is very straighforward; so you can do your own one...

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 24, 2005 4:28 pm 
Regular
Regular

Joined: Sun Sep 25, 2005 11:35 pm
Posts: 57
I am not very savvy with loading assemblies and stuff, so this is the best I could do:

Code:
            Configuration config = new Configuration();
            config.Configure(
                System.Configuration.ConfigurationManager.AppSettings["nhibernate.config"]);
            NHibernate.Tool.hbm2ddl.SchemaExport schemaExport =
                new NHibernate.Tool.hbm2ddl.SchemaExport(config);
            schemaExport.Create(true, false);


However this approach required the assembly to be included with my program and thus the program is specific to this assembly. I was looking to find or write something more generic that could load any config file and assembly at runtime. Any pointer in the right direction would be much appreciated. Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 25, 2005 11:12 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
You can create a console/windows application that take as parameter the path to the xml file containing the configuration settings of NHibernate...

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


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.