RE: [fluent-nhib] Re: Automapping an encapsulated Collection

2010-01-13 Thread Martin Hornagold
I think the change to a property was the right move. With regards to the convention, something like this should do the trick: public class EnumHasManyConvention : IHasManyConvention, IHasManyConventionAcceptance { public void Apply(IOneToManyCollectionInstance instance) {

RE: [fluent-nhib] Lazy="extra"

2010-01-11 Thread Martin Hornagold
This will probably go against the grain, but .. Personally I think it would be best to leave Lazy() alone and just create another method ExtraLazy() -Original Message- From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Paul Batum Sent: 11 Janu

RE: [fluent-nhib] Re: Discriminating sub classes with null values?

2010-01-04 Thread Martin Hornagold
Boz, If TypeA always has null for the collection property, can you not just move the property to the subclass TypeB, then all your problems go away: class TypeA { int Id; string Name; } class TypeB : TypeA { IList Children; }

RE: [fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-18 Thread Martin Hornagold
In your case you wouldn't need any extra members for the subclasses. Yes lose the SubId. -Original Message- From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of tbushell Sent: 17 December 2009 20:10 To: Fluent NHibernate Subject: [fluent-nhib]

RE: [fluent-nhib] Re: Convention for the key-column when using table per subclass inheritance

2009-12-16 Thread Martin Hornagold
You need the Column method of the Key property, i.e.: Instance.Key.Column(COLUMN_NAME); -Original Message- From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Doron Yaacoby Sent: 16 December 2009 12:48 To: Fluent NHibernate Subject: [f

RE: [fluent-nhib] SubclassMap with generic base classes

2009-11-13 Thread Martin Hornagold
Grabbed from S#arp Architecture latest release. I will update to latest on trunk and see if that makes a difference. If not will have a stab at fixing it (or at least creating a failing test at the weekend if I get a chance). From: James Gregory [mailto:jagregory@gmail.com] Sent: 13 Nove

[fluent-nhib] Re: Mapping Components

2009-10-01 Thread Martin Hornagold
I have done something similar to this in my project. Start by creating an AddressComponentMap class with a single static method named Map like so: public sealed class AddressComponentMap { public static void Map(ComponentPart part) { part.Map(x => x.AddressLine

[fluent-nhib] Re: Cascading

2009-09-17 Thread Martin Hornagold
in the fluent mappings for Company (it will override the conventions/defaults) >-Original Message- >From: fluent-nhibernate@googlegroups.com [mailto:fluent- >nhibern...@googlegroups.com] On Behalf Of Martin Hornagold >Sent: Thursday, September 17, 2009 11:13 AM >To: fl

[fluent-nhib] Re: Cascading

2009-09-17 Thread Martin Hornagold
I think the problem is you can't guarantee which order the conventions are applied, so it is probably best to also put an acceptance criteria on the Cascade All to ignore the CompanyType: public void Accept(IAcceptanceCriteria criteria) { criteria.Expect(x => x.Class != typeof

[fluent-nhib] Re: Table-per-concrete class mapping?

2009-06-16 Thread Martin Hornagold
Sounds to me like you don't need subclasses of any kind. You just need to tell FNH that DictionaryBase is a base type. If you are using S#arpArch you then modifying the IsBaseTypeConvention method in the AutoPersistenceModelGenerator to the following should do the trick: private bool IsB

[fluent-nhib] Re: Problems with guid primary keys and WithTable()

2009-06-03 Thread Martin Hornagold
James Gregory Sent: 03 June 2009 08:36 To: fluent-nhibernate@googlegroups.com Subject: [fluent-nhib] Re: Problems with guid primary keys and WithTable() That's a lot of steps, we should probably try to simplify that at some stage. Nice work though. On Mon, Jun 1, 2009 at 3:37 PM, Martin Horn

[fluent-nhib] Re: Problems with guid primary keys and WithTable()

2009-06-01 Thread Martin Hornagold
Brian, The steps to solving your problem are as follows: 1. Change your default primary key convention to only accept integral types and or ignore anything assigned by the AssignedKeyConvention: public bool Accept(IIdentityPart target) { return !(new AssignedIdConvention().Ac

[fluent-nhib] Re: Using a Custom Message Interpolator

2009-05-27 Thread Martin Hornagold
No its all to do with NHibernate.Validator by the looks of it. I think you would be best trying that group Craig. From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of James Gregory Sent: 27 May 2009 11:45 To: fluent-nhibernate@googlegroups.com Subje

[fluent-nhib] Re: nhibernate subclass problem

2009-05-27 Thread Martin Hornagold
Actually I think this an FNH issue, or a lack of understanding of the conventions at least. I assume that you have an IClassConvention to apply the pluralizer. This does what it says on the tin it only applies it to class maps or AutoMaps not to joined subclasses. You need to also implement a

[fluent-nhib] Re: AutoMap, Inheritance and Reference

2009-05-25 Thread Martin Hornagold
This is because AutoJoinedSubclass does not implement IJoinedSubclass. I raised this wayback and submitted a patch, but it never got applied. Until this is fixed you can't use conventions with AutoJoinedSubclass -Original Message- From: fluent-nhibernate@googlegroups.com [mailto:fluent-n

[fluent-nhib] Re: Conventions with manual FNH maps

2009-05-19 Thread Martin Hornagold
This is a S#arp arch issue. I have raised it on the S#arp arch list here: http://groups.google.com/group/sharp-architecture/browse_thread/thread/1 1f4ef8b02ce621f?hl=en -Original Message- From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of F

[fluent-nhib] Re: AutoMapping overrides for a base type create class mapping for base tpye

2009-04-17 Thread Martin Hornagold
2. loop through each mapping and apply any overrides that relate to the type or its base type 3. Apply the conventions What do others think? -Original Message- From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Martin

[fluent-nhib] Re: AutoMapping overrides for a base type create class mapping for base tpye

2009-04-17 Thread Martin Hornagold
I have just checked and this is a bug. Neither AutoMappingOverrideAlteration.Alter or ForTypesThatDeriveFrom do any checks for IsBaseType (or the new IsConcreteBaseType) and so will create a class mapping for the base type. I will try to come up with a patch, although I am not sure that it is tha

[fluent-nhib] Re: Component Columnnaming Convention

2009-04-17 Thread Martin Hornagold
The Wiki says to use an IComponentConvention. The easiest way to do it to is use the GetComponentColumnPrefix setup expression within your WithSetup on the AutoPersistenceModel .WithSetup(setup => setup.GetComponentColumnPrefix = property => property.Name); I’m not sure if this method w

[fluent-nhib] Re: conventions & overrides

2009-04-17 Thread Martin Hornagold
all? On Apr 16, 9:40 am, "Martin Hornagold" wrote: > The trouble with burying logic like that in the apply methods is that it > makes it less maintainable. > In the case of your Email string length this is clearly a new different > convention. > By having separate con

[fluent-nhib] Re: conventions & overrides

2009-04-17 Thread Martin Hornagold
You cannot check whether the attribute has been set by another convention as you cannot guarantee the order the conventions are applied. This would work if you were setting the edge case in the mapping overrides. But again this is putting logic in the wrong place. The overrides are not convention

[fluent-nhib] Re: conventions & overrides

2009-04-16 Thread Martin Hornagold
by convention? On Apr 16, 8:44 am, "Martin Hornagold" wrote: > Berryl, > > The best way I have found is to create a separate property convention > for the edge case. > In this property convention create a static Accepts method to allow > cleaner calling

[fluent-nhib] Re: conventions & overrides

2009-04-16 Thread Martin Hornagold
Berryl, The best way I have found is to create a separate property convention for the edge case. In this property convention create a static Accepts method to allow cleaner calling of it from the default convention: public class EmailStringLengthConvention : IPropertyConvention { public

[fluent-nhib] Re: Updating collection gives null id error

2009-04-15 Thread Martin Hornagold
, I'd love to see a simple example. -- Jeremy Wadsack On Wed, Apr 15, 2009 at 8:26 AM, Martin Hornagold wrote: Malcolm, I know it is off topic. But if this is a real project it may be worth looking at your design and making it a uni-directional association. The model as shown belo

[fluent-nhib] Re: Updating collection gives null id error

2009-04-15 Thread Martin Hornagold
Malcolm, I know it is off topic. But if this is a real project it may be worth looking at your design and making it a uni-directional association. The model as shown below means an ingredient can only be used in one recipe ;) From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern.

[fluent-nhib] Re: Multiple Inheritance strategies in the same hierarchy

2009-04-03 Thread Martin Hornagold
in revision 441 and closed out your issue. Thanks for the patch Martin :) On Thu, Apr 2, 2009 at 10:48 AM, James Gregory wrote: Im not in a position to apply anything until Sunday, but if nobody else has done it by then I'll apply it. On 4/2/09, Martin Hornagold wrote: > > Previou

[fluent-nhib] Re: Adding FindAll() and Query() to IRepository?

2009-04-02 Thread Martin Hornagold
Jon, I think you've got your frameworks mixed up. IRepository is in S#arpArch :) -Original Message- From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Jon Kruger Sent: 02 April 2009 16:04 To: Fluent NHibernate Subject: [fluent-nhib] Adding F

[fluent-nhib] Re: Multiple Inheritance strategies in the same hierarchy

2009-04-02 Thread Martin Hornagold
Previous patch was incomplete. I have updated the issue and the patch: http://code.google.com/p/fluent-nhibernate/issues/detail?id=179 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To po

[fluent-nhib] Re: Multiple Inheritance strategies in the same hierarchy

2009-04-02 Thread Martin Hornagold
James, I have added an issue with a patch to fix: http://code.google.com/p/fluent-nhibernate/issues/detail?id=179 I would be grateful if you could consider adding it to the trunk. Martin -Original Message- From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.

[fluent-nhib] Re: Replacement for TheColumnNameIs in PropertyMap

2009-03-30 Thread Martin Hornagold
gh, because that'll conflict. On Mon, Mar 30, 2009 at 4:48 PM, Martin Hornagold wrote: Seems fair to me. @PaulYoder, if you can't wait for the rewrite you could add your own extension method like so: public static class FluentNHExtensions { public static IProp

[fluent-nhib] Re: Replacement for TheColumnNameIs in PropertyMap

2009-03-30 Thread Martin Hornagold
Seems fair to me. @PaulYoder, if you can't wait for the rewrite you could add your own extension method like so: public static class FluentNHExtensions { public static IProperty ColumnNames(this IProperty property, params string[] columnNames) { property.

[fluent-nhib] Re: IJoinedSubClassConvention never called

2009-03-27 Thread Martin Hornagold
you could apply it to the trunk Martin From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Martin Hornagold Sent: 25 March 2009 12:55 To: fluent-nhibernate@googlegroups.com Subject: [fluent-nhib] Re: IJoinedSubClassConvention never called

[fluent-nhib] Re: .WithTable in IAutoMappingOverride doesn't override IClassConvention

2009-03-25 Thread Martin Hornagold
fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Martin Hornagold Sent: 25 March 2009 16:27 To: fluent-nhibernate@googlegroups.com Subject: [fluent-nhib] Re: .WithTable in IAutoMappingOverride doesn't override IClassConvention James/Billy, Attached is a pa

[fluent-nhib] Re: IJoinedSubClassConvention never called

2009-03-25 Thread Martin Hornagold
12:04 PM, Martin Hornagold wrote: James, The only other thing of note is that my initial description of the inheritance hierarchy is slightly lacking. I have my own Base classes which inherit from EntityWithTypedId from S#arp so the actual inheritance hierarchy is as f

[fluent-nhib] Re: IJoinedSubClassConvention never called

2009-03-25 Thread Martin Hornagold
| BaseEntityWithTypedId | BaseEntity : BaseEntityWithTypedId | Person | Author Martin From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Martin Hornagold Sent: 25 March 2009 11:58 To: fluent-nhibernate@googlegroups.com Subject

[fluent-nhib] Re: IJoinedSubClassConvention never called

2009-03-25 Thread Martin Hornagold
(IJoinedSubclass target) { target.SetAttribute("test", "true"); } } On Tue, Mar 24, 2009 at 10:28 AM, Martin Hornagold wrote: FYI, I just tried removing the override and it still never gets called. -Original Message- From: fluent-nhibernate@g

[fluent-nhib] Re: IJoinedSubClassConvention never called

2009-03-25 Thread Martin Hornagold
dSubclassConvention : IJoinedSubclassConvention { public bool Accept(IJoinedSubclass target) { return true; } public void Apply(IJoinedSubclass target) { target.SetAttribute("test", "true"); } } On Tue, Mar 24, 2009 at 10:28

[fluent-nhib] Re: .WithTable in IAutoMappingOverride doesn't override IClassConvention

2009-03-25 Thread Martin Hornagold
Billy, I agree with James. The beauty of the new conventions system is that you can selectively apply conventions to classes. I notice from your comment about class exclusions and your comments in the PrimaryKeyConvention class in S#arp that you seem to be shying away from this. I have be

[fluent-nhib] Re: IJoinedSubClassConvention never called

2009-03-24 Thread Martin Hornagold
FYI, I just tried removing the override and it still never gets called. -Original Message- From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Martin Sent: 24 March 2009 10:15 To: Fluent NHibernate Subject: [fluent-nhib] IJoinedSubClassConvent

[fluent-nhib] Re: Overriding Components

2009-03-23 Thread Martin Hornagold
James, Thanks. Figured as much, just wanted to check I wasn't missing anything. Is it worth any of us investigating promoting components to first class citizens on the trunk? Or do you think this is something that should be left for the rewrite? Martin From: fluent-nhibernate@googlegr

[fluent-nhib] Re: Id Naming Convention

2009-03-13 Thread Martin Hornagold
James, I am having a slight problem with Id conventions. This is my approach on trying to get the S#arp architecture (northwind) sample application to work with the new conventions: public class PrimaryKeyNameConvention : IIdConvention { public bool Accept(IIdentityPart targe

[fluent-nhib] Re: Base types using new conventions?

2009-03-12 Thread Martin Hornagold
Superb, many thanks for the prompt response. Loving the new conventions, much cleaner implementation. From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of James Gregory Sent: 12 March 2009 12:11 To: fluent-nhibernate@googlegroups.com Subject: [fluen

[fluent-nhib] Re: Testing against existing schema

2009-03-10 Thread Martin Hornagold
S#arp Architecture users are using the simple sanity check from Ayende: http://ayende.com/Blog/archive/2006/08/09/NHibernateMappingCreatingSanit yChecks.aspx From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of James Gregory Sent: 10 March 200

[fluent-nhib] Re: Conventions overhaul

2009-03-04 Thread Martin Hornagold
YE!! Fantastic. We are not worthy James. This will likely solve all my slightly uneasy feelings about conventions and prevent further hair loss due to head scratching. Can't wait to get my hands on it From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googl