NHibernate support
Posted: Thu 11 Feb 2010 10:54
Hello devart,
I was wondering if there was plans to support nhibernate?
I've written my own classes to support this, but I'm having a few issues.
Namely the first is that I have to turn off hbm2ddl.keywords.
Similar issue is explained here http://orbitalcoder.wordpress.com/2009/ ... rvedwords/.
And the second is I'm also getting
Here's my code to support nhibernate. (Note I'm using the default sqlite dialect and configuration via fluent)
Fluent support
Nhibernate support
[/url]
I was wondering if there was plans to support nhibernate?
I've written my own classes to support this, but I'm having a few issues.
Namely the first is that I have to turn off hbm2ddl.keywords.
Similar issue is explained here http://orbitalcoder.wordpress.com/2009/ ... rvedwords/.
And the second is I'm also getting
which I see was questioned here http://www.devart.com/forums/viewtopic. ... ight=range, but answered by email.NHibernate.ADOException : could not execute query
[ SELECT this_.ModelID as ModelID20_0_, this_.Version as Version20_0_, this_.Descriptor as Descriptor20_0_, this_.CreatedBy as CreatedBy20_0_, this_.CreatedOn as CreatedOn20_0_, this_.ModifiedBy as ModifiedBy20_0_, this_.ModifiedOn as ModifiedOn20_0_, this_.IsDeleted as IsDeleted20_0_, this_.AssociationOneId as Associat9_20_0_, this_.AssociationTwoId as Associa10_20_0_ FROM Models this_ WHERE this_.Descriptor in (@p0, @p1, @p2, @p3, @p4, @p5) limit 2 offset 2 ]
Positional parameters: #0>a #1>b #2>c #3>d #4>e #5>f
[SQL: SELECT this_.ModelID as ModelID20_0_, this_.Version as Version20_0_, this_.Descriptor as Descriptor20_0_, this_.CreatedBy as CreatedBy20_0_, this_.CreatedOn as CreatedOn20_0_, this_.ModifiedBy as ModifiedBy20_0_, this_.ModifiedOn as ModifiedOn20_0_, this_.IsDeleted as IsDeleted20_0_, this_.AssociationOneId as Associat9_20_0_, this_.AssociationTwoId as Associa10_20_0_ FROM Models this_ WHERE this_.Descriptor in (@p0, @p1, @p2, @p3, @p4, @p5) limit 2 offset 2]
----> Devart.Data.SQLite.SQLiteException : 2nd parameter to sqlite3_bind() out of range
bind or column index out of range
Here's my code to support nhibernate. (Note I'm using the default sqlite dialect and configuration via fluent)
Fluent support
Code: Select all
public class DevartSqliteConfiguration : PersistenceConfiguration
{
public static DevartSqliteConfiguration Standard
{
get { return new DevartSqliteConfiguration(); }
}
public DevartSqliteConfiguration()
{
Driver();
Dialect();
Raw("query.substitutions", "true=1;false=0");
}
public DevartSqliteConfiguration InMemory()
{
Raw("connection.release_mode", "on_close");
return ConnectionString(c => c
.Is("Data Source=:memory:;Version=3;New=True;"));
}
public DevartSqliteConfiguration UsingFile(string fileName)
{
return ConnectionString(c => c
.Is(string.Format("Data Source={0};Version=3;New=True;", fileName)));
}
public DevartSqliteConfiguration UsingFileWithPassword(string fileName, string password)
{
return ConnectionString(c => c
.Is(string.Format("Data Source={0};Version=3;New=True;Password={1};", fileName, password)));
}
}
Code: Select all
public class DevartSqliteDriver : ReflectionBasedDriver
{
public DevartSqliteDriver()
: base(
"Devart.Data.SQLite",
"Devart.Data.SQLite.SQLiteConnection",
"Devart.Data.SQLite.SQLiteCommand")
{
}
public override bool UseNamedPrefixInSql
{
get { return true; }
}
public override bool UseNamedPrefixInParameter
{
get { return true; }
}
public override string NamedPrefix
{
get { return "@"; }
}
public override bool SupportsMultipleOpenReaders
{
get { return false; }
}
public override bool SupportsMultipleQueries
{
get { return true; }
}
}