Register  -  Login
Current Page:  Forums
Forum
 
  Forum  NHibernate  NHibernate Ital...  Nhibernate in VS senza project(.prj)
Previous Previous
 
Next Disabled
New Post 3/19/2007 4:30 PM
  mau
7 posts
No Ranking


Re: Nhibernate in VS senza project(.prj)  (Italy)

Please Help me!

Non va. Questi i miei file :

 

/////////////////UtenteInfo.hbm.xml

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

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" >

<!--<class name="UtenteInfo, App_Code" table="A_Utente">-->

<class name="Aql.BusinessLogicLayer.Utente.UtenteInfo, Aql.BusinessLogicLayer" table="A_Utente">

<id name="UserNameAQL" column="UserNameAQL" type="String" length="20">

<generator class="assigned" />

</id>

<property name="Nome" column="Nome" type="String" length="40"/>

<property name="Cognome" type="String" length="20"/>

</class>

</hibernate-mapping>

 

/////////////////UtenteInfo.vb (in ..\App_Code\VB\BLL\UtenteNH\)

Imports System

Imports System.Configuration

Imports System.Data

Namespace Aql.BusinessLogicLayer.Utente

'Namespace Aql.Modules.Utente

Public Class UtenteInfo

Private _UsernameAQL As String = ""

Private _Cognome As String

Private _Nome As String

Private _EMail As String

' Initialization

....

 

/////////////////web.config

<?xml version="1.0"?>

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<configSections>

<section

name="nhibernate"

type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

/>

</configSections>

<nhibernate>

<add

key="hibernate.connection.provider"

value="NHibernate.Connection.DriverConnectionProvider"

/>

<add

key="hibernate.dialect"

value="NHibernate.Dialect.MsSql2000Dialect"

/>

<add

key="hibernate.connection.driver_class"

value="NHibernate.Driver.SqlClientDriver"

/>

<add

key="hibernate.connection.connection_string"

value="Server=wwww;Database=xxx_Svil;uid=xx;pwd=xx;"

/>

</nhibernate>

.....

 

Dove sbaglio????????

Sto cavolo de assembly da dove lo prendo?

 

 

 
New Post 3/19/2007 4:34 PM
  mau
7 posts
No Ranking


Re: Nhibernate in VS senza project(.prj)  (Italy)

dimenticavo:

l'errore che mi da è persistent class Aql.BusinessLogicLayer.Utente.UtenteInfo, Aql.BusinessLogicLayer.Utente not found

nel momento in cui faccio cfg.AddXmlFile

 

 

////////////////////////file TASK.ASPX

Sub test()

Dim cfg As New NHibernate.Cfg.Configuration

'cfg.AddAssembly("Aql.BusinessLogicLayer")

cfg.AddAssembly(System.Reflection.Assembly.GetExecutingAssembly(), True)

 

Dim basePath As String = System.Web.HttpContext.Current.Server.MapPath("~/App_Code/VB/BLL/UtenteNH/NHMappings/")

 

cfg.AddXmlFile(basePath + "UtenteInfo.hbm.xml") //// ERROREEEEEEEEE  "persistent class Aql.BusinessLogicLayer.Utente.UtenteInfo, Aql.BusinessLogicLayer.Utente not found"

 

 

'cfg.AddFile("D:/Projects/ssss/WebSite/App_Code/VB/BLL/UtenteNH/NHMappings/Utente.hbm.xml")

Dim factory As ISessionFactory = cfg.BuildSessionFactory()

Dim session As ISession = factory.OpenSession()

Dim transaction As ITransaction = session.BeginTransaction()

 

Dim newUser As New UtenteInfo

newUser.UsernameAQL = "bb.vvv"

newUser.Nome = "aaaaa"

newUser.Cognome = "bbbb"

' Comunichiamo ad NHibernate che questo oggetto deve essere salvato

session.Save(newUser)

' Commit dei cambiamenti al database e chiusura della ISession

transaction.Commit()

session.Close()

 
New Post 3/19/2007 6:51 PM
  luke
60 posts
www.lukesoft.com
No Ranking


Re: Nhibernate in VS senza project(.prj)  (N/A)

sicuramente c'è un errore nel file di mapping, comincia a sistemarlo e poi vediamo se ce ne sono altri :

<class name="Aql.BusinessLogicLayer.Utente.UtenteInfo, Aql.BusinessLogicLayer" table="A_Utente">

deve in realtà essere

<class name="Aql.BusinessLogicLayer.Utente.UtenteInfo, Aql.BusinessLogicLayer.Utente" table="A_Utente">

il namespace deve essere lo stesso della classe.

 
New Post 3/20/2007 2:54 PM
  mau
7 posts
No Ranking


Re: Nhibernate in VS senza project(.prj)  (Italy)

fatto ma non cambia:

"persistent class Aql.BusinessLogicLayer.Utente.UtenteInfo, Aql.BusinessLogicLayer.Utente not found"

nella stessa riga, ossia, "cfg.AddXmlFile(basePath + "UtenteInfo.hbm.xml")"

 
New Post 3/20/2007 3:09 PM
  luke
60 posts
www.lukesoft.com
No Ranking


Re: Nhibernate in VS senza project(.prj)  (N/A)
ma che versione di NHibernate stai utilizzando ?
 
Previous Previous
 
Next Disabled
  Forum  NHibernate  NHibernate Ital...  Nhibernate in VS senza project(.prj)
  Print  


Licenza Creative Commons

Privacy Statement  |  Terms Of Use  |  Copyright 2005, 2007 by lukeSoft.com