[fluent-nhib] Re: Conditional Fluent Mappings with SqlLite and Sql Server

2009-04-27 Thread Action Jackson
Worked like a charm. Brilliance... On Apr 28, 12:01 am, Hudson Akridge wrote: > Hrm, try something like this: > Map(x => x.FileData) >      .WithLengthOf(2147483647); > > I believe that should be the max size for varbinaries. > > > > On Mon, Apr 27, 2009 at 11:35 PM, Action Jackson wrote: > > >

[fluent-nhib] Re: Conditional Fluent Mappings with SqlLite and Sql Server

2009-04-27 Thread Hudson Akridge
Hrm, try something like this: Map(x => x.FileData) .WithLengthOf(2147483647); I believe that should be the max size for varbinaries. On Mon, Apr 27, 2009 at 11:35 PM, Action Jackson wrote: > > Thanks! Removing the explicit call to CustomSqlTypeIs and adding the > explicit dialects for eac

[fluent-nhib] Re: Conditional Fluent Mappings with SqlLite and Sql Server

2009-04-27 Thread Action Jackson
Thanks! Removing the explicit call to CustomSqlTypeIs and adding the explicit dialects for each back end seemed to make the difference. Thank you very much for your help. Not to be greedy, but would you happen to know if it's possible to change the default mapping of byte [] properties for MsSq

[fluent-nhib] Re: Conditional Fluent Mappings with SqlLite and Sql Server

2009-04-27 Thread Hudson Akridge
> > are you saying that I should remove the explicit call to "CustomSqlTypeIs" > and let NHibernate automatically take care of the conditional logic for what > the Sql type should be? > Yup :) This is the exact reason that dialects exist. Dialects are a way to work with a database consistently, co

[fluent-nhib] Re: Conditional Fluent Mappings with SqlLite and Sql Server

2009-04-27 Thread Action Jackson
Hi Hudson, thank you for the quick response. FileData is a byte array (byte[]). As for my database configuration, I am using the SqlLite20Driver and the SQLiteDialect for testing purposes. For your #1 suggestion, are you saying that I should remove the explicit call to "CustomSqlTypeIs" and le

[fluent-nhib] Re: Conditional Fluent Mappings with SqlLite and Sql Server

2009-04-27 Thread Hudson Akridge
1.) What is your FileData? Assuming it's marked as serializable, NHibernate should default to mapping it to a BLOB or varbinary depending on the dialect used during configuration. You then set the different dialects during different initialization routines depending on if you're testing or running

[fluent-nhib] Conditional Fluent Mappings with SqlLite and Sql Server

2009-04-27 Thread Action Jackson
Does anyone know if it is possible to use conditional logic to construct Fluent mappings? Specifically, I would like to take the following mapping: public class MyFileMap : ClassMap { public WksFileMap() { Id(x => x.Id); Map(x => x.FileData)

[fluent-nhib] Re: How to use "reversed" Restrictions.In

2009-04-27 Thread Hudson Akridge
Erm, first of my examples should have been Restrictions.Eq, not .In, apologies. Reading your question a couple more times, I believe you're probably leaning towards the second example. Again, check out chapter 12.4 in the NHibernate reference documentation for more details and other methods of gett

[fluent-nhib] Re: How to use "reversed" Restrictions.In

2009-04-27 Thread Hudson Akridge
Your question's more of an NHibernate specific question, so you may have accidentally posted to the fluent group instead. ;) In any event, I'll try and help however I can here. First off, what do you mean in terms of an opposite scenario? The description you've given changes the objects and players

[fluent-nhib] Re: Automapping many to one

2009-04-27 Thread Kevin Dente
OK. This is a stripped down test case, not the original code. The crux seems to be the subclassing: The entities: namespace FNH_Repro.Entities { public class ThingBase : Entity { } public class SpecificThing : ThingBase { public virtual ARelatedThing RelatedThing { ge

[fluent-nhib] Re: Automapping many to one

2009-04-27 Thread Hudson Akridge
Your best bet is to just post your Class data definitions (all required for mapping) and your configuration statements used for any conventions or the like you used when you configured fluent to automap; all as text. On Mon, Apr 27, 2009 at 3:39 PM, Kevin Dente wrote: > > I have a simple repro c

[fluent-nhib] Re: Automapping many to one

2009-04-27 Thread Kevin Dente
I have a simple repro case for this (VS project), but I'm not sure how to post it. Does Google Groups not support attachments? On Apr 27, 2:12 am, James Gregory wrote: > Yeah, we need some more info. What's your automapping setup? What does this > particular entity look like? What's the property

[fluent-nhib] How to use "reversed" Restrictions.In

2009-04-27 Thread Francisco Silva
So if I had a ListOfSomething and I want an instance of MyClass whose SomeProperty value is contained in the ListOfSomething, I would use var myInstance = (MyClass)session.CreateCriteria(typeof(MyClass)) .Add(Restrictions.In ("SomeProperty", ListOfSometh

[fluent-nhib] Re: Adding .CustomTypeIs(typeof(int)) cause extra update statements

2009-04-27 Thread Rei
Or change the access strategy to field. Ending as: private int _something; public virtual ZeeEnum Something { get { return (ZeeEnum)_something; } set { _something = (int)value; } } On Apr 25, 10:53 pm, Roelof Blom wrote: > I use the following convention: > >     public class EnumConvention :

[fluent-nhib] IIdConvetion with reference to mapping override of table name?

2009-04-27 Thread Will Smith
First of all, this is not an urgent issue. It's certainly a "nice-to- have", not an issue at all. But, I would like some additional feedback on how others might be solving this "problem". Below is the original issue submission, followed by a comment on how I might accomplish what I am looking f

[fluent-nhib] Re: Automapping many to one

2009-04-27 Thread James Gregory
Yeah, we need some more info. What's your automapping setup? What does this particular entity look like? What's the property in question? On Mon, Apr 27, 2009 at 9:50 AM, Andrew Stewart wrote: > Hi Kevin > I'm not sure why that should of happened, can you give us your > configuration and your exa

[fluent-nhib] Re: Automapping many to one

2009-04-27 Thread Andrew Stewart
Hi Kevin I'm not sure why that should of happened, can you give us your configuration and your example to look at: Cheers Andy On Sun, Apr 26, 2009 at 10:47 PM, MaggiePlusPlus wrote: > > I am using AutoMap exclusively as well (but am also very new at > this). I have gotten the Many-to-one mapp