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: NHibernate.Tasks.Hbm2DdlTask
PostPosted: Fri Feb 29, 2008 9:50 am 
Beginner
Beginner

Joined: Fri Feb 29, 2008 9:36 am
Posts: 40
Hi,

I try to use NHibernate.Tasks.Hbm2DdlTask and I get an error. Perhaps an error code from me !

I have an assembly which contain xml files for tables.
I create à new project and I code:

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NHibernate;
using NHibernate.Tasks;

namespace Gensql
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            NHibernate.Tasks.Hbm2DdlTask hb = new NHibernate.Tasks.Hbm2DdlTask();
            hb.Execute();
        }
    }
}


My app.config is like that:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <hbm2ddl
   
    connectionprovider="NHibernate.Connection.DriverConnectionProvider"
    dialect="NHibernate.JetDriver.JetDialect, NHibernate.JetDriver"
    connectiondriverclass="NHibernate.JetDriver.JetDriver, NHibernate.JetDriver"
    connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Cardio.mdb"
    delimiter=" GO "
    outputtoconsole="false"
    exportonly="true"
    formatnice="true"
    outputfilename="c:\\toto.sql">
   
    <assemblies>
       <include name="D:\\Développements\\CSharp\\Gensql\\RessourcesDBMS\\bin\\Release\\RessourcesDBMS.dll" />   
    </assemblies>
   
  </hbm2ddl>
 
 
</configuration>


When I run my project, I get several errors:

{"Une exception a été levée par l'initialiseur de type pour 'NAnt.Core.Types.FileSet'."}

{"Une exception a été levée par l'initialiseur de type pour 'log4net.Core.LoggerManager'."}

"Une exception a été levée par l'initialiseur de type pour 'log4net.Core.LoggerManager'."

etc.

I don't understandwhy all these errors.

Can you help me please ?

(sorry for bad english, frenchy here )

Papy


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 03, 2008 9:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
Hbm2DdlTask is an NAnt extension task and is meant to be used in an NAnt build file. It is not meant to be used directly. It seems to me you are trying to create the database schema in code. Have a look at the NHibernate.Tool.hbm2ddl.SchemaExport class instead.

_________________
Karl Chu


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 10, 2008 2:22 pm 
Regular
Regular

Joined: Tue Oct 16, 2007 9:45 am
Posts: 93
Where is this class? Can it be used from comand line?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 10, 2008 2:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
The class is in the main NHibernate.dll. Fully qualified name per above post. No, it cannot be used on the command line; unless, of course, you write a console app that invokes the class.

_________________
Karl Chu


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.