[fluent-nhib] JoinedSubClassPart

2009-03-11 Thread Craig van Nieuwkerk
I am not sure if this a problem with my Fluent configuration or some logic in my thinking. Basically I have a Person class from which I have two inherited classes, Author and Borrower (it's a library system). The mapping I have is. public class PersonMap : ClassMap { public Perso

[fluent-nhib] Re: HasMany Type Safe Enums

2009-03-11 Thread Paul Batum
Dave I think you deserve some sort of award. I think your code sample must be the first we've recieved that uses C# and VB interchangably :P On Tue, Mar 10, 2009 at 4:13 AM, Dave Woods wrote: > > I am doing manual mapping classes and I think I am stumped on this > one: > > public class user > {

[fluent-nhib] Re: Conventions overhaul

2009-03-11 Thread James Gregory
Sounds good, I'm out tomorrow but I'm free all weekend so I'll try to catch you then. On Wed, Mar 11, 2009 at 10:07 PM, Paul Batum wrote: > Nice work James. I see you implemented shortcuts, they look nice. > > Now, lets have a chat about getting this into the semantic model branch... > :) > > >

[fluent-nhib] Re: Conventions overhaul

2009-03-11 Thread Paul Batum
Nice work James. I see you implemented shortcuts, they look nice. Now, lets have a chat about getting this into the semantic model branch... :) On Thu, Mar 12, 2009 at 8:39 AM, James Gregory wrote: > ...and it's committed! *Hides from the angry mob of devs with broken > builds* > The wiki has be

[fluent-nhib] Re: Conventions overhaul

2009-03-11 Thread James Gregory
...and it's committed! *Hides from the angry mob of devs with broken builds* The wiki has been updated with the new syntax, as well as with some dedicated pages to conventions. - Conventions - Convention Interfaces

[fluent-nhib] Re: HasMany Type Safe Enums

2009-03-11 Thread Erik Lundby
I got it from the following Blog Post - he was using a ICompositeUserType but IUsertype works as well. http://www.codeinsanity.com/2009/02/using-fluent-nhibernate-in-rhineston e_12.html Map(prop => prop.Owner, "OwnerUsername").CustomTypeIs(typeof (RhinestoneUserType)); HasMany(prop

[fluent-nhib] Re: HasMany Type Safe Enums

2009-03-11 Thread James Gregory
@Erik: That's interesting, I've not seen that approach before. On Wed, Mar 11, 2009 at 8:49 PM, BringerOD wrote: > > Did you end up getting this to work? > > On Mar 9, 10:13 am, Dave Woods wrote: > > I am doing manual mapping classes and I think I am stumped on this > > one: > > > > public clas

[fluent-nhib] Re: HasMany Type Safe Enums

2009-03-11 Thread BringerOD
Did you end up getting this to work? On Mar 9, 10:13 am, Dave Woods wrote: > I am doing manual mapping classes and I think I am stumped on this > one: > > public class user > { >     public int UserId { get; set; } >     public string UserName { get; set; } >     public IList Roles { get; set; }

[fluent-nhib] Re: HasMany Type Safe Enums

2009-03-11 Thread Erik Lundby
Are you guys sure? I have the following working for a HasMany with IUserType and the existing code base: HasMany(p => p.AllowedTypes()). Access.AsCamelCaseField(Prefix.Underscore).AsElement("TicketType").AsBag (); Where the MyIUserTypeImplementation is the IUserType rather than allowint it

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

2009-03-11 Thread ComradeF
Sorry to bump this, but does anyone know what I need to do in order to get nvarchar(max) for a string field when using AutoMapping? Or am I going to have to manually alter the column after the database has been created? Thank you. On Mar 6, 10:37 pm, ComradeF wrote: > That must be the differenc

[fluent-nhib] Re: Constraints not making it to the database schema

2009-03-11 Thread James Gregory
Sorry guys, this one slipped under the radar. I'm swamped currently, but I should be doing a comb through of patches in the next few days. Filip: Hopefully you should be able to apply Steven's patch directly to your code for the time being. 2009/3/11 Filip Kinsky > > Is this applied to the trunk

[fluent-nhib] Re: Constraints not making it to the database schema

2009-03-11 Thread Filip Kinsky
Is this applied to the trunk? I'm just facing simmilar problems (on Oracle) - fields don't get length specified and FK names are generated randomly even though I specify both in my conventions... On 20 Ún, 01:47, Steven Lyons wrote: > Take II: This patch passes the tests. > > Index: src/FluentNH

[fluent-nhib] Re: Composite Key for resolving Many to Many Relationship

2009-03-11 Thread sianabanana
I think thats where i was about to look next. I will do this and then update. Thanks again for the support so far, On Mar 11, 3:48 pm, James Gregory wrote: > Well, if you're not able to write tests, then another way would be to get > the behavior you desire to work in standard NHibernate

[fluent-nhib] Re: InnoDB Tables

2009-03-11 Thread James Gregory
Do you know how to do this with regular NHibernate? If you don't, it's best you ask the question at the nhibernate users mailing list. Once you know that, we'll know how to implement the behavior for Fluent. http://groups.google.com/group/nhusers On Wed, Mar 11, 2009 at 3:42 PM, Tom Warnat wrote:

[fluent-nhib] Re: Composite Key for resolving Many to Many Relationship

2009-03-11 Thread James Gregory
Well, if you're not able to write tests, then another way would be to get the behavior you desire to work in standard NHibernate using the xml mappings. If you can succeed at that, then we can compare the mappings you're using with that to what FNH is generating. On Wed, Mar 11, 2009 at 3:42 PM, s

[fluent-nhib] InnoDB Tables

2009-03-11 Thread Tom Warnat
Hi, is there any way to force InnoDB while creating tables if the default storage engine is MyISAM? Changing the default storage engine is not an option for me, sadly, although it works. I use MySQL 5.0 enterprise with the NHibernate.Dialect.MySQL5Dialect. Thanks. --~--~-~

[fluent-nhib] Re: Composite Key for resolving Many to Many Relationship

2009-03-11 Thread sianabanana
If i swap the WithKeyRefrence to WithKeyProperty i get a mapping error on start up. It then cannot map the OrderProduct I wouldnt know where to start making some test cases for this? I dont know what you would expect to receive from me? On Mar 11, 3:37 pm, James Gregory wrote: > Neither of

[fluent-nhib] Re: Composite Key for resolving Many to Many Relationship

2009-03-11 Thread James Gregory
Neither of us said we don't like composite-ids, although that may be the case, we just don't have a great deal of experience using them. This is why we're not being all that helpful, because we don't fully understand them ourselves. You have to appreciate that for FNH to support a feature, all we h

[fluent-nhib] Re: Composite Key for resolving Many to Many Relationship

2009-03-11 Thread sianabanana
No more responses? Any one can shed any light. Here is the code from the example console application if anyone wants to have a go? using System; using System.Collections.Generic; using System.Linq; using System.Text; using FluentNHibernate; using Domain; using FluentNHibernate.AutoMap; using Fl

[fluent-nhib] Re: HasMany Type Safe Enums

2009-03-11 Thread James Gregory
Tell me about it! ;) On Wed, Mar 11, 2009 at 3:09 PM, David Woods wrote: > No worries. I will continue with my workaround for now. If I can find time > I will look into contributing a patch for this functionality (finding time > is always the hardest part). > > Dave > > > James Gregory wrote: >

[fluent-nhib] Re: HasMany Type Safe Enums

2009-03-11 Thread David Woods
No worries. I will continue with my workaround for now. If I can find time I will look into contributing a patch for this functionality (finding time is always the hardest part). Dave James Gregory wrote: > Damn, well spotted. Looks like we haven't implemented support for this > kind of behavi

[fluent-nhib] Re: HasMany Type Safe Enums

2009-03-11 Thread James Gregory
Damn, well spotted. Looks like we haven't implemented support for this kind of behavior yet. Sorry. On Wed, Mar 11, 2009 at 2:50 PM, David Woods wrote: > I got the IUserType stuff to work using a Map() and CustomTypeIs<> but I > don't see a CustomTypeIs<> method on a HasMany(). Am I going about

[fluent-nhib] Re: HasMany Type Safe Enums

2009-03-11 Thread David Woods
I got the IUserType stuff to work using a Map() and CustomTypeIs<> but I don't see a CustomTypeIs<> method on a HasMany(). Am I going about this the wrong way maybe? I have worked around it using an intermediary object which works but is a bit clunky :) James Gregory wrote: > You need an NHibe

[fluent-nhib] Re: Easiest way to configure all URI properties to custom IUserType

2009-03-11 Thread Mike Chaliy
Ok, not a problem. You guys rock! On 11 Бер, 14:46, James Gregory wrote: > Thanks, but I wouldn't waste your time. That sounds harsh, but there's going > to be a big conventions rewrite dropping very soon, I've got all the code > ready to commit and I'm just writing up the wiki changes now. So a

[fluent-nhib] Re: IdBag

2009-03-11 Thread epitka
Wrong group, thought I was in NH forum On Mar 10, 1:36 pm, epitka wrote: > Probably silly question, > but can IdBag be used for One-To-Many or is it only for Many-To-Many > situations --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

[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 > > public void CreateMap() > { > Id(s => s

[fluent-nhib] Re: Mapping sub classes

2009-03-11 Thread Martin Nilsson
Same error if I remove map to superclass Name public void CreateMap() { Id(s => s.Id); //Map(x => x.Name); DiscriminateSubClassesOnColumn("Name") .SubClass(m => m.Map(sc => sc.Name)); } On Wed, Mar 11, 2009 at 1:48 PM, James Gregory wrote: > I don't think you should be m

[fluent-nhib] Re: Mapping sub classes

2009-03-11 Thread James Gregory
I 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.lostechies.com/blogs/derickbailey/archive/2008/11/26/mapp

[fluent-nhib] Re: Easiest way to configure all URI properties to custom IUserType

2009-03-11 Thread James Gregory
Thanks, but I wouldn't waste your time. That sounds harsh, but there's going to be a big conventions rewrite dropping very soon, I've got all the code ready to commit and I'm just writing up the wiki changes now. So any changes you make will be redundant very soon. On Wed, Mar 11, 2009 at 12:42 PM

[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: Easiest way to configure all URI properties to custom IUserType

2009-03-11 Thread Mike Chaliy
Something like this: convention.OverrideType(t => t == typeof(Uri), typeof (NHibernateUriUserType)); This will elimenate additional ITypeConvention class. Also, if someone interested I can prepare patch. Follwing is psewdo code. public static class OverrideConventionExtensions { publi

[fluent-nhib] Re: Fluent generates partial reference assemblies

2009-03-11 Thread James Gregory
I don't think there'll be a problem with always specifying the full name, I can't see it doing any harm. Easiest thing to do for a patch is use SVN to generate a .patch file, then attach it to the issue you created. I'll pick it up and apply it as soon as I get the time. On Wed, Mar 11, 2009 at 11

[fluent-nhib] Re: Fluent generates partial reference assemblies

2009-03-11 Thread Sergio Costa
Ok, I got it. It's an typeof(T).Assembly.GetName().FullName instead of typeof (T).Assembly.GetName().Name You think it's worthwhile to make this setting changeable in the fluent config, or is it ok to always generate the full assembly name? I'll send a patch with the changes. (What's the proced

[fluent-nhib] Re: Testing against existing schema

2009-03-11 Thread Brendan Erwin
Yeah, I already use it. But it is really only effectively used against a generated database ( freshly empty ) since the tests are not idempotent. I tried wrapping the tests in a transaction that I always rolled back, but that didn't work. I need either a test that just compares the schema o

[fluent-nhib] Re: Fluent generates partial reference assemblies

2009-03-11 Thread James Gregory
That's a bug. You'll need to modify the offending area of code in the FNH codebase yourself, or wait until one of us has time to fix it. On Wed, Mar 11, 2009 at 9:17 AM, Sergio Costa wrote: > > Hi list, > > I posted an issue on the project site about Fluent Nhibernate > generating mappings with

[fluent-nhib] Re: Easiest way to configure all URI properties to custom IUserType

2009-03-11 Thread James Gregory
That's the correct way. How much easier do you want? On Tue, Mar 10, 2009 at 3:25 PM, Mike Chaliy wrote: > > Hi all, > > I have custom IUserType - UriUserType, how to configure AutoMapping to > use this type for all Uri properties? > > At this time I am using custom implementation of the ITypeCo

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

2009-03-11 Thread James Gregory
Use the WithLengthOf method. On Wed, Mar 11, 2009 at 9:42 AM, pangyan wrote: > > I've got this class: > > class Account > { >public int Id { get; set; } >public string FullName { get; set; } >public byte[] Photo { get; set; } > } > > When mapping Photo, using Map(x => x.Photo), it wo

[fluent-nhib] Re: HasMany Type Safe Enums

2009-03-11 Thread James Gregory
You need an NHibernate IUserType for Role, then you can specify that with CustomTypeIs() on your Roles property. On Mon, Mar 9, 2009 at 5:13 PM, Dave Woods wrote: > > I am doing manual mapping classes and I think I am stumped on this > one: > > public class user > { >public int UserId { get;

[fluent-nhib] Fluent generates partial reference assemblies

2009-03-11 Thread Sergio Costa
Hi list, I posted an issue on the project site about Fluent Nhibernate generating mappings with partial assembly names (i.e. AssemblyName instead of AssemblyName, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) My operating environment (WSS :S) requires all assemblies to be in

[fluent-nhib] Easiest way to configure all URI properties to custom IUserType

2009-03-11 Thread Mike Chaliy
Hi all, I have custom IUserType - UriUserType, how to configure AutoMapping to use this type for all Uri properties? At this time I am using custom implementation of the ITypeConvention and register it with convention.AddTypeConvention(). This is okay? Is there something more easy? --~--~--

[fluent-nhib] HasMany Type Safe Enums

2009-03-11 Thread Dave Woods
I am doing manual mapping classes and I think I am stumped on this one: public class user { public int UserId { get; set; } public string UserName { get; set; } public IList Roles { get; set; } } Public Class Role { Public static Role AddPermit = New Role(1, "AddPermit") Publ

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

2009-03-11 Thread pangyan
I've got this class: class Account { public int Id { get; set; } public string FullName { get; set; } public byte[] Photo { get; set; } } When mapping Photo, using Map(x => x.Photo), it works for small byte arrays (I'm guessing lessing than 8000 bytes). I want to allow byte arrays o

[fluent-nhib] Re: is it possible to combine ClassMap with conventions?

2009-03-11 Thread Filip Kinsky
perfect - thanks a lot for quick response. On 11 Bře, 09:49, James Gregory wrote: > Conventions can be applied to standard > ClassMaps.http://wiki.fluentnhibernate.org/show/StandardMappingConventions > > On Wed, Mar 11, 2009 at 7:51 AM, Filip Kinsky wrote: > > > I'm beginning with FluentNH and

[fluent-nhib] Re: Testing against existing schema

2009-03-11 Thread James Gregory
Did you see my message? Have you tried the PersistenceSpecification? On Tue, Mar 10, 2009 at 1:55 PM, Brendan Erwin wrote: > Hmmm. I guess I imagined it. :) > The issues I'm having are things like string truncation errors and missing > not nulls. Any ideas how I can get red/green testing to preve

[fluent-nhib] Re: is it possible to combine ClassMap with conventions?

2009-03-11 Thread James Gregory
Conventions can be applied to standard ClassMaps. http://wiki.fluentnhibernate.org/show/StandardMappingConventions On Wed, Mar 11, 2009 at 7:51 AM, Filip Kinsky wrote: > > I'm beginning with FluentNH and I'm just thinking if it's possible to > combine standard ClassMaps with conventions approach

[fluent-nhib] Re: Add ClassMap's conditionally/conventionally

2009-03-11 Thread James Gregory
Agreed, this is a good idea. There are a few more places that have similar functions which could do with it as well, but just add it to whichever ones you're using and I'll roll it out to everything else as and when I come across them. On Wed, Mar 11, 2009 at 2:23 AM, Paul Batum wrote: > I see n

[fluent-nhib] is it possible to combine ClassMap with conventions?

2009-03-11 Thread Filip Kinsky
I'm beginning with FluentNH and I'm just thinking if it's possible to combine standard ClassMaps with conventions approach. I think it's not possible, but I'm rather asking... I'd like for example to define that all string properties with name "Description" should map to "DESCR" field with length