[fluent-nhib] Re: Automapping components

2008-10-05 Thread Gabriel Schenker
@Andy: I'm a little bit lost... and need your help I can see what you are doing for things like References and HasMany. But the Component part is special in that it has an additional action of type Action> to be handled (auto-mapped). And there my problems start... How can I "inject" or "auto-gener

[fluent-nhib] Re: Small breaking change + join element support

2008-10-05 Thread James Gregory
Yeah, no problem. On 10/6/08, Paul Batum <[EMAIL PROTECTED]> wrote: > Hi James, > > I recently added functionality to JoinedSubClassPart to let you specify the > tablename, and I remember I didn't use a setter and made a method that > looked similar to yours. Given you just made this change, I wa

[fluent-nhib] Re: Small breaking change + join element support

2008-10-05 Thread Paul Batum
Hi James, I recently added functionality to JoinedSubClassPart to let you specify the tablename, and I remember I didn't use a setter and made a method that looked similar to yours. Given you just made this change, I was wondering if you could take a quick look at JoinedSubClass and change it to b

[fluent-nhib] Re: "length" attribute and conventions

2008-10-05 Thread Paul Batum
Hi Pavel, I thought a quick explanation of the difference between SetAttribute and AddAlteration might be useful. When the mapping is consumed, a process occurs where conventions are applied. Due to the way this is implemented, values that were set using SetAttribute will get overridden by the co

[fluent-nhib] Re: Mapping interfaces

2008-10-05 Thread Paul Batum
If you do have multiple implementers of the ICustomer interface (I will agree with Chad that having 1:1 interface:entity is usually an antipattern), then there is nothing stopping you from mapping to ICustomer. In the case where you are retrieving an existing customer or navigating a relationship,

[fluent-nhib] Re: "length" attribute and conventions

2008-10-05 Thread Pavel Samokha
Ouh, I didn't notice it - I expected something like Length() or SetLength(), and yes - it does what I want, Thank you, James. But, I look at the code and saw that this method use AddAlteration: public PropertyMap WithLengthOf(int length) { if (this._property.PropertyTy

[fluent-nhib] Re: "length" attribute and conventions

2008-10-05 Thread James Gregory
Have you tried the WithLengthOf method? The SetAttribute method is really only there for situations where we haven't implemented the feature yet and its causing people problems. On Sun, Oct 5, 2008 at 10:52 PM, Pavel Samokha <[EMAIL PROTECTED]> wrote: > > Playing today with Fluent NHibernate (fro

[fluent-nhib] "length" attribute and conventions

2008-10-05 Thread Pavel Samokha
Playing today with Fluent NHibernate (from trunk) while prototyping new project I found annoying thing - SchemaExport always produce me "nvarchar(100)" for strings - so i try to understand why. I used the following: Map(x => x.Name).SetAttribute("length","1000"); And found that "length" attribut

[fluent-nhib] Small breaking change + join element support

2008-10-05 Thread James Gregory
Hey guys, Just giving you the heads-up that I've committed a very small breaking change to the repos. As part of implementing a feature, I've removed the set on the TableName property and provided a WithTable method instead. I'll give my reasoning in a moment, but if anybody has any serious issue w

[fluent-nhib] Re: Mapping interfaces

2008-10-05 Thread James Gregory
Just to chime in... I don't really have any problem with interfaces on entities, but you do have to question their merit. Entities shouldn't be in your container though. Injecting entities can get very nasty, because they have a finite lifespan that most likely will be shorter than that of the se

[fluent-nhib] Re: Mapping interfaces

2008-10-05 Thread Chad Myers
One more point (re: IPerson, Person, etc) Colin Jack made a good point: They're usually worthless and noise unless they offer some meaningful abstraction and are necessary for some specific purpose. All I'm saying is: Don't do it just for doing-it's sake. Entities should generally not have t

[fluent-nhib] Re: Mapping interfaces

2008-10-05 Thread Chad Myers
For some reason I didn't get Paul's message. Please allow me to clarify: I don't mind if entities implement interfaces, but I do think it's an anti-pattern to have them implement a 1-1 interface (i.e. ICustomer for Customer, IPerson for Person, etc). To answer your question, rpkelley, Entitie

[fluent-nhib] Re: Mapping interfaces

2008-10-05 Thread rpkelley
I don't fully understand why you should not use an IoC Container for entities I will accept that and research it further so that I do understand. So if you are not using an IoC Container for your entities then you do not need to have a type of ICustomer in your parent object, you would just map to