[fluent-nhib] Re: Paranoid question - Fluent is not a fork is it?

2009-05-15 Thread Ben Harper
Awesome! On May 15, 7:03 pm, James Gregory wrote: > It most definitely is not a fork :) > It's a completely independent project that utilises NHibernate, but is no > way tied to its code-base (any more than any other user of NH is). > > > > On Fri, May 15, 2009 at 4:21 PM, Ben Harper wrote: > >

[fluent-nhib] Re: Paranoid question - Fluent is not a fork is it?

2009-05-15 Thread Rei
Your forgot to add - A very "sexy" completly independent project! On May 15, 7:03 pm, James Gregory wrote: > It most definitely is not a fork :) > It's a completely independent project that utilises NHibernate, but is no > way tied to its code-base (any more than any other user of NH is). > > On

[fluent-nhib] Re: AutoMap

2009-05-15 Thread Jose Selesan
The solution is defining concrete type .ForTypesThatDeriveFrom(a => a.Map( f => f.Photo ).CustomTypeIs( typeof(Byte[]) )) On Fri, May 15, 2009 at 1:08 PM, Steven Harman wrote: > I would /imagine/ you'll need to use a more basic data structure if you > want multi-db support. i.e. > > public clas

[fluent-nhib] Re: Paranoid question - Fluent is not a fork is it?

2009-05-15 Thread James Gregory
It most definitely is not a fork :) It's a completely independent project that utilises NHibernate, but is no way tied to its code-base (any more than any other user of NH is). On Fri, May 15, 2009 at 4:21 PM, Ben Harper wrote: > > Hi, > I've just come across Fluent, after struggling for a while

[fluent-nhib] Re: Order of Conventions and Overrides

2009-05-15 Thread Filip Zawada
Hi, that's the problem I also run into. I mentioned it in http://code.google.com/p/fluent-nhibernate/issues/detail?id=104 but it's worth creating a distinct Issue.. Ok I won't procratinate any longer and create one ;). http://code.google.com/p/fluent-nhibernate/issues/detail?id=231 I use the sam

[fluent-nhib] Paranoid question - Fluent is not a fork is it?

2009-05-15 Thread Ben Harper
Hi, I've just come across Fluent, after struggling for a while with NHibernate's existing XML junk, and I love it. Anyway - This might be a dumb question, but I need to know for sure -- Is Fluent a fork of NHibernate, or is it developed in parallel to NHibernate? Specifically, the core business

[fluent-nhib] Re: AutoMap

2009-05-15 Thread Steven Harman
I would /imagine/ you'll need to use a more basic data structure if you want multi-db support. i.e. public class Photo { public string MimeType { get; set; } public byte[] Content { get; set; } } and then map that as a sub-component. That's just my gut-feel... but I think we'll be doing somet

[fluent-nhib] AutoMap

2009-05-15 Thread Jose Selesan
Hi!. This is a simply question. How can I automap a property of type Image? I have this class: public class Student: Entity { public virtual string Name{ get; set; } public virtual Image Photo{ get; set; } } And I'm creating the session factory with this: var persistenceModel =

[fluent-nhib] Re: HasMany or collection mapping again

2009-05-15 Thread cyberhubert
I have missed bottom part of this article - about the Reveal static class which does more or less what I do in my hack. The only difference is that it works on non-public properties and my hack uses non-public fields. Anyway - I am another person which is interested in doing that this way since i

[fluent-nhib] Re: Nested Components

2009-05-15 Thread Hudson Akridge
If your column name is always tied to your class name, then you could just do a typeof(FirstName).Name in the Map() column name overload. On Fri, May 15, 2009 at 8:30 AM, Rob wrote: > > Thanks Hudson! Pretty good for off the top of the head. > > I do see that your solution gives me a column nam

[fluent-nhib] Re: HasMany or collection mapping again

2009-05-15 Thread Hudson Akridge
Your override is definitely a way to do it. In fact, I was thinking of pushing that in at a future date. I use something similar as a custom override for our production use of FNH, but I was hesitant to push that to trunk for fear that I was the only one interested in doing that ;) Alternatively, y

[fluent-nhib] Re: HasMany or collection mapping again

2009-05-15 Thread cyberhubert
Sure, but WhatEver has to be public in this case. So it exposes internal collection which I'd like to avoid. On 15 Maj, 14:07, Rei wrote: > Wasn't it easier to just HasMany(p => p.WhatEver).Access.AsField ? Or > did I totally fubar the interpretation of the problem? > > On May 15, 12:53 am, cyb

[fluent-nhib] Re: Nested Components

2009-05-15 Thread Rob
Thanks Hudson! Pretty good for off the top of the head. I do see that your solution gives me a column name of value in the Person Table, I know I could add the column name as a field in the cFirstName.Map(z =>z.value, "FirstName") call, but do you know of a way to get the syntactic sugar of stat

[fluent-nhib] Re: Nested Components

2009-05-15 Thread Hudson Akridge
Actually, looking at the syntax again, it should be more like this: Component(x=>x.theName, cName => cName.Component(y => y.theFirstName, cFirstName => cFirstName.Map(z => z.value))); On Fri, May 15, 2009 at 8:02 AM, Hudson Akridge wrote: > When you map the FirstName component, specify .Map(x =>

[fluent-nhib] Re: Nested Components

2009-05-15 Thread Hudson Akridge
When you map the FirstName component, specify .Map(x => x.value); So, it'll look something like this: .Component(cName => cName.Component(fName => fName.Map(x => x.value))); It's a close approx =p Not at a computer atm where I could give you an exact, but I think that's pretty close to what you ne

[fluent-nhib] Nested Components

2009-05-15 Thread Rob
Apologies if this has been answered before. My search-fu has failed me (I did see an issue related to nested components, but it didn't seem to be what I was looking for...). I'm looking to map the following (somewhat contrived but simplier to understand scenario): class Person { Name theNam

[fluent-nhib] Re: IManyToOnePart vs ManyToOnePart

2009-05-15 Thread Hudson Akridge
There's a couple of other instances like this out there. It's purely inconsistencies with the interfaces at this point. We've talked about it before on the dev boards, and the resolution seemed to be, the Conventions were going to get a facelift. Rather than giving you a model class/interface back

[fluent-nhib] Re: Order of Conventions and Overrides

2009-05-15 Thread Stuart Childs
Funnily enough, we've been discussing the topic of ordering conventions in a fluent, generic way because "we haven't had any complaints yet but..." I guess you broke that silence. :) I think for now you'll have to continue providing exceptions on your conventions. As far as detecting if Inverse has

[fluent-nhib] Nested Components

2009-05-15 Thread Rob
Apologies if this has been answered before. My search-fu has failed me (I did see an issue related to nested components, but it didn't seem to be what I was looking for...). I'm looking to map the following (somewhat contrived but simplier to understand scenario): class Person { Name theNam

[fluent-nhib] Re: Component mapping with referenced entity

2009-05-15 Thread Luca Lusetti
Ok I solved it myself. Problem was that I have a reference convention and it kicks in after the override. Exclude components from reference collection and now everything works. Luca Lusetti On May 14, 10:28 am, Luca Lusetti wrote: > Hi, I have this scenario > > public class Comune >     { >    

[fluent-nhib] Re: HasMany or collection mapping again

2009-05-15 Thread Rei
Wasn't it easier to just HasMany(p => p.WhatEver).Access.AsField ? Or did I totally fubar the interpretation of the problem? On May 15, 12:53 am, cyberhubert wrote: > Hi nHibernate Heroes ;) > I have to ask you about it since I think/google about it for some time > and still have no consistent a

[fluent-nhib] Re: XML ArgumentException

2009-05-15 Thread JamesSpibey
Thanks for your help, it was just an oversight on my part. I'm caching the session factory now so that should hopefully resolve it On May 15, 8:06 am, Paul Batum wrote: > When you use Fluently.Configure(), it builds a session factory. When it > comes to figuring out what to do with that session

[fluent-nhib] HasMany or collection mapping again

2009-05-15 Thread cyberhubert
Hi nHibernate Heroes ;) I have to ask you about it since I think/google about it for some time and still have no consistent answer. My problem is in fluent mapping collections. What I need is custom collection with proper business rule handling on Add/Remove etc.What I don't want is inheriting/imp

[fluent-nhib] Order of Conventions and Overrides

2009-05-15 Thread arnetheduck
Hi, Most of my collection mappings are inverse so I have a IHasManyConvention that sets Inverse(). For the types that I don't want inverse (incidentally these are element-type collections that the automapper doesn't seem to support), I have IAutoMappingOverride's in place that call "Not.Inverse()

[fluent-nhib] Re: Automap Components with Lists/Arrays

2009-05-15 Thread arnetheduck
I worked around this by using an override: ...ForTypesThatDeriveFrom(map => map.HasMany(x => x.Rights).AsSet ().AsElement("`right`"))... It would be nice if automappings detected element mappings automagically though... On May 13, 7:47 pm, Mike wrote: > Haven't figured out how to setup automap

[fluent-nhib] IManyToOnePart vs ManyToOnePart

2009-05-15 Thread arnetheduck
Hi, I'm writing a IReferenceConvention and would like to set the not-null and foreign-key properties, but I find those missing from IManyToOnePart - is there any specific reason for this, or is it just that noone has gotten around yet? I added the methods to IManyToOnePart and everything seems to

[fluent-nhib] Re: XML ArgumentException

2009-05-15 Thread Paul Batum
When you use Fluently.Configure(), it builds a session factory. When it comes to figuring out what to do with that session factory, its best to follow typical NH best practices because once you have a session factory, theres nothing "fluent" about it. An old but quite popular article on NH best pr