Just thought I'd add an update. What I'm trying to do is create
criteria that can do this:
select *
>From Echo_File_status efs,
Data_DELETION_PARAMETER ddp
WHERE
efs.EFS_PRODUCT_CODE = DDP.DDP_PRODUCT_CODE(+)
AND
DDP.DDP_PROCESS_TYPE = 'D'
On Dec 29, 2:23 pm, kimbered <[email protected]> wrote:
> Hi,
> I've been trying to do a query using data from two different tables.
> And, I think I'm pretty close. The sql stmt is being generated, but
> then NHibernate throws an error. If I cut and past the select
> statment into Toad it seems to work. So, I'm not sure what the
> problem is.
>
> Unless it is the "where rownum <=:p1" because no parameter appears for
> that.
>
> I have a var that has been created as a DetachedCriteria called:
> detachedCriteria with an alias of "o".
> Then I do the following:
> var subcriteria =
> DetachedCriteria.For<FitsEchoDataDeletionModel>("d");
>
> subcriteria.SetProjection(Projections.Property("d.DaysOnLine"));
> subcriteria.Add(Restrictions.EqProperty("d.ProductCode",
> "o.ProductCode"));
>
> detachedCriteria.Add(Subqueries.Exists(subcriteria));
> detachedCriteria.Add(Restrictions.Eq("o.ProductCode",
> "TPS"));
>
> var exeCriteria =
> detachedCriteria.GetExecutableCriteria(GetSession());
> exeCriteria.SetFirstResult(startRow);
> exeCriteria.SetMaxResults(numberOfRows);
> var list = exeCriteria.List<T>(); (THIS IS WHERE IT IS
> BLOWING UP).
> return list;
>
> Below is the error text. Any ideas would be greatly appreciated.
> Thanks.
> Kim
>
> ----------------------------------------------------
> . . . Exception Details . . .
> ----------------------------------------------------
> Exception Details: System.ServiceModel.FaultException: A
> NHibernate.ADOException exception occurred
> at NHibernate.Loader.Loader.DoList(ISessionImplementor session,
> QueryParameters queryParameters)
> at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor
> session, QueryParameters queryParameters)
> at NHibernate.Loader.Loader.List(ISessionImplementor session,
> QueryParameters queryParameters, ISet`1 querySpaces, IType[]
> resultTypes)
> at
> NHibernate.Loader.Criteria.CriteriaLoader.List(ISessionImplementor
> session)
> at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList
> results)
> at NHibernate.Impl.CriteriaImpl.List(IList results)
> at NHibernate.Impl.CriteriaImpl.List[T]()
> at
> Paychex.Hris.Bll.Fits.Echo.CommonEchoRepository`1.Query(DetachedCriteria
> criteria, Int32 startRow, Int32 numberOfRows)
> Error message: could not execute query
> [ select * from ( SELECT this_.EFS_PRODUCT_CODE as EFS1_121_0_,
> this_.RowID as RowID2_121_0_, this_.EFS_FILE_ID as EFS3_121_0_,
> this_.EFS_ACCOUNT_ID as EFS4_121_0_, this_.EFS_ACKED_BY as
> EFS5_121_0_, this_.EFS_ACKED_DATE as EFS6_121_0_,
> this_.EFS_BALANCE_FILE_YN as EFS7_121_0_, this_.EFS_BANK_ID as
> EFS8_121_0_, this_.EFS_BATCH_COUNT as EFS9_121_0_,
> this_.EFS_CONFIRM_DATE as EFS10_121_0_, this_.EFS_CONFIRM_NUMBER as
> EFS11_121_0_, this_.EFS_CONFIRM_USER as EFS12_121_0_,
> this_.EFS_CREDIT_AMT as EFS13_121_0_, this_.EFS_CREDIT_COUNT as
> EFS14_121_0_, this_.EFS_DEBIT_AMT as EFS15_121_0_,
> this_.EFS_DEBIT_COUNT as EFS16_121_0_, this_.EFS_HASH_TOTAL as
> EFS17_121_0_, this_.EFS_FILE_ACK_DATE as EFS18_121_0_,
> this_.EFS_FILE_CREATE_DATE as EFS19_121_0_, this_.EFS_FILE_NAME as
> EFS20_121_0_, this_.EFS_FILE_MOD_ID as EFS21_121_0_,
> this_.EFS_FILE_TRANS_COMP_DATE as EFS22_121_0_,
> this_.EFS_FILE_TRANSMIT_DATE as EFS23_121_0_, this_.EFS_FILE_TYPE as
> EFS24_121_0_, this_.EFS_MODIFIED_BY as EFS25_121_0_,
> this_.EFS_MODIFIED_DATE as EFS26_121_0_, this_.EFS_MODIFIED_SOURCE as
> EFS27_121_0_, this_.EFS_PAYX_CREDIT_AMT as EFS28_121_0_,
> this_.EFS_PAYX_DEBIT_AMT as EFS29_121_0_, this_.EFS_STATUS_CODE as
> EFS30_121_0_ FROM ECHO.ECHO_FILE_STATUS this_ WHERE exists (SELECT
> this_0_.DDP_DAYS_ON_LINE as y0_ FROM ECHO.DATA_DELETION_PARAMETER
> this_0_ WHERE this_0_.DDP_PRODUCT_CODE = this_.EFS_PRODUCT_CODE) and
> this_.EFS_PRODUCT_CODE = :p0 ) where rownum <=:p1 ]
> Positional parameters: #0>TPS
> [SQL: select * from ( SELECT this_.EFS_PRODUCT_CODE as EFS1_121_0_,
> this_.RowID as RowID2_121_0_, this_.EFS_FILE_ID as EFS3_121_0_,
> this_.EFS_ACCOUNT_ID as EFS4_121_0_, this_.EFS_ACKED_BY as
> EFS5_121_0_, this_.EFS_ACKED_DATE as EFS6_121_0_,
> this_.EFS_BALANCE_FILE_YN as EFS7_121_0_, this_.EFS_BANK_ID as
> EFS8_121_0_, this_.EFS_BATCH_COUNT as EFS9_121_0_,
> this_.EFS_CONFIRM_DATE as EFS10_121_0_, this_.EFS_CONFIRM_NUMBER as
> EFS11_121_0_, this_.EFS_CONFIRM_USER as EFS12_121_0_,
> this_.EFS_CREDIT_AMT as EFS13_121_0_, this_.EFS_CREDIT_COUNT as
> EFS14_121_0_, this_.EFS_DEBIT_AMT as EFS15_121_0_,
> this_.EFS_DEBIT_COUNT as EFS16_121_0_, this_.EFS_HASH_TOTAL as
> EFS17_121_0_, this_.EFS_FILE_ACK_DATE as EFS18_121_0_,
> this_.EFS_FILE_CREATE_DATE as EFS19_121_0_, this_.EFS_FILE_NAME as
> EFS20_121_0_, this_.EFS_FILE_MOD_ID as EFS21_121_0_,
> this_.EFS_FILE_TRANS_COMP_DATE as EFS22_121_0_,
> this_.EFS_FILE_TRANSMIT_DATE as EFS23_121_0_, this_.EFS_FILE_TYPE as
> EFS24_121_0_, this_.EFS_MODIFIED_BY as EFS25_121_0_,
> this_.EFS_MODIFIED_DATE as EFS26_121_0_, this_.EFS_MODIFIED_SOURCE as
> EFS27_121_0_, this_.EFS_PAYX_CREDIT_AMT as EFS28_121_0_,
> this_.EFS_PAYX_DEBIT_AMT as EFS29_121_0_, this_.EFS_STATUS_CODE as
> EFS30_121_0_ FROM ECHO.ECHO_FILE_STATUS this_ WHERE exists (SELECT
> this_0_.DDP_DAYS_ON_LINE as y0_ FROM ECHO.DATA_DELETION_PARAMETER
> this_0_ WHERE this_0_.DDP_PRODUCT_CODE = this_.EFS_PRODUCT_CODE) and
> this_.EFS_PRODUCT_CODE = :p0 ) where rownum <=:p1]
>
> ----------------------------------------------------
> . . . Stack Trace . . .
> ----------------------------------------------------
> [FaultException: A NHibernate.ADOException exception occurred
> at NHibernate.Loader.Loader.DoList(ISessionImplementor session,
> QueryParameters queryParameters)
> at
> NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor
> session, QueryParameters queryParameters)
> at NHibernate.Loader.Loader.List(ISessionImplementor session,
> QueryParameters queryParameters, ISet`1 querySpaces, IType[]
> resultTypes)
> at
> NHibernate.Loader.Criteria.CriteriaLoader.List(ISessionImplementor
> session)
> at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList
> results)
> at NHibernate.Impl.CriteriaImpl.List(IList results)
> at NHibernate.Impl.CriteriaImpl.List[T]()
> at
> Paychex.Hris.Bll.Fits.Echo.CommonEchoRepository`1.Query(DetachedCriteria
> criteria, Int32 startRow, Int32 numberOfRows)
> Error message: could not execute query
> [ select * from ( SELECT this_.EFS_PRODUCT_CODE as EFS1_121_0_,
> this_.RowID as RowID2_121_0_, this_.EFS_FILE_ID as EFS3_121_0_,
> this_.EFS_ACCOUNT_ID as EFS4_121_0_, this_.EFS_ACKED_BY as
> EFS5_121_0_, this_.EFS_ACKED_DATE as EFS6_121_0_,
> this_.EFS_BALANCE_FILE_YN as EFS7_121_0_, this_.EFS_BANK_ID as
> EFS8_121_0_, this_.EFS_BATCH_COUNT as EFS9_121_0_,
> this_.EFS_CONFIRM_DATE as EFS10_121_0_, this_.EFS_CONFIRM_NUMBER as
> EFS11_121_0_, this_.EFS_CONFIRM_USER as EFS12_121_0_,
> this_.EFS_CREDIT_AMT as EFS13_121_0_, this_.EFS_CREDIT_COUNT as
> EFS14_121_0_, this_.EFS_DEBIT_AMT as EFS15_121_0_,
> this_.EFS_DEBIT_COUNT as EFS16_121_0_, this_.EFS_HASH_TOTAL as
> EFS17_121_0_, this_.EFS_FILE_ACK_DATE as EFS18_121_0_,
> this_.EFS_FILE_CREATE_DATE as EFS19_121_0_, this_.EFS_FILE_NAME as
> EFS20_121_0_, this_.EFS_FILE_MOD_ID as EFS21_121_0_,
> this_.EFS_FILE_TRANS_COMP_DATE as EFS22_121_0_,
> this_.EFS_FILE_TRANSMIT_DATE as EFS23_121_0_, this_.EFS_FILE_TYPE as
> EFS24_121_0_, this_.EFS_MODIFIED_BY as EFS25_121_0_,
> this_.EFS_MODIFIED_DATE as EFS26_121_0_, this_.EFS_MODIFIED_SOURCE as
> EFS27_121_0_, this_.EFS_PAYX_CREDIT_AMT as EFS28_121_0_,
> this_.EFS_PAYX_DEBIT_AMT as EFS29_121_0_, this_.EFS_STATUS_CODE as
> EFS30_121_0_ FROM ECHO.ECHO_FILE_STATUS this_ WHERE exists (SELECT
> this_0_.DDP_DAYS_ON_LINE as y0_ FROM ECHO.DATA_DELETION_PARAMETER
> this_0_ WHERE this_0_.DDP_PRODUCT_CODE = this_.EFS_PRODUCT_CODE) and
> this_.EFS_PRODUCT_CODE = :p0 ) where rownum <=:p1 ]
> Positional parameters: #0>TPS
> [SQL: select * from ( SELECT this_.EFS_PRODUCT_CODE as EFS1_121_0_,
> this_.RowID as RowID2_121_0_, this_.EFS_FILE_ID as EFS3_121_0_,
> this_.EFS_ACCOUNT_ID as EFS4_121_0_, this_.EFS_ACKED_BY as
> EFS5_121_0_, this_.EFS_ACKED_DATE as EFS6_121_0_,
> this_.EFS_BALANCE_FILE_YN as EFS7_121_0_, this_.EFS_BANK_ID as
> EFS8_121_0_, this_.EFS_BATCH_COUNT as EFS9_121_0_,
> this_.EFS_CONFIRM_DATE as EFS10_121_0_, this_.EFS_CONFIRM_NUMBER as
> EFS11_121_0_, this_.EFS_CONFIRM_USER as EFS12_121_0_,
> this_.EFS_CREDIT_AMT as EFS13_121_0_, this_.EFS_CREDIT_COUNT as
> EFS14_121_0_, this_.EFS_DEBIT_AMT as EFS15_121_0_,
> this_.EFS_DEBIT_COUNT as EFS16_121_0_, this_.EFS_HASH_TOTAL as
> EFS17_121_0_, this_.EFS_FILE_ACK_DATE as EFS18_121_0_,
> this_.EFS_FILE_CREATE_DATE as EFS19_121_0_, this_.EFS_FILE_NAME as
> EFS20_121_0_, this_.EFS_FILE_MOD_ID as EFS21_121_0_,
> this_.EFS_FILE_TRANS_COMP_DATE as EFS22_121_0_,
> this_.EFS_FILE_TRANSMIT_DATE as EFS23_121_0_, this_.EFS_FILE_TYPE as
> EFS24_121_0_, this_.EFS_MODIFIED_BY as EFS25_121_0_,
> this_.EFS_MODIFIED_DATE as EFS26_121_0_, this_.EFS_MODIFIED_SOURCE as
> EFS27_121_0_, this_.EFS_PAYX_CREDIT_AMT as EFS28_121_0_,
> this_.EFS_PAYX_DEBIT_AMT as EFS29_121_0_, this_.EFS_STATUS_CODE as
> EFS30_121_0_ FROM ECHO.ECHO_FILE_STATUS this_ WHERE exists (SELECT
> this_0_.DDP_DAYS_ON_LINE as y0_ FROM ECHO.DATA_DELETION_PARAMETER
> this_0_ WHERE this_0_.DDP_PRODUCT_CODE = this_.EFS_PRODUCT_CODE) and
> this_.EFS_PRODUCT_CODE = :p0 ) where rownum <=:p1]]
>
> System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
> reqMsg, IMessage retMsg) +9456095
>
> System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
> msgData, Int32 type) +345
>
> Paychex.Hris.Wcf.Client.Fits.IFitsEchoFileStatusService.GetFitsEchoFileStatusByPage(FitsEchoSearchCriteria
> criteria, Int32 startRow, Int32 numberOfRows, Int32& rowCount) +0
>
> Paychex.Hris.Wcf.Client.Fits.FitsEchoFileStatusServiceClient.GetFitsEchoFileStatusByPage(FitsEchoSearchCriteria
> criteria, Int32 startRow, Int32 numberOfRows, Int32& rowCount) in C:
> \tfsroot\Phoenix\HRIS.Net\Branches\Projects\ENS\ReadyChexAdditionalBank
> \Source\Paychex.Hris.Wcf.Client\Fits\FitsService.cs:2525
>
> Paychex.Hris.UI.Library.Fits.Echo.GuiFitsEchoFileStatusRepository.GetFitsEchoFileStatusList(GuiFitsEchoFileStatusCriteria
> criteria, Int32 startRow, Int32 numberOfRows, Int32& rowCount) in C:
> \tfsroot\Phoenix\HRIS.Net\Branches\Projects\ENS\ReadyChexAdditionalBank
> \Source\Paychex.Hris.UI.Library\Fits\Echo
> \GuiFitsEchoFileStatusRepository.cs:45
>
> Paychex.Hris.Web.Fits.Echo.GuiFitsEchoFileStatus.GetFitsEchoFileStatusList(Int32
> startRow, Int32 numberOfRows, Int32& rowCount) in C:\tfsroot\Phoenix
> \HRIS.Net\Branches\Projects\ENS\ReadyChexAdditionalBank\Source
> \Paychex.Hris.Web\Fits\Echo\GuiFitsEchoFileStatus.aspx.cs:422
>
> Paychex.Hris.Web.Fits.Echo.GuiFitsEchoFileStatus.SearchResultsRadGrid_NeedDataSource(Object
> sender, GridNeedDataSourceEventArgs e) in C:\tfsroot\Phoenix\HRIS.Net
> \Branches\Projects\ENS\ReadyChexAdditionalBank\Source\Paychex.Hris.Web
> \Fits\Echo\GuiFitsEchoFileStatus.aspx.cs:400
> Telerik.Web.UI.RadGrid.OnNeedDataSource(GridNeedDataSourceEventArgs
> e) +143
> Telerik.Web.UI.RadGrid.ObtainDataSource(GridRebindReason
> rebindReason, Boolean IsBoundUsingDataSourceId) +85
> Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason)
> +106
> Telerik.Web.UI.RadGrid.OnLoad(EventArgs e) +132
> System.Web.UI.Control.LoadRecursive() +74
> System.Web.UI.Control.LoadRecursive() +146
> System.Web.UI.Control.LoadRecursive() +146
> System.Web.UI.Control.LoadRecursive() +146
> System.Web.UI.Control.LoadRecursive() +146
> System.Web.UI.Control.LoadRecursive() +146
> System.Web.UI.Control.LoadRecursive() +146
> System.Web.UI.Control.LoadRecursive() +146
> System.Web.UI.Control.LoadRecursive() +146
> System.Web.UI.Control.LoadRecursive() +146
> System.Web.UI.Control.LoadRecursive() +146
> System.Web.UI.Control.LoadRecursive() +146
> System.Web.UI.Control.LoadRecursive() +146
> System.Web.UI.Control.LoadRecursive() +146
> System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
> +2207
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.