I've tried again to use 0.0m, but here is what i've got:
"NHibernate.QueryException: undefined alias or unknown mapping: 0"


This is the full HQL and stack trace:

NHibernate.QueryException: undefined alias or unknown mapping: 0 [
        select new TurnoverRecord(billPayment.RecipientBillPlan.Id ,
sum(billPayment.AmountNoPVM) , sum(billPayment.AmountTotal) , 0.0m)
        from PUV.BLL.Model.BillPayment billPayment
        left join billPayment.BillPaymentType as billPaymentType
  left join billPaymentType.BillPaymentSubtype as billPaymentSubType
  left join billPayment.PayerItem as payerItem
  left join payerItem.ParentItem as parentItem1
  left join parentItem1.ParentItem as parentItem2
  left join billPayment.ForTask as forTask
  left join forTask.DistributionType as taskDistributionType
  left join billPayment.RecipientContract as recipientContract
  left join recipientContract.DistributionType as
recipientContractDistributionType

        where billPayment.Date >= :fromDate and billPayment.Date <= :toDate
and billPayment.RecipientCompany = :recipientCompany and
(billPaymentSubType.UniqueCode =
'BillPaymentSubType_IntermediateData') and
taskDistributionType.UniqueCode != DistributionType_InvisibleToPayers
and  recipientContractDistributionType.UniqueCode !=
DistributionType_InvisibleToPayers and  billPayment.RecipientCompany
!= billPayment.PayerCompany
        group by billPayment.RecipientCompany ,  billPayment.RecipientBillPlan
        ]
   at NHibernate.Hql.Classic.PathExpressionParser.Token(String token,
QueryTranslator q)
   at NHibernate.Hql.Classic.ParserHelper.Parse(IParser p, String
text, String seperators, QueryTranslator q)
   at NHibernate.Hql.Classic.SelectParser.Token(String token, QueryTranslator q)
   at NHibernate.Hql.Classic.ClauseParser.Token(String token, QueryTranslator q)
   at NHibernate.Hql.Classic.ClauseParser.End(QueryTranslator q)
   at NHibernate.Hql.Classic.PreprocessingParser.End(QueryTranslator q)
   at NHibernate.Hql.Classic.ParserHelper.Parse(IParser p, String
text, String seperators, QueryTranslator q)
   at NHibernate.Hql.Classic.QueryTranslator.Compile()
   at NHibernate.Hql.Classic.QueryTranslator.Compile(IDictionary`2
replacements, Boolean scalar)
   at NHibernate.Engine.Query.HQLQueryPlan..ctor(String hql, String
collectionRole, Boolean shallow, IDictionary`2 enabledFilters,
ISessionFactoryImplementor factory)
   at NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(String
queryString, Boolean shallow, IDictionary`2 enabledFilters)
   at NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan(String
query, Boolean shallow)
   at NHibernate.Impl.AbstractSessionImpl.CreateQuery(String queryString)
   at PUV.Helpers.BillPayments.Remainders.FluentHQL.Select[K]() in



Any other ideas?

For the moment, i will make a dirty hack - i will make some more
constructors, but would be nice to solve this little nuisance

2009/4/28 Darius Damalakas <[email protected]>:
> i've tried this already, but with no success.  I will try again your
> suggestion, maybe i just made a simple mistake or something. I will
> let you know if it helps
>
>
>
> 2009/4/28 Germán Schuager <[email protected]>:
>> Try "0m" instead of "0.0"
>>
>> On Tue, Apr 28, 2009 at 11:47 AM, Darius Damalakas
>> <[email protected]> wrote:
>>>
>>> Hi everybody,
>>>
>>> I've checked HQL docs, but can't find a solution (http://nhforge.org/
>>> doc/nh/en/index.html#queryhql-expressions).
>>>
>>> I have query which goes like this:
>>>
>>> select new Record(billPlan.Id, 0.0)
>>> from BillPlan billPlan
>>>
>>>
>>> my class Record has a contstuctor, which takes first parameter as
>>> Int32, and second as decimal.
>>>  However, NHibernate seems to argue, that 0.0 is not a decimal, but a
>>> double instead.
>>>
>>>
>>> How should i tell that i want to select a constant decimal value for
>>> the second constructor argument?
>>>
>>>
>>
>>
>> >>
>>
>
>
>
> --
> Darius Damalakas
>



-- 
Darius Damalakas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to