[fluent-nhib] Re: Table name when automapping a collection of simple types

2011-02-11 Thread Martin Larsen
ing change, but at least at would be fixable. -- Martin -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com. To unsubscribe from this group, send email t

[fluent-nhib] Re: Table name when automapping a collection of simple types

2011-02-08 Thread Martin Larsen
No one got any input on this? Is it just me being dense? ;-) -- Martin On Wednesday, February 2, 2011 3:21:06 PM UTC+1, Martin Larsen wrote: > > Hi there. > > I'm using the automapper to map a collection of strings. The mapping is > working, but I'm wondering ab

[fluent-nhib] Table name when automapping a collection of simple types

2011-02-02 Thread Martin Larsen
ep I've added mapping.SetDefaultValue(x => x.TableName, classMap.Type.Name + " _" + member.Name); which seems to do what I want. -- Martin -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send e

[fluent-nhib] Re: Automap inner class

2010-06-26 Thread Martin Nilsson
Yes, that's correct. Sorry about that. Should I change it and do a new request or how does it work. On Sunday, June 27, 2010, Paul Batum wrote: > Hi Martin, > > I'm processing your pull request today. It all looks good, except I am > guessing that there is a copy and pa

Re: [fluent-nhib] Re: Automap inner class

2010-06-22 Thread Martin Nilsson
yet. On Mon, Jun 21, 2010 at 10:26 PM, James Gregory wrote: > This is by design. Arguably a bad design. If you want to use nested classes > you'll need to modify the FNH code (and preferably send us a pull request). > > Sent from my jelly bone > > On 21 Jun

[fluent-nhib] Re: Automap inner class

2010-06-21 Thread Martin Nilsson
x27;t understand why. On Tue, Jun 15, 2010 at 8:13 AM, Martin Nilsson wrote: > Hi, > > How do I auto map inner classes in FNH? > If I change Employee in the Examples.FirstAutomappedProject to have an > inner class (Name) I get this exception: > > "An association from

[fluent-nhib] Automap inner class

2010-06-14 Thread Martin Nilsson
Hi, How do I auto map inner classes in FNH? If I change Employee in the Examples.FirstAutomappedProject to have an inner class (Name) I get this exception: "An association from the table Employee refers to an unmapped class: Examples.FirstAutomappedProject.Entities.Employee+Name" namespace Examp

[fluent-nhib] Re: Base Entity type and Constructor logic

2010-02-19 Thread Martin From
... > > On Mon, Feb 15, 2010 at 7:34 PM, Mikael Henriksson > wrote: > > > > > James was working on moving FNH to a virtual private server I think... He > > probably got lost playing games and forgot about it :) > > > On Mon, Feb 15, 2010 at 3:35 AM, Marti

[fluent-nhib] Base Entity type and Constructor logic

2010-02-14 Thread Martin From
nhibernate internally know that the CreatedAt property was assigned before the object data was fetched from the database and it should not be used when updating? Best regards Martin ps. www.fluentnhibernate.org just gives me page saying "It works! This is the default web page for this server

[fluent-nhib] Re: Understanding Inverse for use in a Convention

2010-02-05 Thread Martin From
Hello Hudson, thanks for a very quick and good reply. Your explanation is great! I should be able to create the conventions with this new "knowlegde" :) Martin On 5 Feb., 21:27, Hudson Akridge wrote: > > Basically it means that the other side of the join is the parent/

[fluent-nhib] Understanding Inverse for use in a Convention

2010-02-05 Thread Martin From
posite of what i think? - That Inverse() should be set on the side that is responsible of saving the objects in the other end of the join ? Or maybe it means something else ? :) Martin ps. i guess how Inverse() works is more a Hibernate related question, but what i am trying to do is create a Flu

[fluent-nhib] Re: Component Convention - how to specify column

2010-02-03 Thread Martin From
Hello James, thanks for the answer. I will keep my current way of doing it, and wait and see if it will be changed/fixed sometime in the future. :) Martin On Feb 3, 8:44 pm, James Gregory wrote: > The best way is the way that you've done it, with the > GetComponentColumnPref

[fluent-nhib] Component Convention - how to specify column

2010-02-03 Thread Martin From
.Column(columnName) <- How can it be done !?!??!! } } } The problem seems that instance.Properties returns IPropertyInspector and not IPropertyInstance so i can call the property.Column() method. How can i set the column name for each property ? Martin ps. right

[fluent-nhib] Re: Length, Not.Nullable and Nullable Ints as Id ?

2010-01-17 Thread Martin From
ommend moving away from > ints for your Id's unless you're tied down with legacy schema. There's > plenty of good reasons to switch to something like GUID's. I've got a quick > post here giving some pro's and cons of > both:http://www.bestguesstheory.com/2009

[fluent-nhib] Length, Not.Nullable and Nullable Ints as Id ?

2010-01-17 Thread Martin From
ng special i should have in mind to be able to make it work ? and reason why it can not be recommended? Best regards Martin ps. Is there a list with all default conventions somewhere ? -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate&quo

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
-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug? Martin, I think I'm starting to get this, except for one thing... You've introduced two new classes that inherit from DistributionResult, but don't show any members for them. What, if anything,

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

2009-12-17 Thread Martin
I still think the best alternative is to look at Hudsons earlier advice and use inheritance. Using your example: public class DistributionResult{ } public class LogNormalDistributionResult : DistributionResult { ... } public class ContinDistributionResult : DistributionResult { .

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] Mapping a dictionary with components

2009-12-06 Thread Martin Nilsson
Thanks Morten! It worked. Thought that it was more FNH than a NH issue because it was in the mapping so that's why I posted it here. Anyhow, thanks again. /martin On Sat, Dec 5, 2009 at 11:53 PM, Morten Maxild wrote: > This is NH specific, but anyway….please cross post on nhusers &

[fluent-nhib] Mapping a dictionary with components

2009-12-05 Thread Martin Nilsson
Hi, I have a dictionary field in my Product class that contains prices (Money class) per region. In other words, a dictionary containg Value Objects. I can save the prices with correct region and amount but when I read them from the database then I can't get the region name (Money.RegionName) to

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

2009-11-13 Thread Martin Hornagold
don't think there's anything specific to your issue. On Fri, Nov 13, 2009 at 3:56 PM, Martin wrote: Hi, I am trying to map a subclass where the base type is generic. An overview of the class model is: public class GenericBaseClass : Entity { } public class SubClass : G

[fluent-nhib] SubclassMap with generic base classes

2009-11-13 Thread Martin
Hi, I am trying to map a subclass where the base type is generic. An overview of the class model is: public class GenericBaseClass : Entity { } public class SubClass : GenericBaseClass{ ... } I am using fluent mappings. I have a ClassMap for GenericBaseClass, which successfully fire

[fluent-nhib] Re: If you've been using the paulbatum/fluent-nhibernate repository...

2009-10-17 Thread Martin Nilsson
Thanks! Appreciate the changes you made Paul. On Sat, Oct 17, 2009 at 10:54 AM, Paul Batum wrote: > I know a few FNH users have been using my dev branch on my github > repository for the last month or so because it had some useful changes. > James has now pulled these changes into the official t

[fluent-nhib] Re: NaturalKey feature

2009-10-06 Thread Martin Nilsson
Do you really want to decorate your class with fluent-nhibernate attributes? On Tue, Oct 6, 2009 at 12:48 AM, craigp wrote: > > Hi - > > I'm fairly new to fluent-nhibernate; it's looking very good (*finally* > an elegant api for C# db code). > > I'd like to have some way to automatically implem

[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: Medium Trust

2009-09-30 Thread Martin Nilsson
I don't know why you get this but if add "" to your web.config you will be noticed about this problem when running locally instead of when it's in production. /martin On Wed, Sep 30, 2009 at 12:33 PM, Josh Pollard wrote: > > I tried searching for this, but Medium Tru

[fluent-nhib] Re: Verify Enumerable Property

2009-09-23 Thread Martin Nilsson
Paul, This is working great! Now I have one more reason (the other is filter support) to stay with your branch. Many thanks! /martin On Tue, Sep 22, 2009 at 3:07 PM, Paul Batum wrote: > Hi Martin, > > Thanks for your email. I was sick of this not being supported so I decided > to

[fluent-nhib] Re: How can i get legth attribute

2009-09-17 Thread Martin Nilsson
Use a constant "Map(x => x.Status).Length(MaxStatusLength)" prop Status() ValidateLength(MaxStatusLength) On Thu, Sep 17, 2009 at 4:06 PM, Marcel Amorim wrote: > > How can i get the length attribute of "Map(x => x.Status).Length(1)" > in other class for validations??? > help please. > > >

[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] Verify Enumerable Property

2009-09-16 Thread Martin Nilsson
Is there a workaround to test mapping for classes like this (list exposed as enumerable)? public class Category { private readonly IList children; public virtual Guid Id { get; set; } public virtual string Name { get; set; } public Category() { children = new List();

[fluent-nhib] Server down at wiki.fluentnhibernate.org

2009-09-12 Thread Martin Nilsson
It seems to that http://wiki.fluentnhibernate.org/ is not up and running --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.c

[fluent-nhib] Re: nhibernate filter support

2009-09-11 Thread Martin Nilsson
This is great! Just what I have been looking for. Although I had to spend yesterday upgrading many of my dependencies (castle, nh, rhino, castle contrig, ..). But now they work at least. My problem now is that I get exception below exception in PersistenceModel:226 (row is marked with "=>") (Syste

[fluent-nhib] Re: How to use SubclassMap with Discriminator of type int

2009-08-17 Thread Martin Nyborg
Yes there are but it only takes a string On Aug 17, 3:50 pm, James Gregory wrote: > Off the top of my head, I think there's a DiscriminatorValue method in > SubclassMap. > > > > On Mon, Aug 17, 2009 at 1:59 PM, Martin Nyborg wrote: > > > Ups I hit the return

[fluent-nhib] Re: How to use SubclassMap with Discriminator of type int

2009-08-17 Thread Martin Nyborg
Ups I hit the return key. I try again To start with, yes I have read the wiki :-) And congratulation with the release. Fluent NHibernate is very importing for me and my team. here is the code I am trying to convert to SubclassMap DiscriminateSubClassesOnColumn("SiteTypeDiscriminator", 0)

[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] CheckReference a Proxy class

2009-06-13 Thread Martin Nilsson
CheckReference in below test fails due to that PersistenceSpecification returns a proxy class so "obj.GetType() != typeof(Category)" fails in Category.Equals. I had to add a check if type starts with CategoryProxy which is not nice. Anyone has a better solution? [TestFixture] public class Product

[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
that trivial. -Original Message- From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Martin Sent: 17 April 2009 14:42 To: Fluent NHibernate Subject: [fluent-nhib] AutoMapping overrides for a base type create class mapping for base tpye Hi, I

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

2009-04-17 Thread Martin
Hi, I have hit a stumbling block with inheritance and automapping again. I need to put an override for the mappings of a base type. But when I do that either through an IAutoMappingOverride or using ForTypesThatDeriveFrom it tries to create a class mapping for the base type. My base type is marke

[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] Mapping a nested-composite-element

2009-04-08 Thread Martin
=182 I would be grateful if one of the committers could add to the trunk. Martin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-

[fluent-nhib] Mapping a nested-composite-element

2009-04-08 Thread Martin
=182 I would be grateful if one of the committers could add to the trunk. Martin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-

[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

[fluent-nhib] Multiple Inheritance strategies in the same

2009-04-02 Thread Martin
. In the AutoMapper do not add any joinedSubclasses if IsConcreteBaseType Thoughts? I will be patching my working copy to include this in any event, do you want me to submit as an issue? Martin --~--~-~--~~~---~--~~ You received this message because you are

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

2009-03-30 Thread Martin Hornagold
ut it seems to me that this would satisfy both Jon's and Pauls suggestions without breaking the existing base or the conventions. Martin From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of James Gregory Sent: 30 March 2009 17:54 To: fluent-

[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: Mapping IDictionary (Key/Value)

2009-03-25 Thread Martin Nilsson
Is it possible to map dictionaries now? Then this is fixed or? http://code.google.com/p/fluent-nhibernate/issues/detail?id=94 On Wed, Mar 25, 2009 at 2:24 PM, James Gregory wrote: > So to clarify, your QuoteProperty class doesn't have a property that maps > to the value of your key in the dictio

[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
James, Just tried adding the convention explicitly to rule out a discovery problem and it still never gets called. Martin From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of James Gregory Sent: 25 March 2009 11:25 To: fluent-nhibernate

[fluent-nhib] Re: IJoinedSubClassConvention never called

2009-03-25 Thread Martin Hornagold
: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of James Gregory Sent: 25 March 2009 11:25 To: fluent-nhibernate@googlegroups.com Subject: [fluent-nhib] Re: IJoinedSubClassConvention never called Hey Martin, Could you show me your convention code, and

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

2009-03-25 Thread Martin Hornagold
than just PrimaryKeyConvention We should have Pluralized and Singular table name conventions. There should also Lazy and NonLazy class conventions which would again reduce the need for overrides and are more maintainable. Just my 2 pennies Martin From: fluent-nhibernate@google

[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

[fluent-nhib] IJoinedSubClassConvention never called

2009-03-24 Thread Martin
Hi, I have the following class structure: BaseEntity | Person | Author The mapping all works out perfectly, Person is mapped as a class with the Id inherited from the base class, and Author is set as a JoinedSubClass. The problem is that my project has a convention of pluralised tab

[fluent-nhib] As(Set/List/Bag) on ICollectionRelationship and an IToManyConvention

2009-03-23 Thread Martin
James, In a current project the majority of my one to many and many to many are sets rather than bags. Currently AsSet, AsList, AsBag are implemented in ToManyBase, but there is no contract in ICollectionRelationship. Therefore they are not available to conventions which use IOneToManyPart or IMa

[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-nhibe

[fluent-nhib] Overriding Components

2009-03-23 Thread Martin
James/Paul, Currently there appears to be no easy way of overriding the mapping of components when using auto persistence. I have a value object that has a public readonly property I need to ignore in the mappings. If I use IAutoMappingOverride it tries to map the value object as an entity and th

[fluent-nhib] Re: Id Naming Convention

2009-03-13 Thread Martin Hornagold
&& type.GetGenericTypeDefinition()==typeof(EntityWithTypedId<>))) target.TheColumnNameIs(target.Property.ReflectedType.Name + "ID"); } } See the comments about the weirdness with reflection. Am I going about it the wrong way. Cheers, Martin From: fluent-nhi

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

2009-03-12 Thread Martin Hornagold
: [fluent-nhib] Re: Base types using new conventions? It's still there, you just access it through WithSetup instead of WithConvention now. On Thu, Mar 12, 2009 at 12:06 PM, Martin wrote: Hi James (or anyone else), I am probably being daft, but what is the best way to deal with base types

[fluent-nhib] Base types using new conventions?

2009-03-12 Thread Martin
Hi James (or anyone else), I am probably being daft, but what is the best way to deal with base types using the new conventions overhaul. In short what is the replacement for IsBaseType? --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[fluent-nhib] Re: Mapping sub classes

2009-03-11 Thread Martin Nilsson
Found it! DiscriminateSubClassesOnColumn("Type") .SubClass(m => m.Map(sc => sc.Name)); Note the changed column name "Name" -> "Type" On Wed, Mar 11, 2009 at 2:01 PM, Martin Nilsson wrote: > Same error if I remove map to superclass Name &g

[fluent-nhib] Re: Mapping sub classes

2009-03-11 Thread Martin Nilsson
don't think you should be mapping Name in the SuperClassTypeMap as well > as in the subclasses. > > > On Wed, Mar 11, 2009 at 12:44 PM, Martin Nilsson wrote: > >> I'm trying to map the state pattern to NH as this page tells me to do: >> >> http://www.

[fluent-nhib] Mapping sub classes

2009-03-11 Thread Martin Nilsson
I'm trying to map the state pattern to NH as this page tells me to do: http://www.lostechies.com/blogs/derickbailey/archive/2008/11/26/mapping-a-state-pattern-with-nhibernate.aspx But when I'm trying to persist my states I get error: "Invalid index 0 for this SqlParameterCollection with Count=0"

[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] Fails to map many-to-many to a dictionary

2009-03-07 Thread Martin Nilsson
I'm failing to map many-to-many to a dictionary. Added this mapping to ManyToManyIntegrationTester "HasManyToMany(x => x.MapOfChildren).AsMap(child => child.Key).Access.AsCamelCaseField();" It fails with this message: "System.Xml.Schema.XmlSchemaValidationException: The element 'map' in namespac

[fluent-nhib] Re: AutoMappings strings always nvarchar(255)

2009-03-05 Thread Martin Nilsson
Fluent On Thu, Mar 5, 2009 at 4:05 PM, ComradeF wrote: > > That's odd... shouldn't r368 contain the fix, then? WithLengthOf() > doesn't have any affect on my field definitions. > > Martin, what sort of mapping configuration were you using? Fluent or > Auto? I&#

[fluent-nhib] Re: AutoMappings strings always nvarchar(255)

2009-03-04 Thread Martin Nilsson
Without checking if it was fixed after your version but there was a fix for this http://groups.google.com/group/fluent-nhibernate/browse_thread/thread/f210c6573bab3d8d/eac2e0190626f3b0 On Wed, Mar 4, 2009 at 6:12 PM, ComradeF wrote: > > A quick link back to the only information I've found on th

[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

[fluent-nhib] AutoMapping with an inherited class duplicates component mapping

2009-02-26 Thread Martin
Hi, I am using auto mapping and have come across a case where I have an inherited class which correctly maps as a joined subclass for the most part ... But the base class has a property which is marked as a component In the joined subclass generated the component is duplicated. Is there anyway I

[fluent-nhib] Fails to build for NH 2.1

2009-02-25 Thread Martin Nilsson
This fails for me: trunk>rake nhib21 Build log attached. But here is the first error: 1) Test Error : FluentNHibernate.Testing.DomainModel.ConnectedTester.CanWorkWithNestedSubClasses System.Data.SQLite.SQLiteException : SQLite error unrecognized token: "" (Id integer, Name TEXT, primary key

[fluent-nhib] AutoPersistenceModel - Conventions ignored for sub sub classes when using IsBaseType

2009-02-24 Thread Martin
is great and exactly what I want but with one exception .. It ignores any conventions that are applied (such as table name and column length conventions) and returns to the AutoPersistenceModel default Is there another way I should be dealing with this type of inheritance structure. Cheers, Martin

[fluent-nhib] Inheritance and conventions

2009-02-24 Thread Martin
(if IsBaseTyp is specified). If so what is the best way to get conventions applied to further sub classes. Martin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this g

[fluent-nhib] Re: Problem with Property.WithLengthOf

2009-02-23 Thread Martin Nilsson
forum, so it's just >> inline in the last message of the thread. You can just copy the text >> into a .patch file and apply it to your working copy. >> >> >> On Feb 23, 1:33 pm, Martin Nilsson wrote: >> > Thanks! >> > But I couldn't fin

[fluent-nhib] Re: Problem with Property.WithLengthOf

2009-02-23 Thread Martin Nilsson
Thanks! But I couldn't find the patch to apply for this fix. On Mon, Feb 23, 2009 at 7:10 PM, Steven Lyons wrote: > > Martin, > > This is a problem that is known. If you want to fix it in your source > until it gets fixed, you can find a patch I made in th

[fluent-nhib] Problem with Property.WithLengthOf

2009-02-22 Thread Martin Nilsson
More info in this thread because I thought it was a problem in NH http://groups.google.com/group/nhusers/browse_thread/thread/81e8cffa5a0a0fb4 Class: public class Entity { public virtual Guid Id { get; set; } public virtual string Content { get; set; } } Mapping: public EntityMap() { Id(x =

[fluent-nhib] Add multiple mappings

2009-02-18 Thread Martin Nilsson
I'm looking into replacing Castle ActiveRecord with FNH. I have an application built with modules and each module provide it's configuration for AR so I can get the AR entities. I don't know how to do that in FNH. I have considered these approaches. 1. Let each module provide a MappingConfiguratio

[fluent-nhib] Re: Configure database-object

2009-02-15 Thread Martin Nilsson
ow when. > > > On Sun, Feb 15, 2009 at 9:08 AM, Martin Nilsson wrote: > >> I want my Order class to have a more user friendly order number and use >> Guid as the entity id. I'm using Castle ActiveRecord so I started this >> thread, http://tinyurl.com/b6ulmz >>

[fluent-nhib] Configure database-object

2009-02-15 Thread Martin Nilsson
I want my Order class to have a more user friendly order number and use Guid as the entity id. I'm using Castle ActiveRecord so I started this thread, http://tinyurl.com/b6ulmz It seems that the Generated property(Cha

[fluent-nhib] Question about mapping joined-subclass extends

2008-11-25 Thread Martin Faartoft
x.Id)); subClassMap.Map(x => x.SomeProperty) ... } } This simply won't work in my situation - I need something akin to the NHibernate xml mapping: ... Is this possible with Fluent NHibernate? Regards, Martin Faartoft --~--~-~--~~~

  1   2   >