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.  [ 2 posts ] 
Author Message
 Post subject: NHibernate Ms SQL Server 2008
PostPosted: Fri Feb 19, 2010 7:49 pm 
Newbie

Joined: Fri Feb 19, 2010 7:41 pm
Posts: 4
Hello, i'm new to the forum

I started the NHibernate in Action tutorial. I use NHibernate-2.1.2.GA-bin and MS SQL Server 2008
I try to test the HelloNHibernate exemple. Running the application: generate an exception in this line of code (program.cs)
Code:
c.AddAssembly(Assembly.GetCallingAssembly());

and poste: Could not compile the mapping document: HelloNHibernate.Employee.hbm.xml

this is the code of Employee.hbm.xml
Code:
<?xml version="1.0"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
auto-import="true">
  <class name="HelloNHibernate.Employee, HelloNHibernate" lazy="false">
    <id name="id" access="field">
      <generator class="native" />
    </id>
    <property name="name" access="field" column="name"/>
    <many-to-one access="field" name="manager" column="manager"
    cascade="all"/>
  </class>
</hibernate-mapping>


And this is the code of the Application Configuration File
Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 
  <configSections>
    <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
  </configSections>
 
  <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <session-factory>     
      <property name="connection.provider">
        NHibernate.Connection.DriverConnectionProvider
      </property>
      <property name="connection.driver_class">
        NHibernate.Driver.SqlClientDriver
      </property>
      <property name="connection.connection_string">
        Server=(local);database=HelloNHibernate;Integrated Security=SSPI;
      </property>
      <property name="dialect">
        NHibernate.Dialect.MsSql2008Dialect
      </property>
      <property name="show_sql">
        false
      </property>
    </session-factory>
  </hibernate-configuration>
</configuration>

I don't understand the problem, all the code is to copy paste from the tutorial :(
thank you for your help


Top
 Profile  
 
 Post subject: Re: NHibernate Ms SQL Server 2008
PostPosted: Sat Feb 20, 2010 5:16 pm 
Newbie

Joined: Fri Feb 19, 2010 7:41 pm
Posts: 4
Any one can help me pleeeeeeeeeeeeeeeeeeeeeeeease


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