problem 1 :
Exception: In expected: <end-of-text> (possibly an invalid or unmapped class name is used in the query) [from Customer]
Solution: See if the HQL statement query is an entity class and the mapping file property is correct: Copy to output directory à always copy. The build operation à embedded Resource.
problem 2 :
Exception: The Required property ' name ' is missing.
Solution: See if the name attribute is missing from the <property> node in the mapping file
problem 3 :
Exception: The type initializer for "NHibernate.Proxy.CastleProxyFactory" throws an exception.
Solution: NHibernate version issue. Remove the reference to NHibernate from the data access layer and the interface layer, referencing the nhibernate2.0 component, changing the configuration file (App.config/web.config), to nhibernate-.ga-src/src/ Nhibernatetext Copy the configuration information from the App. Config. NHibernate below.
problem 4 ,
Exception:Could not find the dialect in the configuration
Solution: Configuration file error. The Web project should be configured in the CONFIG. nhibernate configuration file. The application configures NHibernate in App. config.
problem 5.
Exception: Could not resolve Property:customerid Of:CompanyModels.Customer [from Companymodels.customer C where c.customerid=:c Ustomerid]
Solution: The field in the HQL statement is a property that represents the entity class and is case-sensitive.
problem 6 ,
Exception: should not
Solution: Change 2.0 to 2.2, 2.0 when generating the mapping file in Codesmith, and Nhibernate2 for 2.2
problem 7 ,
Exception: "Bag" in the element namespace "urn:nhibernate-mapping". "Many-to-many" in the child element namespace "urn:nhibernate-mapping". Invalid. Should be a list of possible elements: "Loader, Sql-insert, sql-update, Sql-delete, Sql-delete-all, filter" in the namespace "urn:nhibernate-mapping".
Solution: Many-to-many relationship mapping errors, see if there are multiple <many-to-many> nodes in the mapping file, if you delete one. Just refer to the corresponding entity class. Such as:
<bag name= "orderproducts" table= "Orderproduct" inverse= "false" lazy= "true" cascade= "All-delete-orphan" >
<key>
<column name= "' Order '" length= "4" sql-type= "int" not-null= "true"/>
</key>
<many-to-many class= "Companymodels.order, Companymodels" >
<column name= "Order" length= "4" sql-type= "int" not-null= "true"/>
</many-to-many>
<many-to-many class= "companymodels.product, Companymodels" >
<column name= "Product" length= "4" sql-type= "int" not-null= "true"/>
</many-to-many>
</bag>
Remove the first <many-to-many> to resolve.