narsil/Tanshu.Accounts.SqlDAO/Fluent/QueryStore.cs

41 lines
871 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Conventions;
using FluentNHibernate.Conventions.Instances;
using NHibernate;
using NHibernate.SqlCommand;
using System.Diagnostics;
namespace Tanshu.Accounts.SqlDAO
{
public static class QueryStore
{
private static string query;
public static string Query
{
get
{
return query;
}
set
{
query = value;
Debug.Write(query);
}
}
}
public class NHSQLInterceptor : EmptyInterceptor, IInterceptor
{
SqlString
IInterceptor.OnPrepareStatement
(SqlString sql)
{
QueryStore.Query = sql.ToString();
return sql;
}
}
}