Hi,
here is an example:
<nhibernate>
<add
key="hibernate.show_sql"
value="true"
/>
<add
key="hibernate.connection.provider"
value="NHibernate.Connection.DriverConnectionProvider"
/>
<add
key="hibernate.connection.driver_class"
value="NHibernate.Driver.FirebirdDriver"
/>
<add
key="hibernate.dialect"
value="NHibernate.Dialect.FirebirdDialect"
/>
<add
key="hibernate.connection.connection_string"
value="ServerType=1;User=YourUserName;Password=YourPassWord;Dialect=3;Database=cpt.fdb"
/>
One more hint: You can directly execute SQL statements via IDbCommand object. For example:
IDbCommand cmd;
cmd.CommandText = SQL-Statement
object result = cmd.ExecuteScalar();
You will see that COUNT(*) statements are multiple times faster with direct SQL instead of native NHibernate and most other things too. That's the prize you have to pay for the encapsulation I guess. Beside that NHibernate is quite interesting. Couldn't get GUIDs with charset OCTETS working though (see my other post) and finally went back to FIrebird native. A pity, I liked what I saw so far.
Stefan
|