[fluent-nhib] Re: Mapping composite user types with new conventions

2009-03-23 Thread James
Unfortunately this doesn't work because ICompositeUserType doesn't derive from IUserType and therefore the generic constraint on UserTypeConvention is not satisfied: The type 'TestProject.Data.NHibernateMaps.MoneyUserType' cannot be used as type parameter 'TUserType' in the generic type or method

[fluent-nhib] Re: Mapping composite user types with new conventions

2009-03-23 Thread James Gregory
Instead of IUserTypeConvention, try deriving from the base-class UserTypeConvention, see if that makes any difference. You should be able to do what you've written as: public class MoneyTypeConvention : UserTypeConvention {} On Mon, Mar 23, 2009 at 11:16 PM, James wrote: > > I'm having trou

[fluent-nhib] Re: When mapping a byte array, how do I specify the maximum size?

2009-03-23 Thread pangyan
Hmm, I did try that. With the latest Fluent NHibernate build (0.1.0.416), I get the following error: System.InvalidOperationException: Content is not a string It looks like WithLengthOf is only usable with strings, not byte arrays. On Mar 11, 3:06 pm, James Gregory wrote: > Use the WithLengthO

[fluent-nhib] Mapping composite user types with new conventions

2009-03-23 Thread James
I'm having trouble mapping composite user types with the new style conventions. I've done the following: public class MoneyTypeConvention : IUserTypeConvention { public bool Accept(IProperty target) { return Accept(target.PropertyType); } publ

[fluent-nhib] Re: Automapping many to many with new conventions code

2009-03-23 Thread James Gregory
I was unaware that ever worked, but I've created an issueand will investigate. As for the site, it's up and has been all day. On Mon, Mar 23, 2009 at 7:52 PM, Hitt wrote: > > Before the conventions rewrite, the following two classe

[fluent-nhib] Automapping many to many with new conventions code

2009-03-23 Thread Hitt
Before the conventions rewrite, the following two classes would map correctly: public class Example1 { //properties... public IList Example2s {get; set;} } public class Example2 { //properties... public IList Example1s {get; set;} } with

[fluent-nhib] Re: Sql2008 problem

2009-03-23 Thread Ralph Balck
yeah, what was it? thats a scary title to this post... :) On Mar 22, 4:34 am, James Gregory wrote: > What was it? > > On Sun, Mar 22, 2009 at 9:23 AM, Levin wrote: > > > Well,I've found the issue... > > Treat this post as nothing please:) > > > On Mar 21, 2:51 pm, Levin wrote: > > > Oh my~ >

[fluent-nhib] Re: PersistenceSpecification question

2009-03-23 Thread Bill
Thanks again James. I really appreciate all you're doing to try and help. I understand the trial and error part. :) I tried using a single ID instead of the composite and get the same error. But from what Derik said, it looks like I am still using the ProjectID key in both places. Here's my late

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

2009-03-23 Thread James Gregory
Hey Martin, The interfaces are lacking some of the methods simply because they weren't pulled up at time of creation, any that are missing most definitely should be introduced. As for conventions just for ToMany, that sounds like a good idea too. For the time being you could get away with using an

[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: PersistenceSpecification question

2009-03-23 Thread James Gregory
My mistake, I've just looked at the code and WithForeignKey is for setting the actual constraint name, so that's my point out of the window. I'm guessing now it's a conflict between your composite-id and references, are you able to test the behavior if you use a regular identity over a composite on

[fluent-nhib] Re: PersistenceSpecification question

2009-03-23 Thread Bill
Thanks James! This is an interesting problem. I can see the similarities to what I have except that Derik's example is with a property... for mine it is an identifier. If I remove the .WithColumns("ProjectID") then it generates it's own column name like this:

[fluent-nhib] Re: Overriding Components

2009-03-23 Thread James Gregory
If it's doable in the current code-base, then I say go for it. If I remember correctly, it's more just because I just didn't have the time than any impossibility. On Mon, Mar 23, 2009 at 1:08 PM, Martin Hornagold < martin.hornag...@marstangroup.com> wrote: > James, > > > > Thanks. Figured as muc

[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: Overriding Components

2009-03-23 Thread James Gregory
Hey Martin, It's kind of alluded to at the start of this wiki page, but barely, components are relatively unsupported with automapping; you either automap them completely, or not at all. So stuff like ignoring is not supported. There's no

[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: PersistenceSpecification question

2009-03-23 Thread James Gregory
Sorry Bill, I was out last night and missed your last message. Derik Whittaker actually blogged very recentlyon your exact error message. It's basicall