Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
1.2.0GA
Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="SpringNetTest" assembly="SpringNetTest">
<class name="Product" table="Product">
<!-- A 32 hex character is our surrogate key. It's automatically
generated by NHibernate with the UUID pattern. -->
<id name="Id">
<column name="ID" />
<generator class="native" />
</id>
<!-- A cat has to have a name, but it shouldn' be too long. -->
<property name="Name">
<column name="name"/>
</property>
<property name="Description">
<column name="description"/>
</property>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
Sybase 12.5.3
The generated SQL (show_sql=true):
cant get that far :(
Debug level Hibernate log excerpt:
Hello, i am trying to connect to Sybase 12.5.3 from a C# application
here's my app.config
Code:
<nhibernate>
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<!-- Sybase -->
<add key="hibernate.dialect" value="NHibernate.Dialect.Sybase11Dialect, NHibernate.Dialect "/>
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.SybaseClientDriver, NHibernate.Driver"/>
<add key="hibernate.connection.connection_string"
value="Server=COL4_DEV_ASE;Provider=Sybase.Data.AseClient;DataSource=cdr001dev;UserID=osc_liv;Password=vernal" />
i keep on getting this exception
Code:
stacktrace= at NHibernate.Cfg.Configuration.LogAndThrow(MappingException me)
at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String
name)
at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String
name)
at NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly)
at NHibernate.Cfg.Configuration.AddClass(Type persistentClass)
at SpringNetTest.ProductManager..ctor() in C:\dotnet\SpringNetTest\SpringNetT
est\ProductManager.cs:line 21
Exception in constructor.Could not compile the mapping document: SpringNetTest.P
roduct.hbm.xml
FYI, line 21 of ProductManager.cs contains this code
Code:
config.AddClass(typeof(SpringNetTest.Product));
and the table created in Sybase is this
Code:
CREATE TABLE dbo.Product
(
ID int NULL,
name varchar(100) NULL,
description varchar(200) NULL
)
before connecting to Sybase, i have tried a local MSAccess database (exactly same table name and columns) and it worked fine...
anyone could tell me what i m doing wrong?
thanks and regards
marco