I don't know if it's of any relevance, but your formula is either missing an opening bracket, or has an extra closing one; the last bracket is unmatched.
On Thu, Mar 5, 2009 at 4:56 PM, robcar <[email protected]> wrote: > > Hello > > I'm quite a beginner with NHibernate but I have run into a problem I > can't seem to come any closer to fix. Is this a bug? > > I'm trying do make my self a class that looks like the following: > > public class Price > { > public virtual int PriceId { get; set; } > public virtual int PerQuantityMultiplier { get; set; } > public virtual int Generation { get; set; } > public virtual DateTime EffectiveDate { get; set; } > } > > With the following mapping file: > > <?xml version="1.0" encoding="utf-8" ?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" > > <class name="Volvo.Purchasing.Pricing.DomainModel.Entities.Price, > Entities" > > > <id name="PriceId" column="PriceId" type="System.Int32" unsaved- > value="null"> > <generator class="native"/> > </id> > > <property name="PerQuantityMultiplier" column="Multiplier" not- > null="false" type="System.Int32" insert="true" update="true"/> > <property name="EffectiveDate" column="EffectiveDate" not- > null="true" type="System.DateTime" insert="true" update="true"/> > <property name="Generation" column="Generation" not-null="true" > type="System.Int32" formula="ROW_NUMBER() OVER (PARTITION BY > AgreementId ORDER BY EffectiveDate DESC) as [Generation])" /> > > </class> > > </hibernate-mapping> > > When I fetch a list of this class I get an "Can''t execute query > exception". This is because NHibernate prefixes my Formula query and > doesn't seem to recognize the reserved words PARTITION and OVER. > Is there any way to tell NHibernate not to do this replace of my > custom SQL query? > > Very, very greatful for any help in this matter. > > KR > Robin Carlander > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
