From: <fab...@us...> - 2008-12-16 04:26:13
|
Revision: 3955 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3955&view=rev Author: fabiomaulo Date: 2008-12-16 04:26:06 +0000 (Tue, 16 Dec 2008) Log Message: ----------- Fix NH-1595 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs 2008-12-15 23:37:40 UTC (rev 3954) +++ trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs 2008-12-16 04:26:06 UTC (rev 3955) @@ -1,5 +1,6 @@ using System.Data; using System.Text; +using NHibernate.Dialect.Function; using NHibernate.SqlCommand; using NHibernate.Util; using System.Data.Common; @@ -44,6 +45,13 @@ RegisterColumnType(DbType.Time, "DATETIME"); RegisterColumnType(DbType.Boolean, "INTEGER"); RegisterColumnType(DbType.Guid, "UNIQUEIDENTIFIER"); + + RegisterFunction("second", new SQLFunctionTemplate(NHibernateUtil.Int32, "strftime(\"%S\", ?1)")); + RegisterFunction("minute", new SQLFunctionTemplate(NHibernateUtil.Int32, "strftime(\"%M\", ?1)")); + RegisterFunction("hour", new SQLFunctionTemplate(NHibernateUtil.Int32, "strftime(\"%H\", ?1)")); + RegisterFunction("day", new SQLFunctionTemplate(NHibernateUtil.Int32, "strftime(\"%d\", ?1)")); + RegisterFunction("month", new SQLFunctionTemplate(NHibernateUtil.Int32, "strftime(\"%m\", ?1)")); + RegisterFunction("year", new SQLFunctionTemplate(NHibernateUtil.Int32, "strftime(\"%Y\", ?1)")); } public override Schema.IDataBaseSchema GetDataBaseSchema(DbConnection connection) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |