I believe I'm misusing NHibernate in this example, but the error I get is not at all what I was expecting. The interesting thing is that the SQL found in the log executes fine when I replace the parameters with values, so I know the SQL isnt' the problem. If any one has successfully done something like this, please chime in.
Here is the code I have in a test unit:
Code:
try {
string sql = "SELECT o.BULK_ORDER_ID as {cos1.BulkOrderId}, o.TRACKING_NUM as {cos1.TrackingNum}, COUNT(*) AS {cos1.Total}, "+
"SUM(CASE WHEN o.order_status_type_id IN (9, 11) THEN 1 ELSE 0 END) AS {cos1.OrdersCompleted}, "+
"SUM(CASE WHEN o.order_status_type_id = 10 THEN 1 ELSE 0 END) AS {cos1.OrdersOnHold}, "+
"SUM(CASE WHEN o.order_status_type_id IN (15, 19, 22, 23, 27) THEN 1 ELSE 0 END) AS {cos1.OrdersInQa}, "+
"MIN(o.CL_ORD_DT) AS {cos1.MinOrderDate}, 0 AS {cos1.Type}, bo.CL_PERS_ID as {cos1.ClientPersId}, "+
"cp.FIRST_NAME as {cos1.FirstName}, cp.LAST_NAME as {cos1.LastName}, bo.SYS_LOGIN_ID as {cos1.SysLoginId}, "+
"cp1.FIRST_NAME AS {cos1.ByFname}, cp1.LAST_NAME AS {cos1.ByLname}, o.CL_DEPT_ID as {cos1.ClDeptId} "+
"FROM [ORDER] as o "+
"INNER JOIN BULK_ORDER as bo ON (o.BULK_ORDER_ID = bo.BULK_ORDER_ID) "+
"LEFT OUTER JOIN CL_PERS as cp1 ON (bo.SYS_LOGIN_ID = cp1.SYS_LOGIN_ID) "+
"LEFT OUTER JOIN CL_PERS as cp ON (bo.CL_PERS_ID = cp.CL_PERS_ID) "+
"WHERE o.CL_ID = :Clid AND o.CL_ORD_DT > :ClOrdDtMin AND o.BULK_ORDER_ID IS NOT NULL "+
"GROUP BY o.BULK_ORDER_ID, o.TRACKING_NUM, bo.CL_PERS_ID, cp.FIRST_NAME, "+
"cp.LAST_NAME, bo.SYS_LOGIN_ID, cp1.FIRST_NAME, "+
"cp1.LAST_NAME, o.CL_DEPT_ID "+
"UNION "+
"SELECT 0 as {cos1.BulkOrderId}, '' as {cos1.TrackingNum}, COUNT(*) AS {cos1.Total}, "+
"SUM(CASE WHEN o.order_status_type_id IN (9, 11) THEN 1 ELSE 0 END) AS {cos1.OrdersCompleted}, "+
"SUM(CASE WHEN o.order_status_type_id = 10 THEN 1 ELSE 0 END) AS {cos1.OrdersOnHold}, "+
"SUM(CASE WHEN o.order_status_type_id IN (15, 19, 22, 23, 27) THEN 1 ELSE 0 END) AS {cos1.OrdersInQa}, "+
"MIN(o.CL_ORD_DT) AS {cos1.MinOrderDate}, 1 AS {cos1.Type}, 0 as {cos1.ClientPersId}, '' as {cos1.FirstName}, "+
"'' as {cos1.LastName}, 0 as {cos1.SysLoginId}, '' AS {cos1.ByFname}, '' AS {cos1.ByLname}, 0 as {cos1.ClDeptId} "+
"FROM [ORDER] as o "+
"WHERE o.CL_ID = :Clid AND o.CL_ORD_DT > :ClOrdDtMin AND o.BULK_ORDER_ID IS NULL";
IQuery qry = _mgr.Session.CreateSQLQuery(sql, "cos1", typeof(SourceNet.Data.SQLObjects.ClientOrderSummary1));
qry.SetInt32("Clid", 56);
qry.SetDateTime("ClOrdDtMin", new DateTime(2005, 6, 1));
IList results = qry.List();
} catch(Exception e) {
Console.WriteLine("TEST ERROR\n{0}", e.Message);
Console.WriteLine("STACK TRACE\n{0}", e.StackTrace);
Console.WriteLine("INNNER ERROR\n{0}", e.InnerException);
Assert.IsTrue(false, "SQL Object not obtained.");
}
The output is:
Quote:
TEST ERROR
NO_ID0_
STACK TRACE
at System.Data.Common.FieldNameLookup.GetOrdinal(String fieldName)
at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
at NHibernate.Driver.NHybridDataReader.GetOrdinal(String name)
at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String name)
at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String[] names, ISessionImplementor session, Object owner)
at NHibernate.Loader.Loader.GetKeyFromResultSet(Int32 i, ILoadable persister, Object id, IDataReader rs, ISessionImplementor session)
at NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader resultSet, ISessionImplementor session, QueryParameters queryParameters, IList hydratedObjects, Object optionalObject, Object optionalId, Key[] keys, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
at NHibernate.Impl.SessionImpl.FindBySQL(String sqlQuery, String[] aliases, Type[] classes, QueryParameters queryParameters, ICollection querySpaces)
at NHibernate.Impl.SqlQueryImpl.List()
at Test.SQLMap_TestFixture.SQL_NH_ClientOrderSummary1() in c:\data\sourcenet\data\test\sqlmap_testfixture.cs:line 132
INNNER ERROR
Map
Code:
<hibernate-mapping namespace="SourceNet.Data.SQLObjects" xmlns="urn:nhibernate-mapping-2.0">
<class name="SourceNet.Data.SQLObjects.ClientOrderSummary1, SourceNet.Data" table="NOT_REAL_TABLE" lazy="false" mutable="false">
<id column="NO_ID" type="Int32" access="field.camelcase-underscore" name="NoId">
<generator class="assigned" />
</id>
<property column="BULK_ORDER_ID" name="BulkOrderId" access="field.camelcase-underscore" type="Int32"/>
<property column="TRACKING_NUM" name="TrackingNum" access="field.camelcase-underscore" type="String"/>
<property column="TOTAL" name="Total" access="field.camelcase-underscore" type="Int32"/>
<property column="ORDERS_COMPLETED" name="OrdersCompleted" access="field.camelcase-underscore" type="Int32"/>
<property column="ORDERS_ON_HOLD" name="OrdersOnHold" access="field.camelcase-underscore" type="Int32"/>
<property column="ORDERS_IN_QA" name="OrdersInQa" access="field.camelcase-underscore" type="Int32"/>
<property column="TYPE" name="Type" access="field.camelcase-underscore" type="Int32"/>
<property column="CL_PERS_ID" name="ClientPersId" access="field.camelcase-underscore" type="Int32"/>
<property column="SYS_LOGIN_ID" name="SysLoginId" access="field.camelcase-underscore" type="Int32"/>
<property column="CL_DEPT_ID" name="ClDeptId" access="field.camelcase-underscore" type="Int32"/>
<property column="MIN_ORD_DT" name="MinOrderDate" access="field.camelcase-underscore" type="DateTime"/>
<property column="FIRST_NAME" name="FirstName" access="field.camelcase-underscore" type="String"/>
<property column="LAST_NAME" name="LastName" access="field.camelcase-underscore" type="String"/>
<property column="BY_FNAME" name="ByFname" access="field.camelcase-underscore" type="String"/>
<property column="BY_LNAME" name="ByLname" access="field.camelcase-underscore" type="String"/>
</class>
</hibernate-mapping>
Log
Quote:
2005-08-29 14:19:05,537 [7028] INFO NHibernate.Impl.SessionFactoryImpl [(null)] <(null)> - building session factory
2005-08-29 14:19:05,537 [7028] DEBUG NHibernate.Impl.SessionFactoryImpl [(null)] <(null)> - instantiating session factory with properties: hibernate.connection.isolation=ReadCommitted;hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N';hibernate.use_outer_join=false;hibernate.connection.connection_string=***;hibernate.connection.driver_class=NHibernate.Driver.SqlClientDriver;hibernate.connection.provider=NHibernate.Connection.DriverConnectionProvider;hibernate.dialect=NHibernate.Dialect.MsSql2000Dialect;hibernate.show_sql=true;
2005-08-29 14:19:05,677 [7028] DEBUG NHibernate.SqlCommand.SqlSelectBuilder [(null)] <(null)> - The initial capacity was set too low at: 9 for the SelectSqlBuilder that needed a capacity of: 13 for the table SALES_PERS_CL_DEPT_XREF salesper0_
2005-08-29 14:19:05,693 [7028] DEBUG NHibernate.SqlCommand.SqlSelectBuilder [(null)] <(null)> - The initial capacity was set too low at: 9 for the SelectSqlBuilder that needed a capacity of: 13 for the table CL_REP_XREF clientre0_
2005-08-29 14:19:05,693 [7028] DEBUG NHibernate.Impl.SessionFactoryObjectFactory [(null)] <(null)> - initializing class SessionFactoryObjectFactory
2005-08-29 14:19:05,693 [7028] DEBUG NHibernate.Impl.SessionFactoryObjectFactory [(null)] <(null)> - registered: 84abb171324d4c12b07879d30add391f(unnamed)
2005-08-29 14:19:05,693 [7028] INFO NHibernate.Impl.SessionFactoryObjectFactory [(null)] <(null)> - no name configured
2005-08-29 14:19:05,693 [7028] DEBUG NHibernate.Impl.SessionFactoryImpl [(null)] <(null)> - Instantiated session factory
2005-08-29 14:19:05,740 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - opened session
2005-08-29 14:19:05,756 [7028] INFO NHibernate.Impl.SessionImpl [(null)] <(null)> - SQL Query: SELECT o.BULK_ORDER_ID as {cos1.BulkOrderId}, o.TRACKING_NUM as {cos1.TrackingNum}, COUNT(*) AS {cos1.Total}, SUM(CASE WHEN o.order_status_type_id IN (9, 11) THEN 1 ELSE 0 END) AS {cos1.OrdersCompleted}, SUM(CASE WHEN o.order_status_type_id = 10 THEN 1 ELSE 0 END) AS {cos1.OrdersOnHold}, SUM(CASE WHEN o.order_status_type_id IN (15, 19, 22, 23, 27) THEN 1 ELSE 0 END) AS {cos1.OrdersInQa}, MIN(o.CL_ORD_DT) AS {cos1.MinOrderDate}, 0 AS {cos1.Type}, bo.CL_PERS_ID as {cos1.ClientPersId}, cp.FIRST_NAME as {cos1.FirstName}, cp.LAST_NAME as {cos1.LastName}, bo.SYS_LOGIN_ID as {cos1.SysLoginId}, cp1.FIRST_NAME AS {cos1.ByFname}, cp1.LAST_NAME AS {cos1.ByLname}, o.CL_DEPT_ID as {cos1.ClDeptId} FROM [ORDER] as o INNER JOIN BULK_ORDER as bo ON (o.BULK_ORDER_ID = bo.BULK_ORDER_ID) LEFT OUTER JOIN CL_PERS as cp1 ON (bo.SYS_LOGIN_ID = cp1.SYS_LOGIN_ID) LEFT OUTER JOIN CL_PERS as cp ON (bo.CL_PERS_ID = cp.CL_PERS_ID) WHERE o.CL_ID = :Clid AND o.CL_ORD_DT > :ClOrdDtMin AND o.BULK_ORDER_ID IS NOT NULL GROUP BY o.BULK_ORDER_ID, o.TRACKING_NUM, bo.CL_PERS_ID, cp.FIRST_NAME, cp.LAST_NAME, bo.SYS_LOGIN_ID, cp1.FIRST_NAME, cp1.LAST_NAME, o.CL_DEPT_ID UNION SELECT 0 as {cos1.BulkOrderId}, '' as {cos1.TrackingNum}, COUNT(*) AS {cos1.Total}, SUM(CASE WHEN o.order_status_type_id IN (9, 11) THEN 1 ELSE 0 END) AS {cos1.OrdersCompleted}, SUM(CASE WHEN o.order_status_type_id = 10 THEN 1 ELSE 0 END) AS {cos1.OrdersOnHold}, SUM(CASE WHEN o.order_status_type_id IN (15, 19, 22, 23, 27) THEN 1 ELSE 0 END) AS {cos1.OrdersInQa}, MIN(o.CL_ORD_DT) AS {cos1.MinOrderDate}, 1 AS {cos1.Type}, 0 as {cos1.ClientPersId}, '' as {cos1.FirstName}, '' as {cos1.LastName}, 0 as {cos1.SysLoginId}, '' AS {cos1.ByFname}, '' AS {cos1.ByLname}, 0 as {cos1.ClDeptId} FROM [ORDER] as o WHERE o.CL_ID = :Clid AND o.CL_ORD_DT > :ClOrdDtMin AND o.BULK_ORDER_ID IS NULL
2005-08-29 14:19:05,756 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - flushing session
2005-08-29 14:19:05,756 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Flushing entities and processing referenced collections
2005-08-29 14:19:05,756 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Processing unreferenced collections
2005-08-29 14:19:05,756 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Processed 0 unreachable collections.
2005-08-29 14:19:05,756 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - scheduling collection removes/(re)creates/updates
2005-08-29 14:19:05,756 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Processed 0 for recreate (0), remove (0), and update (0)
2005-08-29 14:19:05,756 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
2005-08-29 14:19:05,756 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2005-08-29 14:19:05,756 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - dont need to execute flush
2005-08-29 14:19:05,771 [7028] DEBUG NHibernate.Impl.BatcherImpl [(null)] <(null)> - Opened new IDbCommand, open IDbCommands :1
2005-08-29 14:19:05,771 [7028] DEBUG NHibernate.Impl.BatcherImpl [(null)] <(null)> - Building an IDbCommand object for the SqlString: SELECT o.BULK_ORDER_ID as BULK_ORD2_0_, o.TRACKING_NUM as TRACKING3_0_, COUNT(*) AS TOTAL0_, SUM(CASE WHEN o.order_status_type_id IN (9, 11) THEN 1 ELSE 0 END) AS ORDERS_C5_0_, SUM(CASE WHEN o.order_status_type_id = 10 THEN 1 ELSE 0 END) AS ORDERS_O6_0_, SUM(CASE WHEN o.order_status_type_id IN (15, 19, 22, 23, 27) THEN 1 ELSE 0 END) AS ORDERS_I7_0_, MIN(o.CL_ORD_DT) AS MIN_ORD_DT0_, 0 AS TYPE0_, bo.CL_PERS_ID as CL_PERS_ID0_, cp.FIRST_NAME as FIRST_NAME0_, cp.LAST_NAME as LAST_NAME0_, bo.SYS_LOGIN_ID as SYS_LOG10_0_, cp1.FIRST_NAME AS BY_FNAME0_, cp1.LAST_NAME AS BY_LNAME0_, o.CL_DEPT_ID as CL_DEPT_ID0_ FROM [ORDER] as o INNER JOIN BULK_ORDER as bo ON (o.BULK_ORDER_ID = bo.BULK_ORDER_ID) LEFT OUTER JOIN CL_PERS as cp1 ON (bo.SYS_LOGIN_ID = cp1.SYS_LOGIN_ID) LEFT OUTER JOIN CL_PERS as cp ON (bo.CL_PERS_ID = cp.CL_PERS_ID) WHERE o.CL_ID = :Clid AND o.CL_ORD_DT > :ClOrdDtMin AND o.BULK_ORDER_ID IS NOT NULL GROUP BY o.BULK_ORDER_ID, o.TRACKING_NUM, bo.CL_PERS_ID, cp.FIRST_NAME, cp.LAST_NAME, bo.SYS_LOGIN_ID, cp1.FIRST_NAME, cp1.LAST_NAME, o.CL_DEPT_ID UNION SELECT 0 as BULK_ORD2_0_, '' as TRACKING3_0_, COUNT(*) AS TOTAL0_, SUM(CASE WHEN o.order_status_type_id IN (9, 11) THEN 1 ELSE 0 END) AS ORDERS_C5_0_, SUM(CASE WHEN o.order_status_type_id = 10 THEN 1 ELSE 0 END) AS ORDERS_O6_0_, SUM(CASE WHEN o.order_status_type_id IN (15, 19, 22, 23, 27) THEN 1 ELSE 0 END) AS ORDERS_I7_0_, MIN(o.CL_ORD_DT) AS MIN_ORD_DT0_, 1 AS TYPE0_, 0 as CL_PERS_ID0_, '' as FIRST_NAME0_, '' as LAST_NAME0_, 0 as SYS_LOG10_0_, '' AS BY_FNAME0_, '' AS BY_LNAME0_, 0 as CL_DEPT_ID0_ FROM [ORDER] as o WHERE o.CL_ID = :Clid AND o.CL_ORD_DT > :ClOrdDtMin AND o.BULK_ORDER_ID IS NULL
2005-08-29 14:19:05,771 [7028] DEBUG NHibernate.Type.NullableType [(null)] <(null)> - binding '56' to parameter: 0
2005-08-29 14:19:05,771 [7028] DEBUG NHibernate.Type.NullableType [(null)] <(null)> - binding '56' to parameter: 2
2005-08-29 14:19:05,771 [7028] DEBUG NHibernate.Type.NullableType [(null)] <(null)> - binding '6/1/2005' to parameter: 1
2005-08-29 14:19:05,771 [7028] DEBUG NHibernate.Type.NullableType [(null)] <(null)> - binding '6/1/2005' to parameter: 3
2005-08-29 14:19:05,771 [7028] INFO NHibernate.Loader.Loader [(null)] <(null)> - SELECT o.BULK_ORDER_ID as BULK_ORD2_0_, o.TRACKING_NUM as TRACKING3_0_, COUNT(*) AS TOTAL0_, SUM(CASE WHEN o.order_status_type_id IN (9, 11) THEN 1 ELSE 0 END) AS ORDERS_C5_0_, SUM(CASE WHEN o.order_status_type_id = 10 THEN 1 ELSE 0 END) AS ORDERS_O6_0_, SUM(CASE WHEN o.order_status_type_id IN (15, 19, 22, 23, 27) THEN 1 ELSE 0 END) AS ORDERS_I7_0_, MIN(o.CL_ORD_DT) AS MIN_ORD_DT0_, 0 AS TYPE0_, bo.CL_PERS_ID as CL_PERS_ID0_, cp.FIRST_NAME as FIRST_NAME0_, cp.LAST_NAME as LAST_NAME0_, bo.SYS_LOGIN_ID as SYS_LOG10_0_, cp1.FIRST_NAME AS BY_FNAME0_, cp1.LAST_NAME AS BY_LNAME0_, o.CL_DEPT_ID as CL_DEPT_ID0_ FROM [ORDER] as o INNER JOIN BULK_ORDER as bo ON (o.BULK_ORDER_ID = bo.BULK_ORDER_ID) LEFT OUTER JOIN CL_PERS as cp1 ON (bo.SYS_LOGIN_ID = cp1.SYS_LOGIN_ID) LEFT OUTER JOIN CL_PERS as cp ON (bo.CL_PERS_ID = cp.CL_PERS_ID) WHERE o.CL_ID = @p0 AND o.CL_ORD_DT > @p1 AND o.BULK_ORDER_ID IS NOT NULL GROUP BY o.BULK_ORDER_ID, o.TRACKING_NUM, bo.CL_PERS_ID, cp.FIRST_NAME, cp.LAST_NAME, bo.SYS_LOGIN_ID, cp1.FIRST_NAME, cp1.LAST_NAME, o.CL_DEPT_ID UNION SELECT 0 as BULK_ORD2_0_, '' as TRACKING3_0_, COUNT(*) AS TOTAL0_, SUM(CASE WHEN o.order_status_type_id IN (9, 11) THEN 1 ELSE 0 END) AS ORDERS_C5_0_, SUM(CASE WHEN o.order_status_type_id = 10 THEN 1 ELSE 0 END) AS ORDERS_O6_0_, SUM(CASE WHEN o.order_status_type_id IN (15, 19, 22, 23, 27) THEN 1 ELSE 0 END) AS ORDERS_I7_0_, MIN(o.CL_ORD_DT) AS MIN_ORD_DT0_, 1 AS TYPE0_, 0 as CL_PERS_ID0_, '' as FIRST_NAME0_, '' as LAST_NAME0_, 0 as SYS_LOG10_0_, '' AS BY_FNAME0_, '' AS BY_LNAME0_, 0 as CL_DEPT_ID0_ FROM [ORDER] as o WHERE o.CL_ID = @p2 AND o.CL_ORD_DT > @p3 AND o.BULK_ORDER_ID IS NULL
2005-08-29 14:19:05,771 [7028] INFO NHibernate.Impl.BatcherImpl [(null)] <(null)> - Preparing SELECT o.BULK_ORDER_ID as BULK_ORD2_0_, o.TRACKING_NUM as TRACKING3_0_, COUNT(*) AS TOTAL0_, SUM(CASE WHEN o.order_status_type_id IN (9, 11) THEN 1 ELSE 0 END) AS ORDERS_C5_0_, SUM(CASE WHEN o.order_status_type_id = 10 THEN 1 ELSE 0 END) AS ORDERS_O6_0_, SUM(CASE WHEN o.order_status_type_id IN (15, 19, 22, 23, 27) THEN 1 ELSE 0 END) AS ORDERS_I7_0_, MIN(o.CL_ORD_DT) AS MIN_ORD_DT0_, 0 AS TYPE0_, bo.CL_PERS_ID as CL_PERS_ID0_, cp.FIRST_NAME as FIRST_NAME0_, cp.LAST_NAME as LAST_NAME0_, bo.SYS_LOGIN_ID as SYS_LOG10_0_, cp1.FIRST_NAME AS BY_FNAME0_, cp1.LAST_NAME AS BY_LNAME0_, o.CL_DEPT_ID as CL_DEPT_ID0_ FROM [ORDER] as o INNER JOIN BULK_ORDER as bo ON (o.BULK_ORDER_ID = bo.BULK_ORDER_ID) LEFT OUTER JOIN CL_PERS as cp1 ON (bo.SYS_LOGIN_ID = cp1.SYS_LOGIN_ID) LEFT OUTER JOIN CL_PERS as cp ON (bo.CL_PERS_ID = cp.CL_PERS_ID) WHERE o.CL_ID = @p0 AND o.CL_ORD_DT > @p1 AND o.BULK_ORDER_ID IS NOT NULL GROUP BY o.BULK_ORDER_ID, o.TRACKING_NUM, bo.CL_PERS_ID, cp.FIRST_NAME, cp.LAST_NAME, bo.SYS_LOGIN_ID, cp1.FIRST_NAME, cp1.LAST_NAME, o.CL_DEPT_ID UNION SELECT 0 as BULK_ORD2_0_, '' as TRACKING3_0_, COUNT(*) AS TOTAL0_, SUM(CASE WHEN o.order_status_type_id IN (9, 11) THEN 1 ELSE 0 END) AS ORDERS_C5_0_, SUM(CASE WHEN o.order_status_type_id = 10 THEN 1 ELSE 0 END) AS ORDERS_O6_0_, SUM(CASE WHEN o.order_status_type_id IN (15, 19, 22, 23, 27) THEN 1 ELSE 0 END) AS ORDERS_I7_0_, MIN(o.CL_ORD_DT) AS MIN_ORD_DT0_, 1 AS TYPE0_, 0 as CL_PERS_ID0_, '' as FIRST_NAME0_, '' as LAST_NAME0_, 0 as SYS_LOG10_0_, '' AS BY_FNAME0_, '' AS BY_LNAME0_, 0 as CL_DEPT_ID0_ FROM [ORDER] as o WHERE o.CL_ID = @p2 AND o.CL_ORD_DT > @p3 AND o.BULK_ORDER_ID IS NULL
2005-08-29 14:19:05,771 [7028] DEBUG NHibernate.Connection.DriverConnectionProvider [(null)] <(null)> - Obtaining IDbConnection from Driver
2005-08-29 14:19:05,974 [7028] DEBUG NHibernate.Impl.BatcherImpl [(null)] <(null)> - Opened Reader, open Readers :1
2005-08-29 14:19:05,974 [7028] DEBUG NHibernate.Loader.Loader [(null)] <(null)> - processing result set
2005-08-29 14:19:05,974 [7028] DEBUG NHibernate.Driver.NHybridDataReader [(null)] <(null)> - running NHybridDataReader.Dispose()
2005-08-29 14:19:05,974 [7028] DEBUG NHibernate.Impl.BatcherImpl [(null)] <(null)> - Closed Reader, open Readers :0
2005-08-29 14:19:05,974 [7028] DEBUG NHibernate.Impl.BatcherImpl [(null)] <(null)> - Closed IDbCommand, open IDbCommands :0
2005-08-29 14:19:06,021 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - closing session
2005-08-29 14:19:06,021 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - disconnecting session
2005-08-29 14:19:06,021 [7028] DEBUG NHibernate.Connection.ConnectionProvider [(null)] <(null)> - Closing connection
2005-08-29 14:19:06,021 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - transaction completion
2005-08-29 14:19:06,021 [7028] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - running ISession.Dispose()
2005-08-29 14:19:06,021 [7028] DEBUG NHibernate.Impl.BatcherImpl [(null)] <(null)> - running BatcherImpl.Dispose(true)