It acts the same. The only time I can make it go to Int16 is when I set the class as int (Int32) and the mapping xml as short - but then I get an 'Specified cast is not valid' error. I gave up tracing that issue down yesterday.
I'm considering just faking out NHibernate and making my own 'custom class' that's really just an Int16... I really think it's a Sybase mapping issue- could it be that I'm using ASE12.5 but the 15 driver? 12.5 didn't come with my version of NHibernate On Wednesday, May 30, 2012 1:24:12 AM UTC-4, Oskar Berggren wrote: > > What happens if you use ((short)500) in the expression? > > /Oskar > > > 2012/5/30 jlhunter <[email protected]>: > > I can't figure out how to get NHibernate to map to Int16. > > > > In the class, public virtual Int16 ClientId { get; set; } > > In the XML, name="ClientId" column="clnt_id" type="short" > > > > It works when I use: > > var member = session.CreateCriteria<Member>() > > .Add(Restrictions.Eq("ClientId", 500)) > > .Add(Restrictions.Eq("MemberId", 45629)) > > .List<Member>(); > > > > but not: > > var member = session.Query<Member>().Where(x => x.ClientId == 500 && > > x.MemberId == 45629).ToList(); > > > > The latter passes in Int32 for ClientId, not Int16. This causes issues > as > > the column type is smallint (it takes about 40 seconds longer when > passing > > in Int32, don't have a full grasp of what's happening). > > > > I'm not sure how to map LINQ to use Int16. > > > > Thanks > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "nhusers" group. > > To view this discussion on the web visit > > https://groups.google.com/d/msg/nhusers/-/BItFX6A56RsJ. > > 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. > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/06TjbAChyr8J. 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.
