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

[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 brendanjer...@gmail.comwrote: 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

[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 jagregory@gmail.com 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 fi...@filovo.net wrote:

[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 IListRole Roles { get; set; } } Public Class Role { Public static Role AddPermit = New Role(1, AddPermit)

[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

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

[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 CustomTypeIsMyUserType() on your Roles property. On Mon, Mar 9, 2009 at 5:13 PM, Dave Woods d...@solidhouse.com wrote: I am doing manual mapping classes and I think I am stumped on this one: public class user {

[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 m...@chaliy.name 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

[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 oscil...@gmail.com wrote: Hi list, I posted an issue on the project site about Fluent Nhibernate generating

[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

[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

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

[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 mffmar...@gmail.comwrote: I'm trying to map the state pattern to NH as this page tells me to do:

[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) .SubClassSubClassType(m = m.Map(sc = sc.Name)); } On Wed, Mar 11, 2009 at 1:48 PM, James Gregory jagregory@gmail.comwrote:

[fluent-nhib] Re: IdBag

2009-03-11 Thread epitka
Wrong group, thought I was in NH forum On Mar 10, 1:36 pm, epitka exptrade2...@yahoo.com 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

[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 jagregory@gmail.com 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

[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 d...@solidhouse.com 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

[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

[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 d...@solidhouse.com 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

[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

[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

[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

[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

[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 jagregory@gmail.com wrote: Well, if you're not able to write tests, then another way would be to get the behavior you desire to work

[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 stevenly...@gmail.com wrote: Take II: This patch passes the tests.

[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 comra...@gmail.com wrote: That

[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 d...@solidhouse.com 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 IListRole

[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 bringe...@gmail.com wrote: Did you end up getting this to work? On Mar 9, 10:13 am, Dave Woods d...@solidhouse.com wrote: I am doing manual mapping classes and I think I am stumped on

[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 http://wiki.fluentnhibernate.org/show/Conventions - Convention

[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 jagregory@gmail.comwrote: ...and it's committed! *Hides from the angry mob of devs with broken

[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 paul.ba...@gmail.com wrote: Nice work James. I see you implemented shortcuts, they look nice. Now, lets have a chat about getting this into the semantic model

[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 d...@solidhouse.com wrote: I am doing manual mapping classes and I think I am stumped on this one: public

[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 : ClassMapPerson {